﻿// JScript File

function share_click(site) {
    var u = '';
    var t = '';
    var siteURL = '';
    
    u=location.href;
    t=document.title;
	
    switch(site.toLowerCase()){
        case 'facebook':
            siteURL = 'http://www.facebook.com/sharer.php?u=' + u + '&t=' + t;
            break;
        case 'stumbleupon':
            siteURL = 'http://www.stumbleupon.com/submit?url=' + u + '&title=' + t;
            break;
        case 'digg':
            siteURL = 'http://digg.com/remote-submit?phase=2&url=' + u + '&title=' + t;
            break;
        case 'delicious':
            siteURL = 'http://del.icio.us/post?v=4&noui&jump=close&url=' + encodeURIComponent(u) + '&title=' + encodeURIComponent(t);
            break;	                
        case 'reddit':
            siteURL = 'http://reddit.com/submit?url=' + u + '&title=' + t;
            break;
        default:
            break;
    };

    window.open(siteURL,'Sharer','toolbar=0,status=0,width=700,height=436', false);
    return false;
}

function option_click(option, u, id) {
    var u = '';
    var siteURL = '';
    
    //u=location.href;
	
    switch(option.toLowerCase()){
        case 'print':
            siteURL = '../Articles/Print.aspx?u=' + encodeURIComponent(u) + '&id=' + id;
            break;
        case 'download':
            siteURL = '../Articles/Download.aspx?u=' + encodeURIComponent(u) + '&id=' + id;
            break;
        case 'email':
            siteURL = '../Articles/Email.aspx?u=' + encodeURIComponent(u) + '&id=' + id;
            break;
        default:
            break;
    };
    
    window.open(siteURL,'Article','toolbar=0,status=0,width=700,height=400,scrollbars=1,resizable=1', false);

    return false;
}