

// JavaScript Document
//Javascript de menus flotantes izuierda
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 openw(foto,ancho,alto)
{
	var centroy=((screen.availHeight - alto)/2);
	var centrox=((screen.availWidth - ancho)/2);
	window.open(foto,"Fotos","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+ancho+",height="+alto+",title=no,titlebar=no,left="+centrox+",top="+centroy)
}

function openwindow(imagen){
	window.open('http://www.sangenisivaque.com.com/popup.php?imagen='+imagen,'Imagen','resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=468,height=300,top=50,left=50');
}

function Ir(canal) {
parent.top.location = 'http://www.sangenisivaque.com/'+canal;
// parent.top.location = 'http://www.sangenisivaque.com/'+canal
	} 

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;
			}
		 if (img.hspace != null)
		 	{
				imgStyle = "margin-left:"+img.hspace+"px; margin-right:"+img.hspace+"px;"+ imgStyle;
			}
		 if (img.vspace != null) 
		 	{
				imgStyle = "margin-top:"+img.vspace+"px; margin-bottom:"+img.vspace+"px;"+ imgStyle;
		 	}
		 if (img.parentElement.href) 
		 	{
				imgStyle = "cursor:hand;" + 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='sSize');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
var ua = navigator.userAgent.toLowerCase();
var MenuDesplegado="Ninguno";
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 MenuOver(id) {
	 	document.getElementById(id).className='menuOver';
	 
}

function MenuOff(id) {
	 
	document.getElementById(id).className='menu';	
	 
}


/*function MenuOn(id) {
		document.getElementById(id).className='menuOn';	
}

function MenuOff(id2) {
	if (MenuDesplegado==id2){

	}else{
			document.getElementById(id2).className='menu';	
	}
}

function MenuOff2(id2) {
				document.getElementById(id2).className='menu';	
}
function MenuOver(id2) {
	if (MenuDesplegado==id2){

	}else{	
				document.getElementById(id2).className='menuOver';	
	}
}

function MenuDesplegable(id) {
	Objeto='SubMenu'+id;
	ObjetoAnterior='SubMenu'+MenuDesplegado;
//	alert (ObjetoAnterior+' /  '+Objeto)
	if (MenuDesplegado=="Ninguno") {
		MenuOn(id);
		document.getElementById(Objeto).style.visibility="visible";
		MenuDesplegado=id;
	}else{
		if (MenuDesplegado==id) {
			document.getElementById(Objeto).style.visibility="hidden";
			MenuDesplegado="Ninguno";
		}else{
			MenuOff(MenuDesplegado);
			MenuOn(id);
			document.getElementById(Objeto).style.visibility="visible";
			document.getElementById(ObjetoAnterior).style.visibility="hidden";
			MenuOff2(MenuDesplegado);
			MenuDesplegado=id;
		}
	}
}*/


