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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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 checkEmail(email) {
  // si se soportan expresiones regulares
  var str=email.value;  
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  
 

  if (!supported)  //si no son soportadas las expresiones regulares 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
  
  return !(!r1.test(str) && r2.test(str));
}*/


function checkEmail(email) {
  
  apos=email.indexOf("@")
  dotpos=email.lastIndexOf(".")
  if (apos<1||dotpos-apos<2){
  	return true;
  }else {
  	return false;
  }
  
 
}



var FSizeOr = 11;
var FSizeDelta = 0;
FSizeDelta = parseInt(getCookie('FSizeDelta'));
if ((isNaN(FSizeDelta)) || (FSizeDelta==null)){
	FSizeDelta = 0;
	setCookie('FSizeDelta', FSizeDelta);
	//alert("no cookie");
}else{
	//alert("FSizeDelta en Cookie: " + FSizeDelta);
}
//alert ("FSize: " + FSize);

function tamanio(delta){
	if (delta == 0) FSizeDelta = 0; // -- Restaurar tamaño --
	if (delta != null) FSizeDelta += parseInt(delta);
	//alert ("Delta: " + delta + " Nuevo tam: " + parseInt(FSizeOr + FSizeDelta) + " Nueva delta: " + FSizeDelta);
	ChangeProp('container','','style.fontSize', parseInt(FSizeOr + FSizeDelta),'SPAN');
	setCookie('FSizeDelta', FSizeDelta);
}

