var blnAbierta=0;
var posleft;
var postop;

var n = (document.layers) ? 1:0
var ie = (document.all) ? 1:0

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}

function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}

function writetolayer(lay,txt) {
if (ie4) { document.all[lay].innerHTML = txt;}

if (ns4) {
	document[lay].document.write(txt);
	document[lay].document.close();
}

if (ns6) {
	over = document.getElementById([lay]);
	range = document.createRange();
	range.setStartBefore(over);
	domfrag = range.createContextualFragment(txt);
	while (over.hasChildNodes()) {
	over.removeChild(over.lastChild);
}

	over.appendChild(domfrag);
   	}
}


function redireccionar(){
    location.href=Pagina
} 

function Add_Favoritos(){
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
	var url="http://www.casanacho.com/";
	var titulo="Casa Nacho Moraira (Portet)";
	window.external.AddFavorite(url,titulo);
	}
	else {
		if(navigator.appName == "Netscape") 
		alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks");
	}
}

function mailpage()
{
  mail_str = "mailto:npastorm@yahoo.es?subject= " + document.title;
//  mail_str += "&body=Te recomiendo que visites esta página (www.casanacho.com) -- " + document.title;
//  mail_str += ". Enlace: " + location.href; 
  location.href = mail_str;
}

function MM_OpenWindow(theURL,winName,features) { //v2.0
		//alert(theURL);
		//alert(winName);
		//alert(features);		

		if (blnAbierta == 1) {
			if (!(VentanaAcceso.closed)) {
				VentanaAcceso.close();
				blnAbierta = 0;
			}
		}

		VentanaAcceso = window.open(theURL,winName,features);
		blnAbierta = 1;
		
}

function openWin(ventana) {

		if (blnAbierta == 1) {
			if (!(VentanaAcceso.closed)) {
				VentanaAcceso.close();
				blnAbierta = 0;
			}
		}
		
		switch (ventana){
                  case 0:
				posleft = (screen.availWidth / 2) - 107;  // (245 / 2)
				postop = (screen.availHeight / 2) - 130;  // (380 / 2)
				MM_openWindow('ofertas.htm','Ventanuco','width=245,height=330,alwaysRaised=1,resizable=1,scrollbars=0,left=' + posleft + ',top=' + postop);
				return true;
				break;
			case 1:
				posleft = (screen.availWidth / 2) - 145;  // (245 / 2)
				postop = (screen.availHeight / 2) - 135;  // (380 / 2)
				MM_openWindow('ofertas.htm','Ventanuco','width=245,height=330,alwaysRaised=1,resizable=1,scrollbars=0,left=' + posleft + ',top=' + postop);
				return true;
				break;
		}
		return false;		
}

function Lengua(Id)
{
      Idioma=Id;
      carga(DirFotos2);
}

function carga(page)
{
//	if (n) document.menu.src = page
//	if (ie) document.menu.location = page
//        urlQuery = page.split("?")
//        if (urlQuery[1] != null) {
             window.location.href = "default.htm?" + page + '?lg' + Idioma

}

