 var g_staionid = "";
 var g_genre = "";
 var g_flag = "";
 var winRef;
function $(id){return document.getElementById(id);}

	var readyStatus = 1;
	var httpRequester = newXMLHttpRequest();
	var artistName = '';
	function newXMLHttpRequest() {
		var xmlreq = false;
		if (window.XMLHttpRequest) {xmlreq = new XMLHttpRequest();} 
		else if (window.ActiveXObject) {try {xmlreq = new ActiveXObject("Msxml2.XMLHTTP");} catch (e1) {try {xmlreq = new ActiveXObject("Microsoft.XMLHTTP");} catch (e2){}}}
		return xmlreq;
	}
	
function popuptab1(isUK, internal){
	APIToBeCalled = 1;
	artistTabStatus = 1;
	++clickCount;
	$("popupartist").style.display='block';
	if($("popuprelsta"))$("popuprelsta").style.display='none';
	$("popuprecplsta").style.display='none';

	$("popuptab1").className='popuptabbright1';
	$("popuptab2").className='popuptabbright2 fontblackbold';
	$("popuptab3").className='popuptabbright3';

	if($("popuptab4"))$("popuptab4").className='popuptabnormal1';
	if($("popuptab5"))$("popuptab5").className='popuptabnormal2';
	if($("popuptab6"))$("popuptab6").className='popuptabnormal3';

	$("popuptab7").className='popuptabnormal1';
	$("popuptab8").className='popuptabnormal2';
	$("popuptab9").className='popuptabnormal3';
	if (isUK == 'false'){omnitureArtistInfo(internal);} else {fetchArtistInfo(artistName);}
	}

function popuptab2(){
	artistTabStatus = 0;
	APIToBeCalled = 0;
	++clickCount;
	if($("popuprelsta"))$("popuprelsta").style.display='block';
	$("popupartist").style.display='none';
	$("popuprecplsta").style.display='none';

	$("popuptab1").className='popuptabnormal1';
	$("popuptab2").className='popuptabnormal2';
	$("popuptab3").className='popuptabnormal3';

	if($("popuptab4"))$("popuptab4").className='popuptabbright1';
	if($("popuptab5"))$("popuptab5").className='popuptabbright2 fontblackbold';
	if($("popuptab6"))$("popuptab6").className='popuptabbright3';

	$("popuptab7").className='popuptabnormal1';
	$("popuptab8").className='popuptabnormal2';
	$("popuptab9").className='popuptabnormal3';

	}


function popuptab3(){
	APIToBeCalled = 0;
	artistTabStatus = 0;
	++clickCount;
	$("popuprecplsta").style.display='block';
	$("popupartist").style.display='none';
	if($("popuprelsta"))$("popuprelsta").style.display='none';

	$("popuptab1").className='popuptabnormal1';
	$("popuptab2").className='popuptabnormal2';
	$("popuptab3").className='popuptabnormal3';

	if($("popuptab4"))$("popuptab4").className='popuptabnormal1';
	if($("popuptab5"))$("popuptab5").className='popuptabnormal2 ';
	if($("popuptab6"))$("popuptab6").className='popuptabnormal3';

	$("popuptab7").className='popuptabbright1';
	$("popuptab8").className='popuptabbright2 fontblackbold';
	$("popuptab9").className='popuptabbright3';
	}


function playInWinamp(staId)
{
   this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
   return false;
}


function chkPopUpState(mylink, mywin, staId,genrename,contentFlag,contentType,genreList)
{
	if(winRef){
		winRef.location="/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag=0',mywin, 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes';
	}
	else
	   this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
}

