var SubjectMail= "No te pierdas las últimas novedades en seguridad antivirus de Panda Software";

menuAct = "-";
menuAnt = "-";

//Colores para menu
fondo="#f4f4f4";
resalta="#e1e1e1";
pincha="#aaaaaa";
suelta="#aaaaaa";
separa="#f4f4f4";
var BGColorSec="#ffffff"; //Variable para el color de la opción que estamos visitando.
var DownmouseColor="#aaaaaa"; //Variable para el color cuando se hace click.
var DownmouseFontColor="#000000"; //Variable para el color de la fuente cuando se hace click.
//precarga de botones
var nFile1=''
var nFile2=''

b_a=new Image();
b_a.src="/CmsPanda/img/hom/01hom_info.gif";
b_b=new Image();
b_b.src="/CmsPanda/img/hom/01hom_info_il.gif";

c_a=new Image();
c_a.src="/CmsPanda/img/hom/01hom_probar.gif";
c_b=new Image();
c_b.src="/CmsPanda/img/hom/01hom_probar_il.gif";

d_a=new Image();
d_a.src="/CmsPanda/img/hom/01hom_comprar.gif";
d_b=new Image();
d_b.src="/CmsPanda/img/hom/01hom_comprar_il.gif";

e_a=new Image();
e_a.src="/CMSPANDA/img/des/01des_ac_desc.gif";
e_b=new Image();
e_b.src="/CMSPANDA/img/des/01des_ac_desc_on.gif";



function apli_style1(oStyle, cFondo, cursor, fColor, id, modo )
	{	
	   if(event.button==2)return;	    
			menuAnt = menuAct;
			menuAct = id;
			oStyle.style.background = cFondo;
			oStyle.style.cursor=cursor;
			oStyle1 = document.getElementById(id);			
		   	oStyle1.style.color = fColor;
	}
function abrir_popup(pagina,w,h)
{	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
window.open(pagina,"_blank","scrollbars=yes,resizable=yes,width="+w+",height="+h+",left="+x+", top="+y);
}

function abrir_guia()
{abrir_popup("http://www.pandasoftware.es/multimedia/selector.htm",730,450)}

