function linkto(tag){
	var thePage = location.href;
	var theTitle = document.title;
	var theTagURL = '';
	
	switch(tag){
		case "favorites":
			window.external.AddFavorite(thePage,theTitle);
			break;
		case "digg":
			theTagURL = "http://digg.com/submit?phase=2&url=" + thePage + "&title=" + theTitle;
			break;
		case "delicious":
			theTagURL = "http://del.icio.us/post?v=4;url=" + thePage + ";title=" + theTitle;
			break;
		case "technorati":
			theTagURL = "http://www.technorati.com/search/" + thePage;
			break;
		case "slashdot":
			theTagURL = "http://slashdot.org/bookmark.pl?title=" + theTitle + "&url=" + thePage;
			break;
		case "reddit":
			theTagURL = "http://reddit.com/submit?url=" + thePage + "&title=" + theTitle;
			break;
	}
	if(theTagURL != '')
		window.open(theTagURL,'tagThis','scrollbars=yes,menubar=no,width=620,height=400,resizable=yes,toolbar=no,location=no,status=no');
}

function showHideChat()
{
    btnLiveChat = document.getElementById("LiveChat");
    if(btnLiveChat.width > 1)
    {
    	// make sure we're on the US site
    	if(location.href.indexOf("/us/") != -1)
    	{
	        if (document.getElementById)
	        {
	            document.getElementById('liveChatDiv').style.display = 'block';
	        }
	        else
	        {
	            if (document.layers)
	            {
	                document.liveChatDiv.visibility = 'visible';
	            }
	            else
	            {
	                document.all.liveChatDiv.style.visibility = 'visible';
	            }
	        }
	}
    }
    else
    {
        if (document.getElementById)
        {
            document.getElementById('liveChatDiv').style.display = 'none';
        }
        else
        {
            if (document.layers)
            {
                document.liveChatDiv.visibility = 'hidden';
            }
            else
            {
                document.all.liveChatDiv.style.visibility = 'hidden';
            }
        }
    }
}

// for spotlight items with refsource
function addRefSourceToLink(url,targetDiv,linkText,omnitureCall,newWindow)
{
var param_REF_SOURCE = "";
var urlString = new String(document.location);
urlString = urlString.toLowerCase();
if ((urlString.indexOf("ref_source") != -1) || (urlString.indexOf("media") != -1)) {	
	if (getURLParams('REF_SOURCE') != "")
		param_REF_SOURCE = getURLParams('REF_SOURCE');
	if (getURLParams('ref_source') != "")
		param_REF_SOURCE = getURLParams('ref_source');
	if (getURLParams('Media') != "")
		param_REF_SOURCE = getURLParams('Media');
}
else {
	if (cookieVal("URLTrackCounter") != 0) {
		if (cookieVal("URLTrackCounter") == "REF_SOURCE")
			param_REF_SOURCE = cookieVal("RefSourceURLTrack");
		if (cookieVal("URLTrackCounter") == "Media")
			param_REF_SOURCE = cookieVal("MediaURLTrack");
	}
}
var finalURL= "ref_source=" + param_REF_SOURCE;
if(param_REF_SOURCE != "" && param_REF_SOURCE != undefined && param_REF_SOURCE != 0)
	(url !="" && url != undefined) ? finalURL= url+finalURL : finalURL = finalURL;
else
	finalURL = url;

var linkObj = "";
if(omnitureCall != "" && omnitureCall != undefined)
	var omnitureCall =" onClick='javascript:" + omnitureCall + "';";
else
	var omnitureCall = "";

if(newWindow)
	var theTarget = " target='_blank' ";
else
	var theTarget = "";

if(linkText !="" && linkText != undefined)
	linkObj = "<a " + theTarget + " href =" + finalURL + omnitureCall + ">" + linkText + "</a>";

if(targetDiv != "" && targetDiv != "undefined") {
	var myHTMLText = document.getElementById(targetDiv).innerHTML;
	document.getElementById(targetDiv).innerHTML = linkObj + myHTMLText;
}
else {
	return  "ref_source=" + param_REF_SOURCE;
	}
}
//code ends here
