var vEvAnterior;
var slideCache = new Array(); 
vEvAnterior=1;
function imprimir(que) {
	var ventana = window.open("", "", "");
	var contenido = "<html><link rel='stylesheet' type='text/css' href='css/estilos.css' /><body style='background:#FFFFFF' onload='window.print();window.close();'><div style='width:570ppx; background:#FFFFFF'>" + document.getElementById(que).innerHTML + "</div></body></html>";
	ventana.document.open();
	ventana.document.write(contenido);
	ventana.document.close();
}
function zoomText(Accion,Elemento)
{	var obj=document.getElementById(Elemento);
	var max = 200 //tamaño máximo del fontSize
	var min = 70 //tamaño mínimo del fontSize
	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=="normal" ){
		obj.style.fontSize="100%"
	}
	if( Accion=="aumentar" && ((actual+incremento) <= max )){
		valor=actual+incremento;
		obj.style.fontSize=valor+"%"
	}
	if( Accion=="disminuir" && ((actual+incremento) >= min )){
		valor=actual-incremento;
		obj.style.fontSize=valor+"%"
	}
} 
function NewWindow(mypage,myname,w,h,scrollbar,resi)
{	LeftPosition = (screen.width-w)/2
	TopPosition = (screen.height-h)/2 
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbar+',resizable='+resi+',toolbar=no,directories=no,menubar=no,status=no'
	//window.open(mypage,myname,settings);
	
	var vent ;
	 vent =open(mypage,vent,settings);
	 vent.focus();
}
function changeSize(pVal)
{	var eventos = new Array();
	var pTxtSalida;
	eventos[0] = "disminuir";
	eventos[1] = "normal";
	eventos[2] = "aumentar";
	if(pVal!="3")
	{	switch(pVal)
		{	case 0:
				if((vEvAnterior=="1")||(vEvAnterior=="0"))
				{	document.getElementById("Tamizar").innerHTML='Tama&ntilde;o texto <a href="javascript:changeSize(3);" class="zoom10" title="Disminuir">A</a> <a href="javascript:changeSize(1);" class="zoom11" title="Normal">A</a> <a href="javascript:changeSize(2);" class="zoom12" title="Agrandar">A</a>';	}
				else
				{	document.getElementById("Tamizar").innerHTML='Tama&ntilde;o texto <a href="javascript:changeSize(0);" class="zoom10" title="Disminuir">A</a> <a href="javascript:changeSize(3);" class="zoom11" title="Normal">A</a> <a href="javascript:changeSize(2);" class="zoom12" title="Agrandar">A</a>';	}
				break;
			case 1:	document.getElementById("Tamizar").innerHTML='Tama&ntilde;o texto <a href="javascript:changeSize(0);" class="zoom10" title="Disminuir">A</a> <a href="javascript:changeSize(3);" class="zoom11" title="Normal">A</a> <a href="javascript:changeSize(2);" class="zoom12" title="Agrandar">A</a>';break;
			case 2:	
				if((vEvAnterior=="1")||(vEvAnterior=="2"))
				{	document.getElementById("Tamizar").innerHTML='Tama&ntilde;o texto <a href="javascript:changeSize(0);" class="zoom10" title="Disminuir">A</a> <a href="javascript:changeSize(1);" class="zoom11" title="Normal">A</a> <a href="javascript:changeSize(3);" class="zoom12" title="Agrandar">A</a>';	}
				else
				{	document.getElementById("Tamizar").innerHTML='Tama&ntilde;o texto <a href="javascript:changeSize(0);" class="zoom10" title="Disminuir">A</a> <a href="javascript:changeSize(3);" class="zoom11" title="Normal">A</a> <a href="javascript:changeSize(2);" class="zoom12" title="Agrandar">A</a>';	}
				break;
		}
		zoomText(eventos[pVal],"Lectura");
		vEvAnterior=pVal;
	}
}

function solicitar(pStrTipo,pStrModelo)
{	eval("document.getElementById('contenido_solicitar').style.display='inline'");
	recibeid("solicitar.php","tipo="+pStrTipo+"&mod="+pStrModelo,"","contenido_solicitar",1);
}

function cerrar()
{	eval("document.getElementById('contenido_solicitar').style.display='none'");
}

function valSol()
{	if(document.frmSol.txtNombres.value=="")
	{	alert("Ingrese sus nombres");document.frmSol.txtNombres.focus();return;	}
	if(document.frmSol.txtEmail.value=="")
	{	alert("Ingrese su email");document.frmSol.txtEmail.focus();return;	}
	if(document.frmSol.txtCantidad.value=="")
	{	alert("Indique la cantidad a solicitar");document.frmSol.txtCantidad.focus();return;	}
	recibeid("enviar.php","","Nombres="+document.frmSol.txtNombres.value+"&Tlfs="+document.frmSol.txtTelefonos.value+"&Email="+document.frmSol.txtEmail.value+"&Producto="+document.frmSol.txtProducto.value+"&Cantidad="+document.frmSol.txtCantidad.value+"&Mensaje="+document.frmSol.txtMensaje.value,"contenido_solicitar",1);
	setTimeout ("cerrar();", 30000);
	alert("Su solicitud ha sido enviada correctamente. En breve nos contactaremos con usted.");
}

function valSolE()
{	if(document.frmSol.txtNombres.value=="")
	{	alert("Enter your names");document.frmSol.txtNombres.focus();return;	}
	if(document.frmSol.txtEmail.value=="")
	{	alert("Enter your email");document.frmSol.txtEmail.focus();return;	}
	if(document.frmSol.txtCantidad.value=="")
	{	alert("Enter to quantity of products");document.frmSol.txtCantidad.focus();return;	}
	recibeid("enviar.php","","Nombres="+document.frmSol.txtNombres.value+"&Tlfs="+document.frmSol.txtTelefonos.value+"&Email="+document.frmSol.txtEmail.value+"&Producto="+document.frmSol.txtProducto.value+"&Cantidad="+document.frmSol.txtCantidad.value+"&Mensaje="+document.frmSol.txtMensaje.value,"contenido_solicitar",1);
	setTimeout ("cerrar();", 30000);
	alert("Your request has send. Our personal are contact with you. Thank you very much.");
}


function RunSlideShow(pictureName,imageFiles,displaySecs) 
{	var imageSeparator = imageFiles.indexOf(";"); 
	var nextImage = imageFiles.substring(0,imageSeparator); 
	if (document.all) 
	{	document.getElementById(pictureName).style.filter="blendTrans(duration=2)"; 
		document.getElementById(pictureName).filters.blendTrans.Apply(); 
	} 
	document.getElementById(pictureName).src = nextImage; 
	if (document.all) 
	{	document.getElementById(pictureName).filters.blendTrans.Play(); 
	} 
	var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length) 
	+ ';' + nextImage; 
	setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")", 
	displaySecs*1000); 
	// cambio de imagen. 
	imageSeparator = futureImages.indexOf(";"); 
	nextImage = futureImages.substring(0,imageSeparator); 
	if (slideCache[nextImage] == null) { 
		slideCache[nextImage] = new Image; 
		slideCache[nextImage].src = nextImage; 
	} 
}
