// JavaScript Document

var ant='';
function abrir(id){
	var lista = document.getElementById(id);
	if(ant!='' && ant!=id){
		var listaant = document.getElementById(ant);
		listaant.style.display="none";
	}
	if(lista.style.display=="none"){
		lista.style.display="block";
	}else{
		lista.style.display="none";
	}

	ant=id;
}

var ban_lista=0;
function entroLista(id){
	ban_lista=1;
}

function abrirImagen(q){
	var ar = window.open("popup.php?q="+q,"1","width=50, height=50, left=0, top=0, menubar=no, status=no");
}

function abrirImprimir(){
	var ar = window.open("resultado_productos_imprimir.php","1","width=570, scrollbars=yes, height=500, left=0, top=0, menubar=no, status=no");
}

function salioLista(id){
	if(ban_lista==1){
		setInterval("abrir('"+id+"')",1000);
		ban_lista=0;
	}
}

//estas funciones son de la agenda
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if(	selObj.options[selObj.selectedIndex].value != 0 ){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
  }else{
	   selObj.selectedIndex=0;
  }
}

/*function abrir360(q,id){
	var ar = window.open("360.php?q="+q+"&id="+id,q,'width=500, height=404, scrollbars=no, menubar=no, status=no, resizable=no');
}*/
function abrir360(q,id){
	var ar = window.open("360.php?q="+q+"&id="+id,"360",'width=500, height=400, scrollbars=no, menubar=no, status=no, resizable=no');
	ar.focus();
}
function poner_mapa(id,id2,q){
	var texto = document.getElementById(id);
	texto.innerHTML=q;
	abrir(id2);
}

function poner_mapa2(id,q){
	var texto = document.getElementById(id);
	texto.innerHTML=q;
}

function poner_form2(id,id2,q,q2){
	var texto = document.getElementById(id);
	texto.innerHTML=q;
	texto.style.color="#003366";
	cargar_form(id,q2);
	abrir(id2);
}

function poner_form(id,id2,q){
	var texto = document.getElementById(id);
	texto.innerHTML=q;
	texto.style.color="#003366";
	cargar_form(id,q);
	abrir(id2);
}

function resetear(){
	document.contacto.reset();
	var t1 = document.getElementById("tipo_cliente");
	var t2 = document.getElementById("consulta");
	var t3 = document.getElementById("comoconocio");
	t3.innerHTML = "&nbsp;Seleccione una opci&oacute;n...";
	t2.innerHTML = "&nbsp;Seleccione una opci&oacute;n...";
	t1.innerHTML = "&nbsp;Seleccione una opci&oacute;n...";
}
function resetear2(){
	document.location.href = document.location.href;
}
function cargar_form(id,q){
	document.contacto[id+"2"].value=q;
}
var aux='';
var bandera = 0;
var menusArray = new Array()
menusArray['prods']=0;
menusArray['emp']=0;
function salio(){
	bandera=1;
	setInterval('cerrarMenu()',3000);
}
function entro(){
	bandera=0;
}
function cerrarMenu(){
	if(bandera==1){
		var a = document.getElementById('prods');
		a.style.display="none";
	}
}
function salirSubmenu(id){
	var a = document.getElementById(id);
	a.style.display="none";
	var e = document.getElementById(id+"2");
	e.className="menu_link";
	menusArray[id]=0;
}
function salirAux(){
	if(aux!=''){
		var a = document.getElementById(aux);
		a.style.display="none";
		var e = document.getElementById(aux+"2");
		e.className="menu_link";
		aux='';
	}
}
function abrirSubmenu(id){
	salirAux();
	var a = document.getElementById(id);
	a.style.display="block";
	var e = document.getElementById(id+"2");
	e.className="menu_link_hover";
	aux=id;
	bandera=1;
	if(	menusArray[id]==0 )
	{
		menusArray[id]=1;
		setInterval("salirSubmenu('"+id+"')",10000);
	}
}


function mostrar(id){
	var el = document.getElementById(id);
	if(el.style.display=='none'){
		el.style.display="block";
	}
}

function ocultar(id){
	var el = document.getElementById(id);
	if(el.style.display=='block'){
		el.style.display="none";
	}
}
function logoSwf( leng){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="152" height="89">\n');
	document.write('<param name="movie" value="images/header/proveedores_'+leng+'.swf">\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param  name="wmode" value="transparent" />\n');
	document.write('<embed src="images/header/proveedores_'+leng+'.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="152" height="89"></embed>\n');
	document.write('</object>\n');
}
function homeSwf( leng){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="898" height="285">\n');
	document.write('<param name="movie" value="images/home/flashindex_'+leng+'.swf" >\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param  name="wmode" value="transparent" />\n');
	document.write('<embed src="images/home/flashindex_'+leng+'.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="898" height="285"></embed>\n');
	document.write('</object>\n');
}

function historiaSwf( leng){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="898" height="300">\n');
	document.write('<param name="movie" value="images/historia/venturi-historia_'+leng+'.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param  name="wmode" value="transparent" />\n');
	document.write('<embed src="images/historia/venturi-historia_'+leng+'.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="898" height="300"></embed>\n');
	document.write('</object>\n');
}

function redSwf( leng){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="898" height="452">\n');
	document.write('<param name="movie" value="images/red-comercial/red-comercial_'+leng+'.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param  name="wmode" value="transparent" />\n');
	document.write('<embed src="images/red-comercial/red-comercial_'+leng+'.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="898" height="452"></embed>\n');
	document.write('</object>\n');
}