function poll(idopcion)
{window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=851&id_opcion='+idopcion,'encuesta','width=250,height=100')}

function ventana_tru()
{
window.open('/cmspanda/partners/truprevent/truprevent.htm','','height=500 , width=800 , scrollbars=yes')
}

function ventana_tru_en()
{
window.open('/cmspanda/partners/truprevent/en/truprevent.htm','','height=500 , width=800 , scrollbars=yes')
}

function ventana_gatedefender_es()
{
window.open('/microsites/es/gatedefender','','height=500 , width=800 , scrollbars=yes')
}

function ventana_gatedefender_en()
{
window.open('/microsites/en/gatedefender','','height=500 , width=800 , scrollbars=yes')
}

function abrirMapa3()
{
	var dir;
	if (window.document.location.href.indexOf("#")>0)
	{
		dir = window.document.location.href.substring(0,window.document.location.href.indexOf("#"))
	}
	else
	{
		dir = window.document.location.href;
	}
	if (window.document.referrer.indexOf(dir)<0)
	{
		window.open('/virus_info/flash/mapa_popup.htm', 'mapavirus','toolbar=no,width=613,height=377,resizable=no')
	}
}

function abrirMapa3_en()
{
	var dir;
	if (window.document.location.href.indexOf("#")>0)
	{
		dir = window.document.location.href.substring(0,window.document.location.href.indexOf("#"))
	}
	else
	{
		dir = window.document.location.href;
	}
	if (window.document.referrer.indexOf(dir)<0)
	{
		window.open('/virus_info/flash/02mapa_popup.htm', 'mapavirus','toolbar=no,width=613,height=377,resizable=no')
	}
}

//Funciones para encuestas del Right Banner
function get_opciones_1272() { 
  valores=''; 
  if (tableOfContents = document.getElementById('tabla_pool_1272')) { 
		var rows = tableOfContents.getElementsByTagName('input'); ; 
		for (x=0; x < rows.length; x++) {  
			if (rows[x].type == 'checkbox' && rows[x].checked) { 
                valores += (valores==''?'':',')+rows[x].name; 
			} 
		} 
  } 
  if(valores=='') alert('Seleccione una opcion. !!!'); 
  else { 
    window.open('http://217.76.135.107/tech-marketresearch.com/miniencuestas/briefing_datos_form.php?id=1272&valores='+valores,'encuesta_1272','width=250,height=150');
    document.getElementById('div_1272').style.display='none'; 
    if (tableOfContents = document.getElementById('tabla_pool_1272')) { 
		var rows = tableOfContents.getElementsByTagName('input'); ; 
		for (x=0; x < rows.length; x++) {  
			if (rows[x].type == 'checkbox') { 
                rows[x].disabled=true; ; 
			} 
		} 
    } 
  }
} 
function get_opciones_1274(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1274&id_opcion='+opcion_id,'encuesta_1274','width=250,height=150');
} 
function get_opciones_1269(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1269&id_opcion='+opcion_id,'encuesta_1269','width=250,height=150');
} 
function get_opciones_1243(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1243&id_opcion='+opcion_id,'encuesta_1243','width=250,height=150');
} 
function get_opciones_1238(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1238&id_opcion='+opcion_id,'encuesta_1238','width=250,height=150');
} 
function get_opciones_1237(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1237&id_opcion='+opcion_id,'encuesta_1237','width=250,height=150');
} 
function get_opciones_1213(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1213&id_opcion='+opcion_id,'encuesta_1213','width=250,height=150');
} 

function get_opciones_1210(opcion_id) { 
			window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1210&id_opcion='+opcion_id,'encuesta_1210','width=250,height=150');
} 

function get_opciones_1233(opcion_id)
{ 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1233&id_opcion='+opcion_id,'encuesta_1233','width=250,height=150');
} 
function get_opciones_1082(opcion_id) { 
			window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1082&id_opcion='+opcion_id,'encuesta_1082','width=250,height=150');
} 
function gestcombo(surl)
{
	if (surl==1)
	{
		window.open ('http://acs.pandasoftware.com/updates/newversions/pbrowser.phtml?language=0')
	}
	else
	{
		location.href=surl;
	}	
}

function get_opciones_1256(opcion_id) { 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1256&id_opcion='+opcion_id,'encuesta_1256','width=250,height=150');
} 

function get_opciones_1247(opcion_id) { 

    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1247&id_opcion='+opcion_id,'encuesta_1247','width=250,height=150');

}


function get_opciones_1248(opcion_id) { 

    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1248&id_opcion='+opcion_id,'encuesta_1248','width=250,height=150');

}

function abrir_Vent(url){

   var w;

   window.open(url);

}

function get_opciones_1245(opcion_id) { 

    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1245&id_opcion='+opcion_id,'encuesta_1245','width=250,height=150');

}

 
function get_opciones_1246(opcion_id) { 

    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1246&id_opcion='+opcion_id,'encuesta_1246','width=250,height=150');

}

function abrirAnimacion(animacion)
{
			 
			 window.open(animacion,'multimedia','width=680,height=500,top=100');
}	
	
function pp(IdVendor, IdLang, IdPais)
{								
				switch (IdPais)
				{
					case 3: //Alemania					
						window.open("http://www.pandasoftware.com/activescan/de/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 29:  //Bolivia

						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 34:  //Bulgaria
						window.open("http://www.pandasoftware.com/activescan/com/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 43:  //Chile
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 44:  //China
						window.open("http://www.pandasoftware.com/activescan/com/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 46:  //Colombia
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 48:  //Costa Rica
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 55:  //Ecuador
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 60: //Eslovaquia
						window.open("http://www.pandasoftware.com/activescan/sk/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case '62':  //España								
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor=1&IdLang=1&IdPais=62","ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 69:  //Francia
						window.open("http://www.pandasoftware.com/activescan/fr/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 74: //Grecia
						window.open("http://www.pandasoftware.com/activescan/gr/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 99:  //Italia
						window.open("http://www.pandasoftware.com/activescan/it/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 101: //Japon
						window.open("http://www.pandasoftware.com/activescan/jp/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 121: //Malasya
						window.open("http://www.pandasoftware.com/activescan/com/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 130:  //Mexico
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 153: //Portugal
						window.open("http://www.pandasoftware.com/activescan/pt/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 154:  //Puerto Rico
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 158: //Rep. Checa
						window.open("http://www.pandasoftware.com/activescan/com/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 163: //Russia
						window.open("http://www.pandasoftware.com/activescan/ru/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 152:  //Polonia
						window.open("http://www.pandasoftware.com/activescan/pol/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true)
					break;
					case 181:  //Suiza
						window.open("http://www.pandasoftware.com/activescan/de/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 197:  //Uruguay
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					case 201: //Venezuela
						window.open("http://www.pandasoftware.es/activescan/es/default.asp?IdVendor="+IdVendor+"&IdLang="+IdLang+"&IdPais="+IdPais,"ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
					break;
					default:  //inglés
						window.open("http://www.pandasoftware.com/activescan/com/default.asp?IdVendor=1&IdLang=2&IdPais=63", "ASAnalisis","height=335,width=539,status=yes,toolbar=no,menubar=no,location=no",true);
				}
			}

function get_opciones_1245(opcion_id) { 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1245&id_opcion='+opcion_id,'encuesta_1245','width=250,height=150');
} 

function get_opciones_1254(opcion_id) { 
    window.open('http://www.tech-marketresearch.com/miniencuestas/briefing.php?id=1254&id_opcion='+opcion_id,'encuesta_1254','width=250,height=150');
} 

function validar_leads()
 {	
 	 var x;
	 var obli;
	 var myType;
	 var colForms = document.forms	 

	 for (x=0;x!=document.f1.length;x++)
	 {	 
	 	if (document.f1.elements[x].type!="hidden")
		{
			if (navigator.userAgent.indexOf("Netscape6")!= -1)
			{
				obli=document.f1.elements[x].getAttribute("obligar");
				msg=document.f1.elements[x].getAttribute("msg");
			}
			else 	{ obli=document.f1.elements[x].obligar;
					  msg=document.f1.elements[x].msg;
					 }

			myType = document.f1.elements[x].type;
			myType = myType.toLowerCase();
			if (myType=="text")
			{
				if (!Campo_blanco(document.f1.elements[x].value, document.f1.elements[x].name, obli, msg))
				{ 	document.f1.elements[x].focus();
					return false;
				}
				else document.f1.submit();
			} else {
				if ((myType=="select-one" || myType=="select") && !(document.f1.elements[x].disabled))
				{
		 			if (!Campo_blanco(window.document.f1.elements[x].options[window.document.f1.elements[x].selectedIndex].value,
						document.f1.elements[x].name, obli, msg))
						{
							document.f1.elements[x].focus();
							return false;
						}
						else document.f1.submit();
				}

			}
		}
	 }
  }
  
  function Campo_blanco(vcampo, ncampo, vacioSI, aMSG)
{	
	var tamano;
	var x;
	var campoOK;
	tamano = vcampo.length;
	
	//Test for mail file.
	myFile = ncampo.toLowerCase();
	if (myFile.indexOf("mail")!=-1)
	{
		if (emailOK(vcampo)) 
		{
			return true;		
		}
		else 
		{
			alert (nFile1 + aMSG + nFile2);
			return false;
		}
	} 
	// Comprobar si el valor del campo esta rellenado con blancos, o no ha sido rellenado.
	if (tamano>0)
	{
		for (x=0;x<=tamano-1;x++) 
		{			
			if (vcampo.charAt(x)==" ")
			{
				campoOK=false;
				return false;
			} else
			{
				return true;
			}			
		}
	}
	else
	{ 
		if (vacioSI=="True")
		{
			campoOK=false;
		} else 
		{
			campoOK=true
		}
	
	}
		
	// Mostrar mensaje de error.
	if (campoOK==false) 
	{
		alert (nFile1 + aMSG + nFile2);
		return false;
	} else { return true; }	
		
}

function emailOK(email)
{
	var regMailInvalido = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // No valida
	var regMailvalido = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; // Valida
		
	if (! ((!regMailInvalido.test(email) && regMailvalido.test(email) ) ) )
    	{

		return false;
    	}  
    return true;
}
		
function multimedia(animacion)
{
	if (animacion==null)
	{
		window.open('http://www.pandasoftware.es/incCMS/Flash/ES/PavASP.html','multimedia','width=640,height=520,top=100');
	}

 window.open(animacion,'multimedia','width=550,height=430,top=100');
}	

function EnviarCorreoEntorno()
	{
	  var texto;
	  texto = location.href;
	  window.open('http://www.pandasoftware.es/send.asp?SubjectMail='+ URLEncodeClientCorreo(SubjectMail) + '&texto=' + URLEncodeClientCorreo(texto), 'Enviar_a_un_amigo', 'resizable=no,width=296,height=368,left=0, top=0');
	}
	
function URLEncodeClientCorreo(texto)
	{
	        var re;
	 
	        texto = texto.replace(/xE9/g, "%E9");
	        texto = texto.replace(/xED/g, "%ED");
	        texto = texto.replace(/xF3/g, "%F3");
	        texto = texto.replace(/xFA/g, "%FA");
	        texto = texto.replace(/xC1/g, "%C1");
	        texto = texto.replace(/xC9/g, "%C9");
	        texto = texto.replace(/xCD/g, "%CD");
	        texto = texto.replace(/xD3/g, "%D3");
	        texto = texto.replace(/xDA/g, "%DA");
	        texto = texto.replace(/xA1/g, "%A1");
	        texto = texto.replace(/xBF/g, "%BF");
	        texto = texto.replace(/xF1/g, "%F1");
	        texto = texto.replace(/xD1/g, "%D1");
	 
	        re= new RegExp("\"","g");
	        texto = texto.replace(re, "%22");
	        re= new RegExp("'","g");
	        texto = texto.replace(re, "%27");
	        re= new RegExp("&","g");
	        texto = texto.replace(re, "%26");
	        re= new RegExp("/","g");
	        texto = texto.replace(re, "%2F");
	        texto = texto.replace(/\\/g, "%5C");
	        return (texto);
}
