﻿document.write("<style type='text/css'>#favoriteLinks {display:none}</style>");

showing=false;

function moveFavoriteLinks(){
    var A=document.getElementById("favoriteLinks");A.style.margin="0px"
}

function shareInit(){
    var C=3000;
    var B=document.getElementById("sharePlaceholder");
    B.onclick=function(){popUpLinks();if(showing){timeout=setTimeout(popUpLinks,C)}else{clearTimeout(timeout)}};
    var A=document.getElementById("share");A.onclick=function(){popUpLinks();if(showing){timeout=setTimeout(popUpLinks,C)}else{clearTimeout(timeout)}};
    
    var popupDiv=document.getElementById('favoriteLinks');popupDiv.onmouseover=function(){clearTimeout(timeout);};popupDiv.onmouseout=function(){timeout=setTimeout(popUpLinks,2000);};}

function popUpLinks(){
    if(showing){
        showing=false;
         var B=document.getElementById("divShareTab");
    B.className="shareTabOff";
    }
    else
    {
        showing=true;
         var B=document.getElementById("divShareTab");
    B.className="shareTabOn";
    }
    var A=document.getElementById("favoriteLinks");
    A.style.display=(A.style.display!="block"?"block":"none")
   
    }

function prepareEmail(){function B(){
    var G=location.href;
    var C=document.title;
    var E="Your friend wants you to check out "+C;
    var F="Read the entire article at "+G;
    var D="mailto:?subject="+E+"&body="+F;win=window.open(D,"emailWindow");
    if(win&&win.open&&!win.closed){win.close()}}
    if(document.getElementById){var A=document.getElementById("email_this_article");A.onclick=function(){B();return false}
    }
}


// bookmark

function favorite(){

if (window.sidebar) // firefox
	window.sidebar.addPanel( document.title, document.location.href, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',document.location.href);
	elem.setAttribute('title', document.title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 

else if(document.all)// ie
	window.external.AddFavorite(document.location.href, document.title);
}