function ChangeProp(objName,x,theProp,theValue) { //v6.0
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function setFontSize(){
	fontSize = getCookie('fontsize');	
	if(fontSize != null){
		tamanio(fontSize);
	}
}
function avisoLegal(idioma){
	window.open('/plain/legal_'+idioma+'.htm','aviso','left=0,top=0,height=400,width=500,scrollbars');
}
function contactar(idioma){
	window.open('/plain/contactar_'+idioma+'.htm','contactar','left=0,top=0,height=230,width=300,scrollbars,status,resizable');
}
function mapa(enlaceMapa, idioma){
	window.open(enlaceMapa + '?lang='+idioma,'mapa','left=0,top=0,height=500,width=510,scrollbars');
}
function enviarEnlace(enlaceEnviarEnlace, id, titulo, idioma){
	window.open(enlaceEnviarEnlace + '?item_id=' + id + '&item_titulo=' + titulo + '&lang=' + idioma,'enviarEnlace','left=0,top=0,height=368,width=590,scrollbars');
}
function imprimir(header, titulo, url, copy){
	//Para NS4
	if (document.layers){
		window.print();
		return;
	}
	
	var ventana = window.open('','imprimir','left=0,top=0,width=780,height=500,scrollbars');	
	var contenido = document.getElementById('contenido').innerHTML;	
	var re = new RegExp ('href=', 'gi') ;
	var contenidoOK = contenido.replace(re, 'target="_blank" href=') ;	
	with (ventana.document) {
	  	open("text/html", "replace");
		writeln('<html><head><title>'+unescape(titulo)+'</title>');
		writeln('<link href="/css/execedEsade.css" rel="stylesheet" type="text/css">');
		writeln('</head><body onLoad="focus()"><div id="containerFloat">');
		writeln ('<div id="copyrightFloatLeft">'+url+'</div>');
		writeln('<div align="right"><a href="#" onClick="window.print();"><img src="img/ico/iconPrint.gif" id="ico_print" name="ico_print" border="0"></a>&nbsp;<a href="#" onClick="window.close();" class="iconTool"><img id="ico_close" name="ico_close" src="img/ico/iconClose.gif"  border="0"></a></div>');
		writeln('<div id="logo"><img src="img/esade/logoEsadePrint.gif" border="0" align="left"/> </div>');
		writeln('<div id="copyright"><img src="img/esade/logoExecutiveEducation.gif" border="0" align="right"/></div><div id="print">');
		writeln (contenidoOK);
		writeln ('</div><BR>');
		writeln ('');
		writeln ('</div></body></html>');
		close();
		}
}

 images = new Array();
 images [0] = "http://exed.esade.edu/repositorio/img/banners/01.jpg";
 images [1] = "http://exed.esade.edu/repositorio/img/banners/02.jpg"; 
 images [2] = "http://exed.esade.edu/repositorio/img/banners/03.jpg";  
 images [3] = "http://exed.esade.edu/repositorio/img/banners/04.jpg";  
 images [4] = "http://exed.esade.edu/repositorio/img/banners/05.jpg";   
 images [5] = "http://exed.esade.edu/repositorio/img/banners/06.jpg";  
 images [6] = "http://exed.esade.edu/repositorio/img/banners/07.jpg";     
 images [7] = "http://exed.esade.edu/repositorio/img/banners/08.jpg";
 images [8] = "http://exed.esade.edu/repositorio/img/banners/09.jpg";     
 images [9] = "http://exed.esade.edu/repositorio/img/banners/10.jpg";
/* images [10] = "/repositorio/img/banners/11.jpg";     
 images [11] = "/repositorio/img/banners/12.jpg";
 images [12] = "/repositorio/img/banners/13.jpg";     
 images [13] = "/repositorio/img/banners/14.jpg";
*/
 imgCl = 0;
function randImage(id, txt){
 imgNum = Math.floor(Math.random() * images.length);
 tag = "<img src=" + images[imgNum]+ " id='" +  id + "' Alt='" + txt + "'>";
 imgCl = setTimeout("timeImage('" + id + "')", 3000);
 if (document.images){
	 document.imagesSrc = new Array();
	 for (i=0; i < images.length; i++){
		 document.imagesSrc [i]=new Image; 
		 document.imagesSrc[i].src=images[i];
	 }
 }
 return tag;

}

 flashArray = new Array();
 flashArray['cas'] = new Array();

 flashArray['cas'][0] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_mad.swf";
 flashArray['cas'][1] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_bcn.swf"; 
 flashArray['cas'][2] = "http://exed.esade.edu/repositorio/Flash/banners/esade_amoraleda_trans.swf";
 flashArray['cas'][3] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jcodina2_trans.swf";
 flashArray['cas'][4] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jcodina_trans.swf";
 flashArray['cas'][5] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jmartull_trans.swf";
 flashArray['cas'][6] = "http://exed.esade.edu/repositorio/Flash/banners/esade_nmolina_trans.swf";
 flashArray['cas'][7] = "http://exed.esade.edu/repositorio/Flash/banners/esade_ssiguero_trans.swf";
 flashArray['cas'][8] = "http://exed.esade.edu/repositorio/Flash/banners/esade_xsellares_trans.swf";
 flashArray['cas'][9] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jmartull2_trans.swf";
 flashArray['cas'][10] = "http://exed.esade.edu/repositorio/Flash/banners/esade_parellano_trans.swf";
 flashArray['cas'][11] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_mad_animado.swf";
 flashArray['cas'][12] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_bcn2.swf";
 flashArray['cas'][13] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_bcn_animado.swf";
 flashArray['cas'][14] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_man2.swf";
 flashArray['cas'][15] = "http://exed.esade.edu/repositorio/Flash/banners/esade_foto_mad2_animado.swf";

 flashArray['home'] = new Array();

/* flashArray['home'][0] = "/repositorio/Flash/banners/home/encabezado1.swf";
 flashArray['home'][1] = "/repositorio/Flash/banners/home/encabezado2.swf";
 flashArray['home'][2] = "/repositorio/Flash/banners/home/encabezado3.swf";*/
 flashArray['home'][0] = "http://exed.esade.edu/repositorio/Flash/banners/home/encabezado4.swf";

 flashArray['eng'] = new Array();
 flashArray['eng'][0] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jmartull_trans_eng.swf";
 flashArray['eng'][1] = "http://exed.esade.edu/repositorio/Flash/banners/esade_jmartull2_trans_eng.swf";  
 
function randFlash(id, lang){
	//if (lang=='cat' || lang=='pt_') 
	lang = 'home';
 	flaNum = Math.floor(Math.random() * flashArray[lang].length);
	return (flashArray[lang][flaNum]);
}

function timeImage(id){
	clearTimeout(imgCl);
	var obj = MM_findObj(id);
	imgNum = Math.floor(Math.random() * images.length);
	obj.style.filter="blendTrans(duration=5)";
    obj.filters.blendTrans(duration=1).Apply();
    obj.filters.blendTrans.Play();
    obj.src=images[imgNum];
	imgCl = setTimeout("timeImage('" + id + "')", 5000);
}

function video(id,file, width, height){
 tag = '<object id="'+id+'" width='+width+' height='+height+' classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..."  type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"><PARAM NAME="ShowControls" VALUE="true"><PARAM NAME="AutoRewind" VALUE="True"><PARAM NAME="AutoStart" VALUE="False"><PARAM NAME="FILENAME" VALUE="'+file+'"></object>';
 document.write (tag);
}

function flash(id,file, width, height){
	tag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+ '" HEIGHT="'+height+'" id="'+id+'" ALIGN=""><PARAM name=wmode value=transparent><PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=quality VALUE=high> <EMBED src="'+file+'" wmode=transparent quality=high   WIDTH="'+width+ '" HEIGHT="'+height+'" name="'+id+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>'
 	document.write (tag);
}

function popUp(enlace,width, height, tipo){
	opciones = 'scrollbars,status,resizable,menubar,toolbar,location';
	if (tipo=="imagen"){
		opciones = "";
	}
	window.open(enlace,'popUp','height='+height+',width='+width+','+ opciones);
}
function checkLogin(form){
	if (form.nick.value == ""){
		alert('Debes introducir tu nombre de usuario');
		form.nick.focus();
		return false;
	}
	else if (form.password.value == ""){
		alert('Debes introducir la contraseña');
		form.password.focus();							
		return false;
	}
	return true;
}
function login(idioma){
	window.open('login.php?lang=' + idioma,'login','height=250,width=490,scrollbars');
}

function accesoItem(idioma)
{
	//window.open('/plain/acceso_'+idioma+'.htm','acceso','height=200,width=500');
	window.open('login.php?lang=' + idioma,'login','height=250,width=490,scrollbars');	
}

function popupCorreo(okerror)
{
	window.open('/plain/correo_'+okerror+'.htm','email','height=200,width=500');
}
function borrar_campo(campo){
if (campo.defaultValue==campo.value)
 campo.value = "";
}

function selectTab(tab)
{
	var i,clase,mostrar;
	for(i=0; i<tabs.length; i++){
		if (tabs[i] == '') return (false);
		//alert ("xx" + tabs[i]+'Title');
		tabs_obj = MM_findObj(tabs[i]+'Title');
		clase = ((i==tab) ? "On":"x");
		//alert (tabs[i]+'Title' + "-> clase:" + clase + " . " + i + " ==? " + tab)
		tabs_obj.className = clase;
		tabsFields_obj = MM_findObj(tabs[i]); 
		/*mostrar = ((i==tab) ? "visible":"hidden");*/
		mostrar = ((i==tab) ? "block":"none")
		tabsFields_obj.style.display = mostrar;
//		tabsFields_obj.style.display = 'block';
		}
		return (false);
}

function muestraBuscador(){
	objBuscador = MM_findObj('buscadorLateral');
	if (objBuscador){
		objBuscador.style.display = (objBuscador.style.display == 'inline') ? 'none' : 'inline';
	}
	return (false);
}

function LTrim(str)
{
  var whitespace = new String(" \t\n\r");
  var s = new String(str);
  if (whitespace.indexOf(s.charAt(0)) != -1) {
    var j=0, i = s.length;
    while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
    j++;
    s = s.substring(j, i);
  }
  return s;
}
function RTrim(str)
{
  var whitespace = new String(" \t\n\r");
  var s = new String(str);
  if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
    var i = s.length - 1;       // Get length of string
    while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
      i--;
    s = s.substring(0, i+1);
  }
  return s;
}
function Trim(str)
{
  return RTrim(LTrim(str));
}