function popup(mylink, mywin, staId,genrename,contentFlag,contentType,genreList,intcall, related,isEU3)
{
	g_staionid = staId;
    g_genre = genrename;
    g_flag = contentFlag;

	if (typeof(intcall) == 'undefined')
    {
    intcall = 'YES';   
    }
	
	if (related == undefined || related == null)
    {
		related = 'no';   
    }
    var getcookies = document.cookie;

        if (getcookies.indexOf("SHOUTCAST_PLAYER_CONF") != -1)
	    {
		pos1 = getcookies.indexOf("SHOUTCAST_PLAYER_CONF")+"SHOUTCAST_PLAYER_CONF".length+1;;
        pos2 = getcookies.indexOf(";",pos1);
        
		if (pos2 == -1)
			pos2=getcookies.length;
		
		playerSelected= document.cookie.substring(pos1,pos2);
	    }
		else
		{
			if( isEU3 == false) 
			{
				if (getcookies.indexOf("SHOUTCAST_PLAYER_CONF") == -1)
				{	
					if(checkCookieEnabled()){
					PopupAjax();
					}
					else{
					winRef = window.open("/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related, mywin, 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
					winRef.focus();
					return false;

					}
					return false;
				}
				else
				{
					winRef = window.open("/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related, mywin, 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
					winRef.focus();
					return false;
				}
			}
			else
			{
				winRef = window.open("/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related, mywin, 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
				winRef.focus();
				return false;
			}
		}

        if (playerSelected == 'shoutcast' || intcall == 'NO' || related == 'YES' || related == 'yes')
        {

			
			if (! window.focus)return false;
			var href;
			if (typeof(mylink) == 'string')
			   href=mylink;
			else
			   href=mylink.href;
			winRef = window.open("/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related, mywin, 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
			winRef.focus();
			return false;
		}
		else
		{
			this.location = "http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
			  return false;
		}  
}


function popupWin(mylink, mywin, staId,genrename,contentFlag,contentType,genreList,intcall, related,isEU3)
{
	g_staionid = staId;
    g_genre = genrename;
    g_flag = contentFlag;

	if (typeof(intcall) == 'undefined')
    {
    intcall = 'YES';   
    }
	
	if (related == undefined || related == null)
    {
		related = 'no';   
    }
    var getcookies = document.cookie;

        if (getcookies.indexOf("SHOUTCAST_PLAYER_CONF") != -1)
	    {
		pos1 = getcookies.indexOf("SHOUTCAST_PLAYER_CONF")+"SHOUTCAST_PLAYER_CONF".length+1;;
        pos2 = getcookies.indexOf(";",pos1);
        
		if (pos2 == -1)
			pos2=getcookies.length;
		
		playerSelected= document.cookie.substring(pos1,pos2);
	    }
		else
		{
			if( isEU3 == false) 
			{
				if (getcookies.indexOf("SHOUTCAST_PLAYER_CONF") == -1)
				{	
					if(checkCookieEnabled()){
					PopupAjax();
					}
					else{
					window.location = "/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related;
					winRef.focus();
					return false;

					}
					return false;
				}
				else
				{
					window.location = "/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related;
					winRef.focus();
					return false;
				}
			}
			else
			{
				window.location = "/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related;
				//winRef.focus();
				return false;
			}
		}

        if (playerSelected == 'shoutcast' || intcall == 'NO' || related == 'YES' || related == 'yes')
        {

			
			if (! window.focus)return false;
			var href;
			if (typeof(mylink) == 'string')
			   href=mylink;
			else
			   href=mylink.href;
			window.location = "/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal='+intcall+'&related='+related;
			winRef.focus();
			return false;
		}
		else
		{
			this.location = "http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
			  return false;
		}  
}

function playerSelect(staId,genrename,contentFlag,configOnly)
{
	if (!checkCookieEnabled() && configOnly=="yes")
    {
      alert('Cookies are disabled in your browser. Please enable cookies to save your settings.');
	  window.close();
	}
	else if (!checkCookieEnabled())
    {
      alert('Cookies are disabled in your browser. Please enable cookies to save your settings.');
	}

	var date = new Date();
	date.setTime(date.getTime()+(365*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();

	var playerChoice;
    for(i=0;i<document.form1.player.length;i++)
	{

 
		if (document.form1.player[i].checked)
		{
  	   		  playerChoice = document.form1.player[i].value;
		}
	}
    if (playerChoice == 'shoutcast')
	{
	  var sc='shoutcast';
	  document.cookie = "SHOUTCAST_PLAYER_CONF"+"="+sc+"; path=/"+expires;
	  if(configOnly == "yes"){
		    if(!checkCookieEnabled()){
				window.close();
				return false;
			}
			window.close();
			parent.window.opener.location.reload(true);		
			return false;
	  }
	
	  window.location = "/shoutcast_player"+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag;		   
	  winRef.focus();
	  return false;
	}
	else
	{
	  var oth='others';
	  document.cookie = "SHOUTCAST_PLAYER_CONF"+"="+oth+"; path=/"+expires;
	  if(configOnly == "yes"){
		  	if(!checkCookieEnabled()){
				window.close();
				return false;
			}
			window.close();
			parent.window.opener.location.reload(true);
			return false;
	  }
		if(!checkCookieEnabled()){
		setTimeout("callPopup()", 2000);
		this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
		return false;
		}
		window.opener.location.reload(true);
		setTimeout("callPopup()", 2000);
		this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+staId;
		return false;
	}
}

function playerSelectAjaxPopup()
{

	$("ajaxPopup").style.display='none';
	$("fadeAjaxPopup").style.display='none';

	var date = new Date();
	date.setTime(date.getTime()+(365*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();

	var playerChoice;
    for(i=0;i<document.form1.player.length;i++)
	{
		if (document.form1.player[i].checked)
			{
				  playerChoice = document.form1.player[i].value;
			}
	}
    if (playerChoice == 'shoutcast')
	{
	  var sc='shoutcast';
	  document.cookie = "SHOUTCAST_PLAYER_CONF"+"="+sc+"; path=/"+expires;
	  winRef =window.open("/shoutcast_player"+'?'+'stationid='+g_staionid+'&'+'Genre='+g_genre+'&'+'ContentFlag='+g_flag, 'mywindow', 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=100,location=yes');		   
	  winRef.focus();
	  return false;
	}
	else
	{
	  var oth='others';
	  document.cookie = "SHOUTCAST_PLAYER_CONF"+"="+oth+"; path=/"+expires;
	  this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+g_staionid;
	  setTimeout("reloadPage()",2000);
	}
}

function callPopup(){
	window.open("/shoutcast_player?fromParent=yes",'mywindow', 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=100,location=yes');
}
function callWin(){
	this.location="http://yp.shoutcast.com/sbin/tunein-station.pls?id="+g_staionid;
}

function openOtherPlayer() {
  window.open("http://yp.shoutcast.com/sbin/tunein-station.pls?id="+g_staionid, "parent", "");
  window.close();
}

function reloadPage() {
	location.reload();
}


function holdStationID(stationID)
{	
	var reply="NO";
	var date = new Date();
	date.setTime(date.getTime()+(365*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	var counterID = 0;
	var getcookies = document.cookie;
	var tempArray = new Array();
	tempArray = getcookies.split(';');

	for(ctrr=0;ctrr<tempArray.length;ctrr++)
	{
		if(tempArray[ctrr].indexOf(stationID) != -1)
	    {
		   retValue = forExistingStationIDs(stationID);  
		   if (retValue == false)
		   {
			   return false;
		   }
		   getcookies = document.cookie;
		   break;
		}
    }

	if (getcookies.indexOf("StCounterID") != -1)
	{
		pos1 = getcookies.indexOf("StCounterID")+"StCounterID".length+1;
        pos2 = getcookies.indexOf(";",pos1);
		if (pos2 == -1)
		{
			pos2 = document.cookie.length;
		}

		counterID= document.cookie.substring(pos1,pos2);
		++counterID;
		if (counterID > 9)
		{
			counterID = 0;
			reply="YES";
            document.cookie = "ArrayShift"+"="+reply+"; path=/"+expires;
		}
		document.cookie = "StCounterID"+"="+counterID+"; path=/"+expires;
	}
	else
	{
		  var first=0;
		  document.cookie = "StCounterID"+"="+first+"; path=/"+expires;
	}

	var stCookieID = "StationID"+counterID;
	document.cookie = stCookieID+"="+stationID+"; path=/"+expires;
}



function targetopener(mylink)
{
 if (! (window.focus && window.opener))return false;
 window.opener.focus();
 window.opener.location.href=mylink.href;
 return false;
}



function openConfig()
{
	var refWindow = window.open("/configure_shoutcast_player?config=yes",'mywindow','width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
	refWindow.focus();

}


function passCookieDetails(intcall, related, isUK)
{
    var isArrayShift="NO";
    var ck = document.cookie;
	var a1 = ck.split(";");
	var b;
	var posi;
	var stID;
	var stcat='';
	var counterID=0;
	var tempStIdArray = new Array();
		if (related == undefined || related == null)
		{
			related = 'no';   
		}
	   for(j=0,qq=1;j<a1.length;j++,qq++)
	   { 	
		    if ( a1[j].indexOf("StationID") != -1 )
		    {
				stlen = a1[j].length;
				pos = a1[j].indexOf("StationID");
				posx = a1[j].substring(pos+"StationID".length,pos+"StationID".length+1);
				stID = a1[j].substring(pos+"StationID".length+2,stlen)+',';
				tempStIdArray[posx] = stID;
		    }
		}
		for(var n=0; n<tempStIdArray.length;n++){
			if(tempStIdArray[n] != undefined){
				stcat = stcat + tempStIdArray[n];
			}
		}
		var isArrayShift='NO';
        if ( ck.indexOf("ArrayShift") != -1 )
	       {
            isArrayShift="YES";
			pos1 = ck.indexOf("StCounterID")+"StCounterID".length+1;;
            pos2 = ck.indexOf(";",pos1);
			if (pos2 == -1)
			{
				pos2 = document.cookie.length;
			}
		    counterID= document.cookie.substring(pos1,pos2);
		   }
		else
            isArrayShift="NO";
        stcat = stcat.substring(0,stcat.length-1);
		var urlString;
		urlString = "/popupplayer/recentlyPlayedStations.jsp?StationID="+stcat+"&ArrayShift="+isArrayShift+"&StCounterID="+counterID+"&isCallInternal="+intcall+"&related="+related;
		if(readyStatus == 1){
			if (httpRequester) {
				readyStatus = 0;
				httpRequester.open("POST", urlString, true);
				httpRequester.onreadystatechange = function(){
					if(httpRequester.readyState==4){
						
								
							if(isUK == 'false'){
								var url=document.location.href;
								pageName="SHOUTcast Radio | Recently Played";
								prop12=url;
								prop1="Recently Played";
								s_265.pfxID="sht";
								s_265.pageName = s_265.pfxID + " : " +pageName;
								s_265.channel="us.shoutcast2.0";
								s_265.linkInternalFilters="javascript:,shoutcast.com";
								s_265.prop1="sht : SHOUTcast Player";
								s_265.prop2="sht : SHOUTcast Player "+prop1;
								s_265.prop12=prop12; 
								s_265.mmxgo=true;
									var s_code=s_265.t();
							}
								if (checkCookieEnabled()){
									$('popuprecplsta').innerHTML=httpRequester.responseText;	
									}
								else
									$('popuprecplsta').innerHTML="<div class='popuploading'>Cookies are disabled in your browser. Please enable cookies to store & display your \"Recently Played Stations\" list.</div>"
							
						        
						readyStatus = 1;
					}
				}
				httpRequester.send(null);
			}
		
	}
}

    var clickCount = 0;
	var APIToBeCalled = 0;
	var firstTime = 1;
	var artist_name= "";
	var artistTabStatus = 0;
	var artistFirstTime = 0;
	function artist_update(name)
	{
		artistName = name;
		if (artistFirstTime == 1 && artistTabStatus == 1 && checkArtistChange(name))
		{
			fetchArtistInfo(name);
		}
	}

	function checkArtistChange(name){
		if(artist_name == name){
			return false;
		} else {
			artist_name = name;
			return true;
		}
	}

    function fetchArtistInfo(name)
    { 
	var urlString;
	urlString = "/popupplayer/artistInfo.jsp?ArtistName="+name+"&comscore=1";
	if(readyStatus == 1){
			if (httpRequester) {
				
				readyStatus = 0;
				httpRequester.open("POST", urlString, true);
				httpRequester.onreadystatechange = function(){
					if(httpRequester.readyState==4){
						$('popupartist').innerHTML=httpRequester.responseText;
						updateArtistName(name);
						readyStatus = 1;
						artistFirstTime = 1;
					}
				}
				httpRequester.send(null);
			}
		}
	}

	function updateArtistName(strArtist){
		var trunkArtistName = "";
		if(strArtist.length > 15){
			trunkArtistName = strArtist.substr(0,15);
		} else {
			trunkArtistName = strArtist;
		}
		var tempHtml = "<a id='popup_artist_anchor' class='fontwhite' href='/directory/search_results.jsp?searchCrit=simple&s="+strArtist+"' target='parent'>"+trunkArtistName+"</a>";
		var artistSearch = $("popup_artist_search");
		artistSearch.innerHTML = tempHtml;
		return;
	}

	function forExistingStationIDs(stationID)
	{
		var date = new Date();
		date.setTime(date.getTime()+(365*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	    var cks = document.cookie;
	    var tArray = new Array();
		var tctr = -1;
		tArray  = cks.split(';');
		var found = 0;
		for(ctrr=0;ctrr<tArray.length;ctrr++)
		{
	   	   if (tArray[ctrr].indexOf("StationID") != -1)
		   { 
			   ++found;
			   pos   = tArray[ctrr].indexOf("StationID");
	           posx  = tArray[ctrr].indexOf("=");
	           cntID = tArray[ctrr].substring(pos+"StationID".length,posx);
		   }
		}

	    if (found==1 && cntID==0)
	         return false; 

		for(ctrr=0;ctrr<tArray.length;ctrr++)
		{
	   	   if (tArray[ctrr].indexOf("StationID") != -1)
		   {
	           pos   = tArray[ctrr].indexOf("StationID");
	           posx  = tArray[ctrr].indexOf("=");
	           cntID = tArray[ctrr].substring(pos+"StationID".length,posx);

	           pos  = tArray[ctrr].indexOf("StationID");
			   posx = tArray[ctrr].substring(pos+"StationID".length,pos+"StationID".length+1);
			   stID = tArray[ctrr].substring(pos+"StationID".length+2,tArray[ctrr].length);

			   if (tArray[ctrr].indexOf(stationID) == -1)
		       {
				   ++tctr;			
	               document.cookie = "StationID"+tctr+"="+stID+"; path=/"+expires;
				   document.cookie = "StCounterID"+"="+tctr+"; path=/"+expires;
			   }

		   }
	    }
		return true;
	}
	
	
	function passCookieDetailsRSS(intcall)
	{
	    var isArrayShift="NO";
	    var ck = document.cookie;
		var a1 = ck.split(";");
		var b;
		var posi;
		var stID;
		var stcat='';
		var counterID=0;
		var tempStIdArray = new Array();
		   for(j=0,qq=1;j<a1.length;j++,qq++)
		   { 	
			    if ( a1[j].indexOf("StationID") != -1 )
			    {
					stlen = a1[j].length;
					pos = a1[j].indexOf("StationID");
					posx = a1[j].substring(pos+"StationID".length,pos+"StationID".length+1);
					stID = a1[j].substring(pos+"StationID".length+2,stlen)+',';
					tempStIdArray[posx] = stID;
			    }
			}
			for(var n=0; n<tempStIdArray.length;n++){
				if(tempStIdArray[n] != undefined){
					stcat = stcat + tempStIdArray[n];
				}
			}
			var isArrayShift='NO';
	        if ( ck.indexOf("ArrayShift") != -1 )
		       {
	            isArrayShift="YES";
				pos1 = ck.indexOf("StCounterID")+"StCounterID".length+1;;
	            pos2 = ck.indexOf(";",pos1);
				if (pos2 == -1)
				{
					pos2 = document.cookie.length;
				}
			    counterID= document.cookie.substring(pos1,pos2);
			   }
			else
	            isArrayShift="NO";

	        stcat = stcat.substring(0,stcat.length-1);
			var urlString;
			urlString = "/popupplayer/recentlyPlayedStationsRSS.jsp?StationID="+stcat+"&ArrayShift="+isArrayShift+"&StCounterID="+counterID+"&isCallInternal="+intcall;
			if(readyStatus == 1){
				if (httpRequester) {
					readyStatus = 0;
					httpRequester.open("POST", urlString, true);
					httpRequester.onreadystatechange = function(){
						if(httpRequester.readyState==4){
							var url=document.location.href;
									pageName="SHOUTcast Radio | Recently Played";
									prop12=url;
									prop1="Recently Played";
									s_265.pfxID="sht";
									s_265.pageName = s_265.pfxID + " : " +pageName;
									s_265.channel="us.shoutcast2.0";
									s_265.linkInternalFilters="javascript:,shoutcast.com";
									s_265.prop1="sht : SHOUTcast Player";
									s_265.prop2="sht : SHOUTcast Player "+prop1;
									s_265.prop12=prop12; 
									s_265.mmxgo=true;
									var s_code=s_265.t();
									if (checkCookieEnabled()){
										$('popuprecplsta').innerHTML=httpRequester.responseText;	
										}
									else
										$('popuprecplsta').innerHTML="<div class='popuploading'>Cookies are disabled in your browser. Please enable cookies to store & display your \"Recently Played Stations\" list.</div>"
								
							        
							readyStatus = 1;
						}
					}
					httpRequester.send(null);
				}
			}
	}


	function popupRSS(mylink, mywin, staId,genrename,contentFlag,contentType,genreList,intcall)
	{
		holdStationID(staId);
		var request_host = window.location.host;
		var urloc = "http://"+request_host+"/popupplayer/popupPlayerRSS.jsp";
		winRef = window.open(urloc+'?'+'stationid='+staId+'&'+'Genre='+genrename+'&'+'ContentFlag='+contentFlag+'&'+'isCallInternal=NO', "_self", 'width=860,height=658,scrollbars=yes,resizable=no,status=0,left=150,top=20,location=yes');
		winRef.focus();	  
	}
function checkCookieEnabled(){var cookieEnabled= "false";if (typeof window.navigator.cookieEnabled == "undefined") {document.cookie = "testcookie=val";cookieEnabled = (document.cookie.indexOf("testcookie=") != -1);} else {cookieEnabled = window.navigator.cookieEnabled;}return cookieEnabled;}
function more(id){
	$(id+'more').style.display="none";$(id).style.display="block";
}

function shrink(id){
	$(id+'more').style.display="block";$(id).style.display="none";
}

function moreP(id){
	$(id+'more').style.display="none";$(id).style.display="block";
}

function shrinkP(id){
	$(id+'more').style.display="block";$(id).style.display="none";
}

function moreRecent(id){$(id+'more').style.display="none";$(id).style.display="block";
}
function shrinkRecent(id){$(id+'more').style.display="block";$(id).style.display="none";}
function getTitle(website){var title = "Share "+tit+" on "+website;$(website).title = title;}
function getTitleBookmark(website){var title = "Bookmark "+tit+" on "+website;$(website).title = title;}

function shareTo(website) {u=location.href;t=document.title;
if(website=='FaceBook'){window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t));}
else if(website=='Twitter'){
window.open('http://twitter.com/home/?status='+encodeURIComponent(t)+' - '+encodeURIComponent(u));}
else if(website=='MySpace'){
window.open('http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t));}
else if(website=='Stumbleupon'){
window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t));}
else if(website=='Delicious'){
window.open('http://del.icio.us/post?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t));}
else if(website=='Digg'){
window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(title));}
else if(website=='Reddit'){
window.open('http://reddit.com/submit?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t));}
return false;}
function getHref(){var url = document.location.href;var body = tit+"%0D"+escape(url);var title = "mailto:?subject="+tit+"&body="+body;$('emailThis').href = title;}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i in objAttrs)
str+=i+'="'+objAttrs[i]+'" ';for(var i in params)
str+='><param name="'+i+'" value="'+params[i]+'" /> ';str+='></object>';}else{str+='<embed ';for(var i in embedAttrs)
str+=i+'="'+embedAttrs[i]+'" ';str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":ret.objAttrs[args[i]]=args[i+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}
