// JavaScript Document

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

//valida formulario de busqueda
function valida(form)
{
	if(form.buscar.value=='')
	{
		alert("Por favor, escriba una cadená de búsqueda");
		form.buscar.focus();
		return false;
	}
	else
	{
		form.submit();
	}
}
function limpia()
{
	if(document.form1.buscar.value!="")
	{
		//document.form1.buscar.value="";
		document.form1.buscar.select();
		document.form1.buscar.focus();
	}
}
///POPup para recomendacion
function popmail(url,ancho,alto) 
{ 
	var posicion_x; 
	var posicion_y; 
	posicion_x=parseInt(screen.width/2)-(ancho/2); 
	posicion_y=parseInt(screen.height/2)-(alto/2); 
	window.open(url,"Consulta", "width="+ancho+",height="+alto+",menubar=0,toolbar=0,directories=0,scrollbars=no,resizable=yes,left="+posicion_x+",top="+posicion_y); 
}
// Popup para los Artes desde detalle empresa
function popup(url,ancho,alto) 
	{ 
		var posicion_x; 
		var posicion_y; 
		posicion_x=parseInt(screen.width/2)-(ancho/2); 
		posicion_y=parseInt(screen.height/2)-(alto/2); 
		if(alto <= 600 )
		{
		window.open(url, "GNB20112012", "width="+ancho+",height="+alto+",menubar=0,toolbar=0,directories=0,scrollbars=no,resizable=no,left="+posicion_x+",top="+posicion_y+""); 
		}
		else
		{
			ancho = ancho + 20;
			window.open(url, "GNB20112012", "width="+ancho+",height="+alto+",menubar=0,toolbar=0,directories=0,scrollbars=yes,resizable=no,left="+posicion_x+",top="+posicion_y+""); 
		}
	}

//popARTE desde banners
function poparte(nomimg,web,ancho,alto) 
	{ 
		var posicion_x; 
		var posicion_y;
		/*var ancho=100; 
		var alto=100;*/
		var urlp='http://www.gnb.com.bo/guia/arteprin.php?art='+nomimg+'&web='+web;
		//var urlp='/guia/arteprin.php?art='+nomimg+'&web='+web;
		posicion_x=parseInt(screen.width/2)-(ancho/2); 
		posicion_y=100; 
		if(alto <= 610 )
		{
		window.open(urlp, "GNB20112012", "width="+(ancho)+",height="+(alto)+",menubar=0,toolbar=0,directories=0,scrollbars=0,resizable=no,left="+posicion_x+",top="+posicion_y+""); 
		}
		else
		{
			ancho = ancho + 20;
			window.open(urlp, "GNB21102012", "width="+(ancho)+",height="+(alto)+",menubar=0,toolbar=0,directories=0,scrollbars=1,resizable=no,left="+posicion_x+",top="+posicion_y+""); 
		}
	}

// Para el Mapa /
var win=null;
function popupMapa(mypopurl,mypopname,sizew,sizeh,poppos,Layer){
if(poppos=="center"){ PopLeft=(screen.width)?(screen.width-sizew)/2:100;PopTop=(screen.height)?(screen.height-sizeh)/2:100;}
else if((poppos!='center') || poppos==null){ PopLeft=+0;PopTop=+0}
Fresh="width=" + sizew + ",height=" + sizeh + ",top=" + PopTop + ",left=" +  PopLeft + ",directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no";win=window.open(mypopurl,mypopname,Fresh);
win.focus();}


//  ventana de detalle
	function nueva_ventana(url, ancho, alto, barra) 
	{   
   	izquierda = (screen.width) ? (screen.width-ancho)/2 : 100   
    	arriba = (screen.height) ? (screen.height-alto)/2 : 100   
    	opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + barra + ',resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + ''  
    window.open(url, 'popUp', opciones)   
	}   

