function validarBusqueda()
{
	document.formbuscador.submit();
}

function ValidarSuscripcion()
{
	//alert(document.mySuscription.url.value)
	document.mySuscription.submit();
	window.open('http://www.consumer.es/web/es/includes/thanks_nutricion.html.jsp','thanks','height=300,width=450,toolbar=no,menubar=no,statusbar=no,locationbar=no,resizable=no,directories=no')
}
function ValidarBaja()
{
if (document.mySuscription.Correo_Electronico.value != ' tu email' && document.mySuscription.Correo_Electronico.value) {document.location='http://www.consumaseguridad.com/web/es/boletines/?email=' + document.mySuscription.Correo_Electronico.value; }
}

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_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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.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')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function handleError() // the error-handling function
{
	return true; // required
}

window.error = handleError;

var browserName = navigator.appName;
var browserVersion = parseFloat(navigator.appVersion);

function makeArray() // primitive array declaration hack in Javascript
{
	var args = makeArray.arguments;
	for(var i = 0; i < args.length;i++) {
		this[i] = args[i];
	}
	this.length = args.length;
}

function padZeros(str)
{
	while(str.length < 2)
	str = "0" + str; // duh!
	return str;
}

dow = new makeArray("","","",
"","","","");

mon = new makeArray("Enero","Febrero","Marzo ","Abril","Mayo",
"Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");

function showDateTime() // create date and time display
{
	d = new Date(); // visitor's time
	
	var yr = d.getYear();
	
		
	if(yr < 50) { // JavaScript isn't Y2K compatible, so this hack is necessary
		yr += 2000;
	}
	else if(yr < 1900) {
		yr += 1900;
	}
	// format the display string
	ds = dow[d.getDay()] + d.getDate() + " " + mon[d.getMonth()]
	+ " " + yr;
	
	document.write(ds);
}
function openenvamigo() {
    window.open('/env_amigo.php','PopUp','width=400,height=362,top=0,left=0,toolbar=no,menubar=no,statusbar=no,locationbar=no,resizable=no,directories=no');      
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