/*function frmValidar(debug){
	alert(debug);
	var campo, error;
	error ="";
	//debug = true;
	if (debug) alert ("in");
	for (campo in valida){
		temp_variable = valida[campo].split(",");
		field 		= temp_variable[0];
		type 		= temp_variable[1];
		tag 		= temp_variable[2];
		if (debug) alert (field);
		if (type!='DMY'){
			obj = MM_findObj(field);
			obj.value = Trim(obj.value);
			valor = obj.value;
		}
		switch (type){
			case "text*":
				if (valor==""){ // vacio
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}
					
			break;
			case "email*":
				if (checkEmail(obj)){ // vacio o error
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}
				
			break;
			case "select*":
				if (valor==""){ // vacio
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}
				
			break;

			case "checkbox*":
				if (valor==""){ // vacio
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}
				
			break;

		default:
		} // switch
	}
	if (error != ""){
	 alert (errorCampo + error)
	 return false;
	 }
	 if (debug) alert ("out");
	 document.forms['form_folleto'].submit;
	 return true;
}*/


function frmValidar(){
	
	
	validacion = new Array();


				
	 			validacion[0] = "DP_NOMBRE,text*,Nombre*";
	 			validacion[1] = "DP_APELLIDO_1,text*,Primer Apellido*";
	 			//validacion[2] = "DP_APELLIDO_2,text*,Segundo Apellido*";
	 			
	 			validacion[2] = "DP_PAIS,select*,País*";
	 			//validacion[4] = "DP_DIRECCION,text,Dirección particular";
	 			//validacion[5] = "DP_CP,text,Código Postal";
	 			//validacion[6] = "DP_POBLACION,text,Población";
	 			validacion[3] = "DP_PROVINCIA,text*,Provincia*";
	 			//validacion[8] = "DP_TELEFONO,text,Teléfono Particular";
	 			
	 			validacion[4] = "DP_MOVIL,text*,Móvil*";
	 			
	 			validacion[5] = "DP_EMAIL,email*,E-mail*";
	 			//validacion[11] = "DPR_EMP_TEL,text,Teléfono Empresa";
	 			validacion[6] = "DPR_EMP_NOM,text*,Empresa*";
	 			//validacion[13] = "DP_NEWSLETTER,select,Desea recibir la Newsletter de Executive Education";
	 			validacion[7] = "DPR_EA_AREAS_EXP_PERSONA,checkbox*,Areas interes*";
	
	
    	

	 			
	var campo, error;
	error ="";
	var errorCampo = "Por favor compruebe el campo:";
	
	var temp_variable;
	var valor;
	for (i=0;i<validacion.length;i++){ 
		temp_variable = validacion[i];
		
		temp_variable = validacion[i].split(",");
		campo 		= temp_variable[0];
		type 		= temp_variable[1];
		tag 		= temp_variable[2];
		
		
		
		switch (type){
			case "text*":
				
				
				
				
				valor=document.getElementById(campo).value;
				if (valor==""){ // vacio
						error = error + " - " + tag + "\n";
					
					}
				
					
			break;
			case "email*":
				
				valor=document.getElementById(campo).value;
				if (checkEmail(valor)){ // vacio o error
						
						error = error + " - " + tag + "\n";
					
				}
				
				
			break;
			case "select*":
			
			        var index=document.getElementById(campo).selectedIndex;
			        
			        /*valor=document.getElementById(campo).options[1].value;
				if (valor==""){ // vacio
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}*/
				if (index==0){ // vacio
				
						error = error + " - " + tag + "\n";
				}
				
			break;

			case "checkbox*":
				valor= false;
				var contador=0;
				for(i=0; i<document.informacion.elements.length; i++){
					if (document.informacion.elements[i].type=='checkbox'){
						
						
						if (document.informacion.elements[i].checked){
							contador=contador+1;
							
						}
					}
				}
				if(contador>0){
					valor=true;
				}
				
			
				if (valor==false){ // vacio
						
						error = error + " - " + tag + "\n";
					
				}
				
			break;

		default:
		} // switch
		
	}
	if (error != ""){
	 	alert(errorCampo + error);
	
	}else{
		if(document.forms["form_folleto"].aceptar.checked==true){
    		
			document.forms["form_folleto"].submit();
		}else{
			alert("Debe aceptar el aviso legal");	
		}
	
	}
	
}



