function Ir(canal) {
parent.top.location = 'http://www.magallon.c' + canal;
	} 
	
function openw(foto,ancho,alto)
	{ window.open(foto,"envio_solucion","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0,resizable=no,copyhistory=no,width="+ancho+",height="+alto)
}	
	

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
   
var ua = navigator.userAgent.toLowerCase();
function detect(text) {
   stringposition = ua.indexOf(text) + 1;
   data = text;
   return stringposition;
}

if (detect('opera')) {
	 
 } else if (detect('firefox')){
	 
} else if (detect('msie')){
	 window.attachEvent("onload", correctPNG);	
}	
   
function comprobarReserva(){
	if(document.getElementById('Nombre').value==''){
		alert('El campo Nombre no puede estar vacio.');
		document.getElementById('Nombre').focus();
		return false;
	}	
	
	if(document.getElementById('Telefono').value==''){
		alert('El campo Telefono no puede estar vacio.');
		document.getElementById('Telefono').focus();										
		return false;
	}
	
	if(document.getElementById('EMail').value==''){
		alert('El campo E-mail no puede estar vacio.');
		document.getElementById('EMail').focus();										
		return false;
	}
	
	if(document.getElementById('dia').value==''){
		alert('El campo Dia no puede estar vacio.');
		document.getElementById('dia').focus();
		return false;
	}	
	if(document.getElementById('hora').value==''){
		alert('El campo Hora no puede estar vacio.');
		document.getElementById('hora').focus();
		return false;
	}	
	if(document.getElementById('Comensales').value==''){
		alert('El campo Comensales no puede estar vacio.');
		document.getElementById('Comensales').focus();
		return false;
	}																	
	return true;
}

function comprobarContacto(){
	if(document.getElementById('Nombre').value==''){
		alert('El campo Nombre no puede estar vacio.');
		document.getElementById('Nombre').focus();
		return false;
	}	
	
	if(document.getElementById('EMail').value==''){
		alert('El campo E-mail no puede estar vacio.');
		document.getElementById('EMail').focus();										
		return false;
	}
	
	if(document.getElementById('Asunto').value==''){
		alert('El campo Asunto no puede estar vacio.');
		document.getElementById('Asunto').focus();
		return false;
	}	
	return true;
}


function newPopupWindow(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
}



