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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=m_findobj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una dirección de correo electrónico.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' debe contener un número entre '+min+' y '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es un campo necesario.\n'; }
  } if (errors) alert('Por favor revise los siguientes campos:\n'+errors);
	else document.contacta.submit();
  
}
//a partir de aqui navegador
var navegador;
navegador=navigator.appName;

if ((navegador== "Netscape")){
 document.write ('<LINK REL="StyleSheet" TYPE="text/css" HREF="/frameworks/estilos_nt.css">');
}else{
 document.write ('<LINK REL="StyleSheet" TYPE="text/css" HREF="/frameworks/estilos.css">');
}



var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printpage() {
  if (pr) { // NS4, IE5
    window.print();
  } else if (da && !mac) { // IE4 (Windows)
      setTimeout("vbPrintPage()", 100);
  } else { // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  }
}
if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

function opensendpage(page){
	   var s= '/envio.jsp?url=' + page;
	   var nombre='ENVIO';
	   var features='height=330,width=405,menubar=no,toolbar=no';   
	   window.open(s,nombre,features);
}

function contacta(){
	   var s= '/contacta.jsp';
	   var nombre='CONTACTA';
	   var features='height=290,width=405,menubar=no,toolbar=no';   
	   window.open(s,nombre,features);
}

function SetCookie(name, value, expire) {
	document.cookie = name + "=" + escape(value) +";path=/"+ ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}


function GetCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0) { // if there are any cookies
		offset = document.cookie.indexOf(search) 
		if (offset != -1) { // if cookie exists 
			offset += search.length 
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset) 
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		} 
	}
}

function actCookie(){
   var leido = GetCookie("GQIDSESSION");
   if (leido==null){
	  var hoy = new Date();
	  var valor = hoy.getTime();
	  var caduca = new Date(2020,12,31,0,0,0,0);
   	  SetCookie("GQIDSESSION", valor, caduca)
   }

}


/**************************************************************
	Funcion que quita espacios en blanco
***************************************************************/
function  removeBlanks(theinput)
{
	while (theinput.value.indexOf(" ")==0)
    {theinput.value= theinput.value.slice(1,theinput.value.length); }
    
    if (theinput.value.length!=0){
	  while (theinput.value.lastIndexOf(" ")==theinput.value.length-1)
      { theinput.value= theinput.value.slice(0,theinput.value.length-1); }
    }  
}


actCookie();

function getBannerCode (zone, mode, user, frameWidth, frameHeight) {

		/*Presentación del banner */
				
		if (navigator.appName.indexOf('Netscape') == -1) {
			document.write('<IFRAME WIDTH=' + frameWidth + ' HEIGHT=' + frameHeight + ' MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 ');
			document.write('FRAMEBORDER=0 SCROLLING=no BORDERCOLOR="#000000"');
			document.write('SRC="http://www.condenet.es/adserver/DeliveryEngine/eMarketingEngine.php?id_zone=' + zone + '&id_user=' + user + '&mode=' + mode + '&html=y">');
			document.write("</IFRAME>");
		} else {
			document.write('<SCR'+'IPT LANGUAGE="JavaScript1.1"');
			document.write('SRC="http://www.condenet.es/adserver/DeliveryEngine/eMarketingEngine.php?id_zone=' + zone + '&id_user=' + user + '&mode=' + mode + '&html=n">');
			document.write('</SCR'+'IPT>');	   
		}

	}
function mm_jumpmenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function mm_findobj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
function NewWindow(mypage, myname, w, h, scroll, resizable) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}