function frmValidar_folleto(){
	
	
	validacion = new Array();


				
	 			validacion[0] = "DP_NOMBRE,text*,Nombre*";
	 			validacion[1] = "DP_APELLIDO_1,text*,Primer Apellido*";
	 			/*validacion[2] = "DP_APELLIDO_2,text*,Segundo Apellido*";
	 			
	 			validacion[3] = "DP_PAIS,country,País";
	 			validacion[4] = "DP_DIRECCION,text,Dirección particular";
	 			validacion[5] = "DP_CP,text,Código Postal";
	 			validacion[6] = "DP_POBLACION,text,Población";
	 			validacion[7] = "DP_PROVINCIA,text,Provincia";
	 			*/
	 			validacion[2] = "DP_TELEFONO,text*,Teléfono*";
	 			/*
	 			validacion[9] = "DP_MOVIL,text,Móvil";
	 			*/
	 			validacion[3] = "DP_EMAIL,email*,E-mail*";
	 			//validacion[11] = "DPR_EMP_TEL,text,Teléfono Empresa";
	 			//validacion[4] = "DPR_EMP_NOM,text*,Empresa*";
	 			//validacion[13] = "DP_NEWSLETTER,select,Desea recibir la Newsletter de Executive Education";
	 			//validacion[5] = "DPR_EA_AREAS_EXP_PERSONA,checkbox*,Areas interes*";
	
	
    	

	 			
	var campo, error;
	error ="";
	var errorCampo = "Por favor compruebe el campo:";
	
	var temp_variable;
	var valor;
	for (i=0;i<validacion.length;i++){ 
		temp_variable = validacion[i];
		
		temp_variable = validacion[i].split(",");
		campo 		= temp_variable[0];
		type 		= temp_variable[1];
		tag 		= temp_variable[2];
		
		
		
		switch (type){
			case "text*":
				
				
				
				
				valor=document.getElementById(campo).value;
				if (valor==""){ // vacio
						error = error + " - " + tag + "\n";
					
					}
				
					
			break;
			case "email*":
				
				valor=document.getElementById(campo).value;
				if (checkEmail(valor)){ // vacio o error
						
						error = error + " - " + tag + "\n";
					
				}
				
				
			break;
			case "select*":
				if (valor==""){ // vacio
						obj.className  = "error";
						error = error + " - " + tag + "\n";
					}else{
						obj.className  = "";
					}
				
			break;

			case "checkbox*":
				valor= false;
				var contador=0;
				for(i=0; i<document.informacion.elements.length; i++){
					if (document.informacion.elements[i].type=='checkbox'){
						
						
						if (document.informacion.elements[i].checked){
							contador=contador+1;
							
						}
					}
				}
				if(contador>0){
					valor=true;
				}
				
			
				if (valor==false){ // vacio
						
						error = error + " - " + tag + "\n";
					
				}
				
			break;

		default:
		} // switch
		
	}
	if (error != ""){
	 	alert(errorCampo + error);
	
	}else{
		if(document.forms["form_folleto"].aceptar.checked==true){
    		
			document.forms["form_folleto"].submit();
		}else{
			alert("Debe aceptar el aviso legal");	
		}
	
	}
	
}






