//

function pviiObjbg(obj, new_color) { //v2.1 by Project VII
	obj.style.backgroundColor=new_color
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function swapImage(element, image) {
	document.getElementById(element).style.backgroundImage = "url(" + image + ")";
}


var win = null;
function NewWindow(mypage,myname,w,h,scroll,resi){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resi+''
win = window.open(mypage,myname,settings,resi)

if(win.window.focus){win.window.focus();}
}


function buscar()
{
	if(document.form_busqueda.q.value!="")
	{
		
//		alert(document.form_busqueda.web[0].checked)
//		alert(document.form_busqueda.web[1].checked)		
		
		if(document.form_busqueda.web[0].checked==true)
		{
			document.form_busqueda.action = "buscador.php";	
		}else{			
			//document.form_busqueda.action = "http://www.google.com.pe/search?hl=es&q="+ document.form_busqueda.txt_criterio.value +"&btnG=Buscar+con+Google&meta=";				
			document.form_busqueda.action = "http://www.google.com/search";
		}		
	
		document.form_busqueda.submit();
		
	}else{
		alert('Introduzca su criterio de busqueda')	
	}
}
// END OF LINE

function Valida_Datos()
{
	if(document.form1.txt_usuario.value=="")
	{
		alert("Introduzca el nombre del usuario");
		document.form1.txt_usuario.focus();

	}else{		
		if(document.form1.txt_contrasenia.value=="")
		{
			alert("Introduzca el password");
			document.form1.txt_contrasenia.focus();	
		}else{
			document.form1.submit();			
		}
	}	
	

}
	
function resetear()
{
		document.form1.action="login.php";			
		document.form1.submit();			
}	


//abrir ventana centrada
function AbrirURL(theURL,winName,features, myWidth, myHeight, isCenter) 
{ 
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function cargar(nombre_01,nombre_02,nombre_03,nombre_04)
{
	document.getElementById("info01").style.display='none';			
	document.getElementById("info02").style.display='none';		
	document.getElementById("info03").style.display='none';			
	document.getElementById("info04").style.display='none';			
	document.getElementById("info05").style.display='none';		
	document.getElementById("info06").style.display='none';		
	document.getElementById("info07").style.display='none';			
	document.getElementById("info08").style.display='none';		
	document.getElementById("info09").style.display='none';		
	document.getElementById("info10").style.display='none';			
	document.getElementById("info11").style.display='none';		
	document.getElementById("info12").style.display='none';	
	document.getElementById(nombre_01).style.display='block';				
	document.getElementById(nombre_02).style.display='block';					
	document.getElementById(nombre_03).style.display='block';						
	document.getElementById(nombre_04).style.display='block';						
}

function cargar1(nombre_01,nombre_02)
{
	document.getElementById("info01").style.display='none';			
	document.getElementById("info02").style.display='none';		
	document.getElementById("info03").style.display='none';			
	document.getElementById("info04").style.display='none';	
	document.getElementById(nombre_01).style.display='block';						
	document.getElementById(nombre_02).style.display='block';							

}