﻿//Social Media links

function dg_click() {
    u = location.href;
    t = document.title;
    window.open('http://digg.com/submit?url=' + encodeURIComponent(u) + '&title=' + encodeURIComponent(t) + '&bodytext=' + encodeURIComponent(t) + '&media=news&topic=tech_news', 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function ms_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.myspace.com/Modules/PostTo/Pages/?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t) + '&c=', 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function fb_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function dl_click() {
    u = location.href;
    t = document.title;
    window.open('http://delicious.com/post?url=' + encodeURIComponent(u) + '&title=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function tw_click() {
    u = location.href;
    t = document.title;
    window.open('http://twitter.com/home?status=' + encodeURIComponent(t) + '%20' + encodeURIComponent(u), 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function su_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.stumbleupon.com/submit?url=' + encodeURIComponent(u) + '&title=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,scrollbars=1,width=800,height=600');
    return false;
}

function newWindow(imageName, imageWidth, imageHeight, alt) {
    var posLeft = (screen.width) ? (screen.width - imageWidth) / 2 : 100;
    var posTop = (screen.height) ? (screen.height - imageHeight) / 2 : 100;
    var newWindow = window.open("", "newWindow", "width=" + imageWidth + ",height=" + imageHeight + ",left=" + posLeft + ",top=" + posTop);
    newWindow.document.open();
    newWindow.document.write('<ht' + 'ml><tit' + 'le>' + alt + '</tit' + 'le><bo' + 'dy bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
    newWindow.document.write('<a href=javascript:self.close()><img src=' + imageName + ' border=0 width=' + imageWidth + ' height=' + imageHeight + ' alt=\"' + alt + '\"></a>');
    newWindow.document.write('</bo' + 'dy></ht' + 'ml>');
    newWindow.document.close();
    newWindow.focus();
}

function IsValidEmailAddress(strEmail) {
    if (strEmail.length == 0) {
        return false;
    }
    var filter = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    return filter.test(strEmail);
}

$(document).ready(function () {
    $("a[rel^='prettyPhoto']").prettyPhoto();
});
$(function () {
   // MM_preloadImages('/images/logoslider_hub_c.png','/images/logoslider_canadaloyal_c.png','/images/logoslider_wcs_c.png','/images/logoslider_ppi_c.png','/images/logoslider_transamerica_c.png','/images/logoslider_benesure_c.png','/images/logoslider_unity_c.png','/images/logoslider_remark_c.png','/images/logoslider_waterhouse_c.png','/images/logoslider_ctfs_c.png','/images/logoslider_hsbc_c.png','/images/logoslider_cibc_c.png','/images/logoslider_pip_c.png','/images/logoslider_networth_c.png','/images/logoslider_iaig_c.png','/images/logoslider_fipi_c.png','/images/logoslider_botica_c.png','/images/logoslider_cumis_c.png','/images/logoslider_ctfservices_c.png','/images/logoslider_banco_c.png','/images/logoslider_driasi_c.png','/images/logoslider_aegon_c.png','/images/logoslider_info_c.png','/images/logoslider_cadaretgrant_c.png','/images/logoslider_harbour_c.png','/images/logoslider_hbw_c.png','/images/logoslider_weg_c.png','/images/logoslider_clg_c.png','/images/logoslider_dcpa_c.png','/images/logoslider_unitedmga_c.png','/images/logoslider_bcg_c.png')
})
