//Sets up sharing when using  the mouse over/out menu popup. See setup in Scientology for example.
function doShare(){
	return addthis_sendto();
};
//Function called when mousing over the button (shows little menu popup).
function doShareOver(url, title){
	var z = document.getElementById("addthis");
	return addthis_open(z, '', url, title);
};
//Function called when clicking the button (loads lightbox popup).
function doShareClick(url, title){
	var z = document.getElementById("addthis");
	return addthis_open(z, 'more', url, title)
};
//Function called when mousing off the button (closes the little menu popup).
function doShareOut(){
	addthis_close();
};
//Function called when wanting to map a button to ONE service. ie: twitter
function doShareService(url, title, service){


	url = encodeURIComponent(url);
	if(title){
		title = encodeURIComponent(title);
	}else{
		title = url;
	}
	var addThisUrl = "http://www.addthis.com/bookmark.php?v=250&winname=addthis&pub=officialCSI&source=men-250&lng=&s="+service+"&url="+url+"&title="+title;
	
	var agent = navigator.userAgent.toLowerCase();
	var is_safari = ((agent.indexOf('safari')!=-1));
	if(service == "email"){
		doShareClick(url, title);
	}else{
		if (is_safari) {
			window.location = addThisUrl;
		}else{
			window.open(addThisUrl, "_blank");
		}
	}	
}
//Function called when wanting email service ONLY in PopUp
function doEmail(url, title){
	var z = document.getElementById("addthis");
	return addthis_open(z, 'email', url, title)
};