/***************************************************** 

Abrir documento htm en una ventana nueva	

*****************************************************/



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);



}



	var ruta ="";
	ruta=readCookie("idioma");
	if (ruta == null) {
		ruta = "/";
	}
	else if (ruta == "NaN")
	{
		ruta = "/";
	}
	
	
	
	





/***************************************************** 

Recargar ventana si Redimensiona Nav4	

*****************************************************/

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();

}







/***************************************************** 

Encontrar objeto por las coordenadas	

*****************************************************/

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;

}



/***************************************************** 

Poner texto del Layer	

*****************************************************/

function MM_setTextOfLayer(objName,x,newText) { //v4.01

  if ((obj=MM_findObj(objName))!=null) with (obj)

    if (document.layers) {document.write(unescape(newText)); document.close();}

    else innerHTML = unescape(newText);

}



/***************************************************** 

Mostrar Layers ocultos

*****************************************************/

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; }

}



/******************************************************************** 

Cambiar el idioma de la página y no perder la localización actual

*********************************************************************/



function Urlidioma(  idioma )

{	


createCookie("idioma","/"+idioma,3);

	location.href = document.location.pathname;
}







/******************************************************************** 



Cambiar el zoom de la página y empleo de cookies 



*********************************************************************/







function zoomText(Accion){ 



//inicializaciones



var divElements = document.getElementsByTagName('div'); 



obj=divElements[0];



if (obj.style.fontSize==""){



obj.style.fontSize="100%";



}



actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto 



incremento=10;// el valor del incremento o decremento en el tamaño 







//accion sobre el texto 



if(Accion=="reestablecer"){



obj.style.fontSize="100%";



createCookie("fontsize",obj.style.fontSize,30);



var resultado=readCookie("fontsize");



//alert('Valor guardado en cookie: ' + resultado);







}



if(Accion=="aumentar"){



valor=actual+incremento;

if (valor<=200)



{



	obj.style.fontSize=valor+"%";



}



else



{	



	valor=200;

	obj.style.fontSize=valor+"%";



}



createCookie("fontsize",obj.style.fontSize,30);



var resultado=readCookie("fontsize");



//alert('Valor guardado en cookie: ' + resultado);



}



if(Accion=="disminuir"){



valor=actual-incremento;



if (valor>=100)



{



	obj.style.fontSize=valor+"%";



}



else



{	



	valor=100;



	obj.style.fontSize=valor+"%";



}



createCookie("fontsize",obj.style.fontSize,30);



var resultado=readCookie("fontsize");



//alert('Valor guardado en cookie: ' + resultado);



}











}



















function loadPage() {



	var resultado = readCookie("fontsize");



	//alert('Valor guardado en cookie1: ' + resultado);



	var divElements = document.getElementsByTagName('div'); 



	obj=divElements[0];







	//alert('Valor guardado en cookie1: ' + obj);



	obj.style.fontSize = resultado;



	//alert('refrescado');



	



		//alert("Cargada pag tamano " + resultado);



}







//if(!window.onload) window.onload=loadPage();







function createCookie(name,value,days) {



  if (days) {



    var date = new Date();



    date.setTime(date.getTime()+(days*24*60*60*1000));



    var expires = "; expires="+date.toGMTString();



  }



  else expires = "";



  document.cookie = name+"="+value+expires+"; path=/";



}







function readCookie(name) {



  var nameEQ = name + "=";



  var ca = document.cookie.split(';');



  for(var i=0;i < ca.length;i++) {



    var c = ca[i];



    while (c.charAt(0)==' ') c = c.substring(1,c.length);



    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);



  }



  return null;



}



loadPage();



/****************************************************************

 Impresion:  Abre una ventana nueva que se es la que se encarga 

 de imprimir el contenido de la ventana actual.

****************************************************************/





function imprimir(camino){

	var pagImp = camino + "diseno/paginaImprimir.html";

	window.open(pagImp,"ventanaImprimir","top=0,left=0,width=670,height=500,scrollbars=Yes,resizable=No,directories=No,location=no,menubar=No,status=No,titlebar=No,toolbar=No");

}




