//videofunctions
//
var popdefs = ",toolbar=no,directories=no,location=no,status=no,scrollbars=no,resize=no,menubar=no";


var x86 = (navigator.cpuClass == "PPC") ? 0 : 1;
var ie4up = (document.all) ? 1 : 0;
var nn6moz = (navigator.userAgent.indexOf("ozilla/5.") > 0) ? 1 : 0;

function defaultWindow(page,vnumber,vidspeed,video,genre)
{
    window.open(
		"http://www.alinkar.com/"+page+"_"+vnumber+"/http://www.alinkar.com/vcd/sort.asp?~~"+video+"~~"+genre,
		"popup","height=115,width=230" + popdefs);
}


function openTvPlayer(redir, szQs)
{
var szUrl = new String("http://www.alinkar.com/vcd/default.asp");
if (szQs != "")
{
  szUrl += szQs;

}
if (redir != "")
{
 redir = "http://www.alinkar.com/r/lm_" + redir + "/"; 
 szUrl = redir + szUrl;
}
window.open(szUrl, "entplayer","height=600,width=800,toolbar=0,directories=0, location=0,status=0,scrollbars=1,resize=1,menubar=0,copyhistory=1"); 
}

var fadIMG = new Array;
var fadTitle = new Array;
var fadArtist= new Array;
var fadLink = new Array;

var imgPreload = new Image();
var bPreload = true;
var nMaxVis = 2;
var nID = (isIE4() && x86) ? setInterval("fadeTick()", 5000) : 0;
var nCount = 2;
var nToggleVis = 0;
function fadeTick()
{
	if(!fadIMG.length) // if we're not using fade, stop this madness.
	{
		clearInterval(nID);
		return 0;
	}

	var b,c,d,e, nX;
	//for(nX = 0; nX != nMaxVis; nX++)
	nX = nToggleVis;
	nToggleVis++;
	if(nToggleVis == nMaxVis) nToggleVis = 0;
	
	{
		if(bPreload) // we want to preload the _NEXT_ image...
		{
			if(nCount+1 == fadIMG.length)
				bPreload = false;
			else
				imgPreload.src = fadIMG[nCount+1];
		}

		nCount++;
		if(nCount == fadIMG.length) nCount = 0;

		b = document.all["VI"+nX];
		if(b)
		{
			b.style.filter="blendTrans(duration=2)";
			b.filters.blendTrans.Apply();
			b.src = fadIMG[nCount];
			b.filters.blendTrans.Play();
		}
		
		c = document.all["VA"+nX];
		if(c)
			c.innerHTML = fadArtist[nCount];
		
		d = document.all["VT"+nX];
		if(d)
			d.innerHTML = fadTitle[nCount];
		
		e = document.all["VL"+nX];
		if(e)
			e.onclick = new Function(fadLink[nCount]);
	}
	return true;
}

function gorhapsody(redir)
{
// left = rhap_navmod
// lnav = rhap_navlink
// new  = rhap_musc_scase

	
	var szUrl = "http://" +  location.host  + "/rhapsody/default.asp";
	
	if (redir != "")
	{
	 redir = "http://www.alinkar.com/vcd/" + redir + "/";  
	}
	else
	{
	 redir = "http://www.alinkar.com/"; 
	}
	szUrl = redir + szUrl; 
	location.href= szUrl;
}

//pop function for special features -- backward compatibile with old player.
function pop_sf(content, artist, type, adtag)
{
		var hostName = self.location.hostname;
		var port = self.location.port;
		if (port != "")
		{
		hostName += ":" + port;
		}

		var szLink = "http://www.alinkar.com" + content + "/http://" + hostName + "/features/include/frameset.asp?a=" + artist + "&t=" + type + "&c=" + content;
			
		if(adtag != "") szLink += "&adtag=" + adtag;

		window.open(szLink, "player", "height=455,width=485" + popdefs);
		return false;
}


function makeradiocentralwindow(station) 
{
	thewindow = window.open("/VCD/sort.asp?st=" + station + "", "VCD", "toolbar=no,menubar=no,width=475,height=300,resizable=no,scrollbars=yes");
	//window.location = "/radio/";
}

//help functions
function isIE4()
{
	return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') );
}

function launchHelp(helpurl)
{
	HelpWin = window.open(helpurl,'HelpWindow','toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500');

	if( ! isIE4() ) {
		if (HelpWin.focus) {
			  HelpWin.focus();
			}
		}

	if (HelpWin.focus!=null  &&  navigator.userAgent.indexOf('MSIE4')<0) 
	{
	HelpWin.focus();
	}

	if (HelpWin.opener == null) HelpWin.opener = window;
	HelpWin.opener.name = "LycosMain";
}

function pu(xref)
{
	var j;
	var x="dpu" + Math.round(Math.random()*23323);
	j = xref.href;
	j = j.substr(j.indexOf("?"));
	j = j.replace(" ", "%20");
	xref.href= "/postdownload.asp" + j;
	location.href= "/postdownload.asp" + j;

	if(navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5)
	{
		window.open("/downloads/checkfile.asp" + j , x, "width=400,height=450,resizable=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resize=no,menubar=no");
	}
	else
	{
		window.open("/downloads/ifcheckfile.html" + j , x, "width=420,height=450,resizable=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resize=no,menubar=no");
	}
	return false;
}
	var ourMsg = (x86) ? "Right mouse click " : "Ctrl + Mouse click ";
	var ourMsg2 = ourMsg;
	var ourMsg3 = (!ie4up) ? "Save target as..." : "Save link as...";
	
	ourMsg+= " and select Save ";
	ourMsg+= (!ie4up) ? "link " : "target ";
	ourMsg+= "as... to download the file.";

