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();
}
MM_reloadPage(true);

function MM_showHide() { //v6.0
  var i,p,v,obj,args=MM_showHide.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')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function display(myimage) {
 html = "<html><head><title>Photo</title>" +
  "</head><body leftmargin=0 " +
  "marginwidth=0 topmargin=0 marginheigth=0><center>" +
  "<img src='" + myimage + "' border=0 name=image " +
  "onload='window.resizeTo(document.image.width+12,document.image.height+30)'></center>" +
  "<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4175562-2");
pageTracker._trackPageview();
} catch(err) {}</script></body></html>";
 popup=window.open
   ('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=100,height=100');
 popup.document.open();
 popup.document.write(html);
 popup.document.focus();
 popup.document.close()
 };

cuantasCat=0;
ultima=1;
function cambiaMenu(cual){
	for(i=1;i<cuantasCat;i++){
		eval("MM_showHide('subNavLeft"+i+"','','hide')");
	}
	if(cual!=ultima){
		eval("MM_showHide('subNavLeft"+cual+"','','show')");
	ultima=cual;
	}else{
		eval("MM_showHide('subNavLeft"+cual+"','','hide')");
		ultima=0;
	}		
}
function agregaItem(id,cantidad){
	window.document.formCart.itemCart.value=id;
	window.document.formCart.cantidad.value=cantidad;
	window.document.formCart.submit();
}

function MM_showHide() { //v6.0
  var i,p,v,obj,args=MM_showHide.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')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

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_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_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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function preloadImages(){
MM_preloadImages('images/btn-empresa-over.jpg')
MM_preloadImages('images/btn-inflables-over.jpg')
MM_preloadImages('images/btn-inicio-over.jpg')
MM_preloadImages('images/btn-calidad-over.jpg')
MM_preloadImages('images/btn-salas-over.jpg')
MM_preloadImages('images/btn-detalle-over.jpg')
MM_preloadImages('images/nav-left-over.jpg')
MM_preloadImages('images/btn-imagine.jpg')
MM_preloadImages('images/btn-conectese-over.jpg')
MM_preloadImages('images/btn-disfrute-over.jpg')
MM_preloadImages('images/btn-proyecte-over.jpg')
}

function validate_news(cualForm) {
  validity = true; // assume valid
  if (cualForm.emailNews.value=="Email"){
   		validity = false;
		alert('Por favor ingrese el Email'); 
	}else if(cualForm.nombreNews.value=="Nombre"){
   		validity = false;
		alert('Por favor ingrese su Nombre'); 
	}else if (cualForm.apellidoNews.value=="Apellido"){
   		validity = false;
		alert('Por favor ingrese su Apellido'); 
	}
	
	
  if (validity){  return validity;}
}

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}
function check_large(text) {
  return (text.length > 5); // returns false if empty
}

function enviaNews(){
objForm=window.document.formNewsletter;
var isok=validate_news(objForm)
if (isok){
	objForm.submit();
}
}

function checkSelectRubro(){ 
    var indice = document.formBuscar.selectRubro.selectedIndex;
    var valor = document.formBuscar.selectRubro.options[indice].value ;
	if(valor==""){document.formBuscar.selectRubro.selectedIndex=indice+1;}
	if(valor=="raya"){document.formBuscar.selectRubro.selectedIndex=indice+2;}
} 
var mensaje= new Array();
mensaje[0]="Por favor, indique la razón por la cual contacta con nosotros.";
mensaje[1]="Por favor, para facilitar el trámite de su consulta indique el código de su pedido."
mensaje[2]="Por favor, para facilitar el trámite de su consulta indique el modelo y la marca del producto así como una explicación detallada de su consulta."
mensaje[3]="Por favor indique su número de pedido y la causa de la devolución."

mensajeActual=""

