﻿function bookmarkPage(){
    url = location.href;
    title = document.title;
    
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url,"");
    } else if( window.external ) { // IE Favorite
        window.external.AddFavorite( url, title); }
    else if(window.opera && window.print) { // Opera Hotlist
        alert("Press CTRL-T (Opera) to bookmark");
    }
}

function shareUrl(type)
{
    u=location.href;
    t=document.title;
    
    switch (type)
    {
        case 'f':
            window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,scrollbars=yes,width=626,height=436');
            break;
        case 'd':
            window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=0,status=0,scrollbars=yes,width=700,height=300');
            break;
        case 's':
            window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=0,status=0,scrollbars=yes,width=750,height=500');
            break;
        case 'r':
            window.open('http://reddit.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=0,status=0,scrollbars=yes,width=750,height=500');
            break;
        case 'i':
            window.open('http://digg.com/remote-submit?phase=2&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=0,status=0,scrollbars=yes,width=750,height=500');
            break;
        default:
            break;
    }
    return false;
}