// JavaScript Document
var intervalid;
var ligaTV = "";
var ligaRadio = "";

/*
function rack1Func(){
	agregaRack('rack1', 384);
}
*/
function rack2Func(){
	agregaRack('rack2', 245);
	
}
function rack4Func(){
	agregaRack('rack4', 278);
}

function rack6Func(){
	agregaRack('rack6', 250);
}

function rack8Func(){
	agregaRack('rack8', 360);
}

function rack10Func(){
	agregaRack('rack10', 284);
}

function agregaRack(nombrerack, height){
	if(intervalid==undefined){
		var divheight = document.getElementById(nombrerack).style.height;
		if(divheight!="") {
			divheight = parseInt(divheight.substring(0, divheight.indexOf("px")));
		} else {
			divheight = 10;
			document.getElementById(nombrerack).style.height = divheight;
		}
	
	
		if(divheight>=height) {
			document.getElementById(nombrerack+"_content").style.display = "none";
			disminuyeRack(nombrerack);
			//intervalid = setInterval("disminuyeRack('"+nombrerack+"')", 10)
		}
		else //intervalid = setInterval("aumentaRack('"+nombrerack+"', "+height+")", 10)
			aumentaRack(nombrerack, height);
	}
}
function aumentaRack(nombrerack, height){
	document.getElementById(nombrerack).style.height = height;
	document.location.href="#"+nombrerack;
	document.getElementById(nombrerack+"_content").style.display = "inline";
	document.title="+Mas Nescafé Music Experience";
}

function disminuyeRack(nombrerack, height){
	document.getElementById(nombrerack).style.height = 1;
	document.title="+Mas Nescafé Music Experience";
}
/*
function agregaRack(nombrerack, height){
	if(intervalid==undefined){
		var divheight = document.getElementById(nombrerack).style.height;
		if(divheight!="") {
			divheight = parseInt(divheight.substring(0, divheight.indexOf("px")));
		} else {
			divheight = 10;
			document.getElementById(nombrerack).style.height = divheight;
		}
	
	
		if(divheight>=height) {
			document.getElementById(nombrerack+"_content").style.display = "none";
			intervalid = setInterval("disminuyeRack('"+nombrerack+"')", 10)
		}
		else intervalid = setInterval("aumentaRack('"+nombrerack+"', "+height+")", 10)
	}
}
function aumentaRack(nombrerack, height){
	var divheight = document.getElementById(nombrerack).style.height;
	
	divheight = parseInt(divheight.substring(0, divheight.indexOf("px")));
	divheight += 10;
	
	
	document.getElementById(nombrerack).style.height = divheight;
	if(divheight>=height) {
		clearInterval(intervalid);
		intervalid=undefined;
		document.getElementById(nombrerack+"_content").style.display = "inline";
		document.location.href="#"+nombrerack;
		document.title="+Mas Nescafé Music Experience";
	}
}

function disminuyeRack(nombrerack, height){
	var divheight = document.getElementById(nombrerack).style.height;
	
	divheight = parseInt(divheight.substring(0, divheight.indexOf("px")));
	divheight -= 10;
	
	document.getElementById(nombrerack).style.height = divheight;
	if(divheight<=10) {
		clearInterval(intervalid);
		intervalid=undefined;
		document.title="+Mas Nescafé Music Experience";
	}
}
*/

function canalTV(liga){
	ligaTV = liga;
	//alert(ligaTV);
	embedstr = '<OBJECT ID="MediaPlayer" WIDTH="300" HEIGHT="232" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ';
	embedstr += 'STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">';
	embedstr += '<PARAM NAME="FileName" VALUE="' + liga + '">';
	embedstr += '<PARAM name="ShowControls" VALUE="false">';
	embedstr += '<param name="ShowStatusBar" value="true">';
	embedstr += '<PARAM name="ShowDisplay" VALUE="false">';
	embedstr += '<PARAM name="autostart" VALUE="true">';
	embedstr += '<EMBED TYPE="application/x-mplayer2" SRC="' + liga + '" NAME="MediaPlayer" ';
	embedstr += 'WIDTH="300" HEIGHT="232" ShowControls="0" ShowStatusBar="1" ShowDisplay="0" autostart="1"> </EMBED>';
	embedstr += '</OBJECT>';
	
	if(liga!="" && liga!="undefined" && liga!=null) document.getElementById("tv").innerHTML = embedstr
}

function canalRadio(liga){
	ligaRadio = liga;
	embedstr = '<OBJECT ID="MediaPlayer" WIDTH="300" HEIGHT="115" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ';
    embedstr += 'STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">';
    embedstr += '<PARAM NAME="FileName" VALUE="' + liga +'">';
	embedstr += '<PARAM name="ShowControls" VALUE="false">';
	embedstr += '<param name="ShowStatusBar" value="true">';
	embedstr += '<PARAM name="ShowDisplay" VALUE="false">';
	embedstr += '<PARAM name="autostart" VALUE="false">';
	embedstr += '<EMBED TYPE="application/x-mplayer2" SRC="' + liga +'" NAME="MediaPlayer" ';
	embedstr += 'WIDTH="300" HEIGHT="115" ShowControls="0" ShowStatusBar="1" ShowDisplay="0" autostart="0"></EMBED>';
	embedstr += '</OBJECT>';
	
	if(liga!="" && liga!="undefined" && liga!=null) document.getElementById("radio").innerHTML = embedstr
}

function grandeTV(){
	//alert(ligaTV);
	//document.location.href=ligaTV;
	if(ligaTV!="" && ligaTV!="undefined") window.open(ligaTV, "tvhtml", "width=10, height=10");
	//window.open(ligaTV, "_self");
}

function registro(){
	registro = window.open("registro_mex.asp", "registro", "width=700, height=500, scrollbars=1");
}

function encuesta(){
	encuesta = window.open("encuesta.asp", "encuesta", "width=700, height=220, scrollbars=1");
}

function galeria(url){
	galeria = window.open(url, "galeria", "width=700, height=500, scrollbars=0");
}

function legales(){
	legales = window.open("html/legales.html", "legales", "width=720, height=500, scrollbars=1");
}

function recordarPass(){
	recordarPass = window.open("recordarpass.asp", "recordarPass", "width=650, height=170, scrollbars=1");
}

function eventos(){
	evento = window.open("eventos.asp", "eventos", "width=720, height=500, scrollbars=1");
}