function checkSelectContacto(){ 
    objFormContacto=document.formContacto;
	var indice = objFormContacto.motivo.selectedIndex;
    var valor = objFormContacto.motivo.options[indice].value;
	switch (valor) {
		case "0":
			objFormContacto.mensaje.value=mensaje[0];
			mensajeActual=mensaje[0];
			break;
		case "1":
			objFormContacto.mensaje.value=mensaje[1];
			mensajeActual=mensaje[1];
			break;
		case "2":
			objFormContacto.mensaje.value=mensaje[2];
			mensajeActual=mensaje[2];
			break;
		case "3":
			objFormContacto.mensaje.value=mensaje[3];
			mensajeActual=mensaje[3];
			break;
	}
} 
function checkMotivoVacio(){
	    objFormContacto=document.formContacto
	if (objFormContacto.mensaje.value==""){
		checkSelectContacto();
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateConsulta(cualForm) {
  validity = true; // assume valid
	 if (!check_empty(cualForm.nombre.value)||cualForm.nombre.value=="Nombre y Apellido"){
   		validity = false;
		alert('Por favor ingrese su Nombre y Apellido'); 
	}else if (!check_empty(cualForm.email.value)||cualForm.email.value=="Email"){
   		validity = false;
		alert('Ingrese su e-mail'); 
	}else if (!check_empty(cualForm.telefono.value)||cualForm.telefono.value=="Teléfono"){
   		validity = false;
		alert('Ingrese su Teléfono'); 
	}else if (!check_empty(cualForm.localidad.value)||cualForm.localidad.value=="Localidad/País"){
   		validity = false;
		alert('Ingrese su Localidad y País'); 
	}else if (!check_empty(cualForm.mensaje.value)||cualForm.mensaje.value=="Escriba aquí su mensaje"){
   		validity = false;
		alert('Ingrese el Mensaje'); 
	}
  if (validity){  return validity;}
}

function validateClave(cualForm) {
  validity = true; // assume valid
	 if (!check_empty(cualForm.claveEmail.value)){
   		validity = false;
		alert('Por favor ingrese el Email'); 
	}
  if (validity){  return validity;}
}

function enviaConsultas(){
objForm=window.document.formConsultas;
isok= false
 	isok=validateConsulta(objForm)
if (isok){
	objForm.submit();
}
}
function display(myimage,mytitle) {
 html = "<html><head><title>Mundo Inflable:"+ mytitle +"</title>" +
  "</head><body leftmargin=0 " +
  "marginwidth=0 topmargin=0 marginheigth=0><center>" +
  "<img src='" + myimage + "' border=0 name=image " +
  "onload='window.resizeTo(document.image.width+12,document.image.height+30)'></center>" +
  "<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4175562-2");
pageTracker._trackPageview();
} catch(err) {}</script></body></html>";
 popup=window.open
   ('','image','left=200,top=100,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=100,height=100');
 popup.document.open();
 popup.document.write(html);
 popup.document.focus();
 popup.document.close()
 };

var imagen= new Array()
var label= new Array()

imagen[0]='eventos-01-small';
imagen[1]='eventos-02-small';
imagen[2]='eventos-03-small';
imagen[3]='eventos-04-small';
imagen[4]='eventos-05-small';
label[0]='Cruzada Evangelista';
label[1]='Ginzburg Show';
label[2]='Puerto San Martín';
label[3]='Exposición en S. Luis';
label[4]='Club San Jorge';

var cuantas=imagen.length
var actual=0;

function nextPic(cual){
	actual=actual+cual
	if (actual>=cuantas){actual=0}
	if (actual==-1){actual=cuantas-1}

//	foto.style.filter="blendTrans()"
//	foto.filter="revealTrans(Transition=2)"
	if(document.all)foto.style.filter="blendTrans(duration=1)";
	if(document.all)foto.filters.blendTrans.apply();
	document.getElementById("foto").innerHTML="<a href='javascript:verDetalle()'><img src='eventos/images/"+imagen[actual]+".jpg' onLoad='cargaSiguiente()' border='0'></a>";
	if(document.all)foto.filters.blendTrans.play();
	
	if(document.all)labelEventos.style.filter="blendTrans(duration=1)";
	if(document.all)labelEventos.filters.blendTrans.apply();
	document.getElementById("labelEventos").innerHTML=label[actual];
	if(document.all)labelEventos.filters.blendTrans.play();
	}

function muestraSiguiente(){
elTiempo=setTimeout("nextPic(1)",5000)
}
function verDetalle(){
	eval("display('eventos/images/eventos-0"+(actual+1)+".jpg','"+label[actual]+"')");
}

function cargaSiguiente(){
esta=(actual>=(cuantas-1))?0:actual+1;
		document.getElementById("capaOculta").innerHTML="<img src='eventos/images/"+imagen[esta]+".jpg' onLoad='muestraSiguiente()' >"
}


function muestraCual(cual){
clearTimeout(elTiempo);
nextPic(cual);
}
function pausa(){
clearTimeout(elTiempo);
}

