var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
function MostrarIdiomas(e) {
	var tempX = 0
	var tempY = 0
	if (IE) { 
  		tempX = e.clientX + document.body.scrollLeft
  		tempY = e.clientY + document.body.scrollTop
	} else {  
  		tempX = e.pageX
  		tempY = e.pageY
	};  
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}  
	xajax_Tienda.CerrarIdiomas();
	setTimeout(xajax_Tienda.MostrarIdiomas(tempX,tempY),1500);

}

function EfectoNuevaVentana() {
	nV = document.getElementById('nuevaventana');
	if ( nV != undefined ) {
		nV.style.visibility = "visible";
		nV.style.height = 0 + "px";
		nV.style.width = 0 + "px";		
		nV.style.top = 0 + "px";				
		for (i=0;i<=500;i++) {
			nV.style.top = i + "px";	
			nV.style.width = i + "px";	
			for (j=0;j<=500000;j++) {
			};
		};
		nV.style.height = 500 + "px";		
	};
}

function onSalirBusqueda(e,idioma) {
	var codigoTecla;
	if (window.event) {
		codigoTecla = e.keyCode;
		if (codigoTecla == 13) {
			txt = document.getElementById("inputtexto");
			_gaq.push(['_trackEvent', 'Busqueda', 'Nueva busqueda', txt.value]);			
			xajax_Tienda.BuscarPorTexto(txt.value,1,0,idioma);	
		};
	} else {
		codigoTecla = e.which;
		if (codigoTecla == 13) {
			txt = document.getElementById("inputtexto");
			_gaq.push(['_trackEvent', 'Busqueda', 'Nueva busqueda', txt.value]);			
			xajax_Tienda.BuscarPorTexto(txt.value,1,0,idioma);			
		};		
	};
} 


function onSalirNewsletter(e,idioma) {
	var codigoTecla;
	if (window.event) {
		codigoTecla = e.keyCode;
		if (codigoTecla == 13) {
			email = document.getElementById("inputemailnews");
			xajax_Tienda.MostrarFormNewsletter(email.value,idioma);			
		};
	} else {
		codigoTecla = e.which;
		if (codigoTecla == 13) {
			email = document.getElementById("inputemailnews");
			xajax_Tienda.MostrarFormNewsletter(email.value,idioma);			
		};		
	};
}

function abrirPdf(pdf,dominio) {
	if ( pdf != '' ) {
		window.open('http://' + dominio + '/pdf/maquinas/' + pdf,'pdf');
	};
}

xajax.callback.global.onRequest = function() {
   xajax.$('procesando_msg').style.display = 'block';
//   xajax.$('separador').style.display = 'none';   
}
xajax.callback.global.beforeResponseProcessing = function() {
   xajax.$('procesando_msg').style.display='none';
//   xajax.$('separador').style.display = 'block';      
}