// iFrames
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

function resizeCaller() {
 var dyniframe=new Array()
 for (i=0; i<iframeids.length; i++){
  if (document.getElementById) resizeIframe(iframeids[i])
  //reveal iframe for lower end browsers? (see var above)
  if ((document.all || document.getElementById) && iframehide=="no"){
   var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
   tempobj.style.display="block"
  }
 }
}

function resizeIframe(frameid)
{
 var currentfr=document.getElementById(frameid)

 if (currentfr && !window.opera){
  currentfr.style.display="block"

  try{
   //Valores por defecto
   currentfr.width='100%';
   currentfr.style.left='0px';
   currentfr.style.zIndex=1;
    if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
     currentfr.height = currentfr.contentDocument.body.offsetHeight; 
    else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
     currentfr.height = currentfr.Document.body.scrollHeight;
  }
  catch(e){
   //Cuando el contenido es una pagina externa (TPV) se ha generado una excepcion al acceder al body
	 currentfr.height='700';
	 currentfr.width='100%';
	 currentfr.style.left='-160px';
	 //currentfr.style.position='relative';
	 currentfr.style.zIndex=-1;
  }

  if (currentfr.addEventListener) currentfr.addEventListener("load", readjustIframe, false)
	else if (currentfr.attachEvent){
   currentfr.detachEvent("onload", readjustIframe) // Bug fix line
   currentfr.attachEvent("onload", readjustIframe)
  }
 }
}

function readjustIframe(loadevt) {
 var crossevt=(window.event)? event : loadevt
 var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
 if (iframeroot) resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
 if (document.getElementById) document.getElementById(iframeid).src=url
}

function fill(obj,className){
		//color = (obj.style.backgroundColor == obj.style.borderColor) ? "#FFFFFF" : obj.style.borderColor;
		//color = (color2!='') color2 : "#FFFFFF";
		//obj.style.backgroundColor = color;
		obj.className = className;
}
