// JavaScript Document
dayName = new Array ("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "S&aacute;bado")
nonName = new Array ("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre","Octubre","Noviembre","Diciembre")
now = new Date
  function get_fecha() {
  document.write("" + dayName[now.getDay()]+ ", "+ now.getDate()+ " de " + nonName[now.getMonth()]+ " de " + now.getFullYear())
  }
  
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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


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_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

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 checkIt(string){
	var detect = navigator.userAgent.toLowerCase();
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
	}
	
function resizeContentFrame() {
	if (checkIt('opera')){
		document.getElementById("contentFrame").height = document.getElementById("contentFrame").document.body.scrollHeight;
 		}
 	document.getElementById("contentFrame").height = document.getElementById("contentFrame").contentWindow.document.body.scrollHeight;
	}

function getPage(id, act) {
	document.getElementById("pageAnt").value = document.getElementById("pageId").value;
	document.getElementById("pageId").value = id;
	document.getElementById("pageAction").value = act;
	document.getElementById("pageSection").value = 0;	
	document.getElementById("pageTemplate").value = 0;
	//document.images.logme.src = 'logme.asp?'+id;
	document.getElementById("parser").submit();
}

/*function getMediaPage(id, act,mediaType) {
	document.parser.pageId.value = 800;
	document.parser.pageMediaId.value = id;
	document.parser.pageMediaType.value = mediaType;
	document.parser.pageAction.value = act;
	document.parser.pageSection.value = 0;	
	document.parser.pageTemplate.value = 0;
	document.parser.submit();
}*/

function getSearch(id, act) {
	document.getElementById("pageSearch").value = document.getElementById("searchPara").value
	document.getElementById("searchPara").value = ""
	document.getElementById("pageId").value = id;
	document.getElementById("pageAction").value = act;
	document.getElementById("pageTemplate").value = 0;
	document.getElementById("pageSection").value = 0;
	document.getElementById("parser").submit();	
}

function addPage(templ, sec, act) {
	document.getElementById('pageTemplate').value = templ
	document.getElementById('pageId').value = 0;
	document.getElementById('pageAction').value = act;
	document.getElementById('pageSection').value = sec;	
	document.getElementById('parser').submit();
}	
//-------------------------------------------------------------------------------
/*function setMenuLtr(menuNum) {
	if (document.getElementById('navLtr').value == 0 && menuNum == 0) { 
		document.getElementById('menuLtr').innerHTML = menuLtr[1];
		document.getElementById('navLtr').value = 1;
		}
		
	if (document.getElementById('navLtr').value != menuNum && menuNum != 0) { 
		document.getElementById('menuLtr').innerHTML = menuLtr[menuNum];
		document.getElementById('navLtr').value = menuNum;
		}
	}
	
function setMenuInf(menuNum) {
	if (document.getElementById('navFoot').value == 0 && menuNum == 0) { 
		document.getElementById('menuInf').innerHTML = menuLtr[1];
		document.getElementById('navFoot').value = 1;
		}
	
	if (document.getElementById('navFoot').value != menuNum && menuNum != 0) { 
		document.getElementById('menuInf').innerHTML = menuInf[menuNum];
		document.getElementById('navFoot').value = menuNum;
		}
	}*/

function setMediaTool(menuId) {
	document.getElementById('mediaControl').innerHTML = media[menuId];
	document.getElementById('mediaStatus').value = 0;
	}
	
function setMediaIcon(iconAction, iconId, pageId) {
	var mediaIcon = new Array();
	var iconSource = new Array();
	var mediaElement = new Array();
	var mediaLayer = new Array();
	var iconHTML = new Array()
	
	mediaIcon[1] = "mediaAudio"
	mediaIcon[2] = "mediaVideo"
	mediaIcon[3] = "mediaImagen"
	mediaIcon[4] = "mediaPdf"
	
	iconSource[1] = "images/media/audio.gif"
	iconSource[2] = "images/media/video.gif"
	iconSource[3] = "images/media/imagen.gif"
	iconSource[4] = "images/media/pdf.gif"
	
	mediaElement[1] = "audio"
	mediaElement[2] = "video"
	mediaElement[3] = "imagen"
	mediaElement[4] = "pdf"
	
	mediaLayer[1] = "audioLayer"
	mediaLayer[2] = "videoLayer"
	mediaLayer[3] = "imagenLayer"
	mediaLayer[4] = "pdfLayer"
	
	if (document.getElementById('mediaStatus').value == 0) {
		setMediaTool(1);
		document.getElementById('mediaStatus').value = 1;
		}
	
	iconHTML[0]= "<img src=Partido%20Popular%20Indes_archivos//%22images/media/%22+mediaElement%5BiconId%5D+%22.gif/%22 alt=\""+mediaElement[iconId]+"\" name=\""+mediaIcon[iconId]+"\" height=\"21\" border=\"0\" id=\""+mediaIcon[iconId]+"\" />"	
		
	iconHTML[1] = "<a href=\"javascript:MM_openBrWindow('mod/mod_media/showmedia.asp?pid="+pageId+"&media="+iconId+"','media','width=550,height=400,scrollbars=yes')\" onmouseout=\"MM_swapImgRestore();MM_nbGroup('out')\" onmouseover=\"MM_swapImage('espect','','images/media/espect_"+mediaElement[iconId]+".gif',0);MM_nbGroup('over','"+mediaIcon[iconId]+"','images/media/"+mediaElement[iconId]+"_roll.gif','images/media/"+mediaElement[iconId]+".gif',1);\"><img src=Partido%20Popular%20Indes_archivos//%22images/media/%22+mediaElement%5BiconId%5D+%22_act.gif/%22 alt=\""+mediaElement[iconId]+"\" name=\""+mediaIcon[iconId]+"\" height=\"21\" border=\"0\" id=\""+mediaIcon[iconId]+"\" /></a>"	
	
	
	document.getElementById(mediaLayer[iconId]).innerHTML = iconHTML[iconAction];
	
	}
function setMailLayer(pageId) {
	mailLayerHtml = "<a href=\"javascript:MM_openBrWindow('mod/mod_contact/mod_contact_0.asp?pid="+pageId+"','contacto','width=580,height=475')\" onmouseout=\"MM_swapImgRestore();MM_nbGroup('out')\" onmouseover=\"MM_nbGroup('over','mediaMail','images/media/mail_roll.gif','images/media/mail.gif',1);MM_swapImage('espect','','images/media/espect_mail.gif',1)\"><img src=Partido%20Popular%20Indes_archivos//%22images/media/mail_act.gif/%22 alt=\"Contactar\" name=\"mediaMail\" height=\"21\" border=\"0\" id=\"mediaMail\" /></a>"
	document.getElementById('mailLayer').innerHTML = mailLayerHtml;
}
function setSec(sec) {
		document.getElementById('pageSection').value = sec;
}

function preloadImages() {
/*
	MM_preloadImages('images/media/mail.gif');
	MM_preloadImages('images/media/mail_roll.gif');
	MM_preloadImages('images/media/mail_act.gif');
	
	MM_preloadImages('images/media/audio.gif');
	MM_preloadImages('images/media/audio_roll.gif');
	MM_preloadImages('images/media/audio_act.gif');
	
	MM_preloadImages('images/media/video.gif');
	MM_preloadImages('images/media/video_roll.gif');
	MM_preloadImages('images/media/video_act.gif');
	
	MM_preloadImages('images/media/imagen.gif');
	MM_preloadImages('images/media/imagen_roll.gif');
	MM_preloadImages('images/media/imagen_act.gif');
	
	MM_preloadImages('images/media/pdf.gif');
	MM_preloadImages('images/media/pdf_roll.gif');
	MM_preloadImages('images/media/pdf_act.gif');
	
	MM_preloadImages('images/media/impres.gif');
	MM_preloadImages('images/media/impres_roll.gif');
	MM_preloadImages('images/media/impres_act.gif');
	
	MM_preloadImages('images/media/lat.gif');
	MM_preloadImages('images/media/enun.gif');
	MM_preloadImages('images/media/espect.gif');
	MM_preloadImages('images/media/espect_audio.gif');
	MM_preloadImages('images/media/espect_video.gif');
	MM_preloadImages('images/media/espect_imagen.gif');
	MM_preloadImages('images/media/espect_pdf.gif');
	MM_preloadImages('images/media/espect_impres.gif');
	MM_preloadImages('images/media/espect_mail.gif');
*/	
MM_preloadImages('images/bot-in.jpg');
MM_preloadImages('images/ucab2.jpg');
MM_preloadImages('images/fondo(1).jpg');
MM_preloadImages('images/00.jpg');
MM_preloadImages('images/afiliate.jpg');
MM_preloadImages('images/foro.jpg');
MM_preloadImages('images/fondo.jpg');

}
// Funciones de comprobación
content="<%= ID%>";
useIndx=0;
use100=0;
usoBat=0;
use110=0;
useGral=0;
useCongr=0;
useInmem=0;
useNoti=0;
useDisc=0;
useent=0;
useSede=0;
usegest=0;
usecom=0;
function comprobar (pid, act) {
	var error;
	error='ERRORES\n';
	if ((act == 1) || (act == 3)) {
		if (useIndx == 1 ) {
			error=check_index(error);
			}
		if (use100 == 1) {
			error=check_title(error);
			}
		if (usoBat == 1) {
			error=check_bat(error);
			}
		if (useent == 1) {
			error=check_ent(error);
			}
		if (useGral == 1) {
			error=check_gral(error);
			}
		if (useCongr == 1) {
			error=check_congr(error);
			}
		if (useInmem == 1) {	
			error=check_inmem(error);
			}
		if (useNoti == 1) {
			error=check_noti(error);
			}
		if (useDisc == 1) {
			error=check_disc(error);
			}
		if (useSede == 1) {
			error=check_sede(error);
			}
		if (usegest == 1) {
			error=check_gest(error);
			}
		if (usecom == 1) {
			error=check_com(error);
			}
		if ( error.length < 20) {
			document.getElementById('parserForm').submit();
			} else { 
			alert (error);
			}
		}
	}
function isDate(obj) {
 	var date_regex = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
	 if (!date_regex.test(obj.value)) {
	  	return 1;
 		} else {
		return 0;
		}
	}

function check_com (error) {
	cont=0;
	if (document.getElementById('indx_cargo_com').value.length == 0) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Comité Ejecutivo:\n";
			}
		error=error+"     Debe introducir el cargo del miembro\n";
		}
	if (document.getElementById('indx_nom_com').value.length == 0) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Comité Ejecutivo:\n";
			}
		error=error+"     Debe introducir el nombre del miembro\n";
		}
	if (document.getElementById('indx_cargo_com').value.length > 150) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Comité Ejecutivo:\n";
			}
		error=error+"     El cargo del miembro no puede superar los 150 carácteres\n";
		}
	if (document.getElementById('indx_nom_com').value.length > 500) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Comité Ejecutivo:\n";
			}
		error=error+"     El nombre del miembro no puede superar los 500 carácteres\n";
		}
	return error;
	}
	
function check_gest (error) {
	cont=0;
	if (document.getElementById('ccaa').value == 0) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Gestión Pública:\n";
			}
		error=error+"     Debe seleccionar la Comunidad Autónoma\n";
		}
	if (document.getElementById('indx_autor_gest').value.length == 0) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Gestión Pública:\n";
			}
		error=error+"     Debe introducir el nombre del autor\n";
		}
	if (document.getElementById('indx_tema_gest').value.length == 0) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Gestión Pública:\n";
			}
		error=error+"     Debe introducir el tema\n";
		}
	if (document.getElementById('indx_autor_gest').value.length > 500) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Gestión Pública:\n";
			}
		error=error+"     El nombre del autor no debe superar los 500 carácteres\n";
		}
	if (document.getElementById('indx_tema_gest').value.length > 500) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Gestión Pública:\n";
			}
		error=error+"     El tema no puede superar los 500 carácteres\n";
		}
	return error;
	}	
	
function check_sede (error) {
	cont=0;
	if (document.getElementById('ccaa').value == 0 && document.getElementById('prov').value == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Sedes:\n";
			}
		error=error+"     Debe seleccionar el tipo de sede\n";
		}
	if (document.getElementById('indx_resp_sede').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Sedes:\n";
			}
		error=error+"     Debe introducir el nombre del responsable de la sede\n";
		}
	if (document.getElementById('indx_resp_sede').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Sedes:\n";
			}
		error=error+"     El nombre del responsable no puede superar los 500 carácteres\n";
		}
	return error;
	}	
	
	
function check_ent (error) {
	cont=0;
	if (document.getElementById('ccaa').value == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades locales:\n";
			}
		error=error+"     Debe seleccionar una Comunidad Autónoma\n";
		}
	if (document.getElementById('prov').value == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades locales:\n";
			}
		error=error+"     Debe seleccionar una Provincia\n";
		}
	if (document.getElementById('loc').value == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades locales:\n";
			}
		error=error+"     Debe seleccionar una Localidad\n";
		}		
	if (document.getElementById('ent').value == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades locales:\n";
			}
		error=error+"     Debe seleccionar el tipo de entidad\n";
		}		
	if (document.getElementById('resp').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades Locales:\n";
			}
		error=error+"     El nombre del responsable no puede superar los 500 carácteres\n";
		}
	if (document.getElementById('resp').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Entidades Locales:\n";
			}
		error=error+"     El nombre del responsable no puede estar vacío\n";
		}	
		return error;
}

function check_disc (error) {
	cont=0;
	if (document.getElementById('indx_desc_disc').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Discursos, Articulos, Entrevistas:\n";
			}
		error=error+"     La descripción no puede estar vacía\n";
		}
	if (document.getElementById('indx_desc_disc').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Discursos, Articulos, Entrevistas:\n";
			}
		error=error+"     La descripción no puede superar los 500 carácteres\n";
		}
	if (document.getElementById('indx_autor_disc').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Discursos, Articulos, Entrevistas:\n";
			}
		error=error+"     El nombre del autor no puede estar vacío\n";
		}
	if (document.getElementById('indx_autor_disc').value.length > 150 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Discursos, Articulos, Entrevistas:\n";
			}
		error=error+"     El nombre del autor no puede superar los 150 carácteres\n";
		}
	if (isDate(document.getElementById('indx_date_disc')) == 1) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Discursos, Articulos, Entrevistas:\n";
			}
		error=error+"     Formato de fecha incorrecto\n";
		}
	return error;
}

function check_noti (error) {
	cont=0;
	if (document.getElementById('indx_desc_noti').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Noticias:\n";
			}
		error=error+"     El subtítulo de la noticia no puede superar los 500 carácteres\n";
		}
	if (isDate(document.getElementById('indx_date_noti')) == 1) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Noticias:\n";
			}
		error=error+"     Formato de fecha incorrecto\n";
		}
	return error;
}

function check_inmem (error) {
	cont=0;
	if (document.getElementById('indx_desc_inmem').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex In Memoriam:\n";
			}
		error=error+"     La descripción no puede estar vacía\n";
		}
	if (document.getElementById('indx_desc_inmem').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex In Memoriam:\n";
			}
		error=error+"     La descripción no puede superar los 500 carácteres\n";
		}
	return error;
}

function check_congr (error) {
	cont=0;
	if (document.getElementById('indx_desc_congr').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Congresos:\n";
			}
		error=error+"     La descripción del congreso no puede estar vacía\n";
		}
	if (document.getElementById('indx_desc_congr').value.length > 500 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Congresos:\n";
			}
		error=error+"     La descripción del congreso no puede superar los 500 carácteres\n";
		}
	if (document.getElementById('indx_president_congr').value.length == 0 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Congresos:\n";
			}
		error=error+"     El nombre del presidente electo no puede estar vacío\n";
		}
	if (document.getElementById('indx_president_congr').value.length > 250 ) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Congresos:\n";
			}
		error=error+"     El nombre del presidente electo no superar los 250 carácteres\n";
		}
	if (isDate(document.getElementById('indx_date_congr')) == 1) {
		cont=cont+1;
		if (cont==1) {
			error=error+"Subindex Congresos:\n";
			}
		error=error+"     Formato de fecha incorrecto\n";
		}
	return error;
}

function check_gral (error) {
	cont=0;
	if (document.getElementById('indx_desc_gral').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Subindex general:\n";
			}
		error=error+"     La descripción del subindex no puede estar vacía.\n";
		}
	if (document.getElementById('indx_desc_gral').value.length > 500) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Subindex general:\n";
			}
		error=error+"     La descripción del subindex no puede superar los 500 carácteres.\n";
		}
	return error;
	}

function check_110 (error) {
	cont=0;
	if (document.getElementById('cont_html_110').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Texto HTML con Imagen:\n"
			}
		error=error+"     El contenido de la página no puede estar vacío.\n";
		}
	if (document.getElementById('cont_html_110').value.length > 8000) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Texto HTML con Imagen:\n"
			}
		error=error+"     El contenido de la página no puede superar los 8000 carácteres\n";
		}
	return error;
	}
	
function check_bat (error) {
	cont=0;
	if (document.getElementById('mod_bat_name').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Batería de imagenes:\n"
			}
		error=error+"     El nombre de la batería no puede estar vacío\n";
		}
	if (document.getElementById('mod_bat_name').value.length > 500) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Batería de imagenes:\n"
			}
		error=error+"     El nombre de la bateria no puede superar los 500 carácteres\n";
		}
	for (i=1; i<=5; i++) {
		if (document.getElementById('bat_img'+i).value == 0) {
			cont=cont+1;
			if (cont == 1) {
				error=error+"Batería de imagenes:\n"
				}
			error=error+"     La imagen número "+i+" de la batería no puede estar vacía\n";
			}
		}
	return error;
}

function check_index (error) {
	cont=0;
	if (document.getElementById('indx_title').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Index general de la página:\n"
			}
		error=error+"     El titulo de la página no puede estar vacío\n";
		}
	if (document.getElementById('indx_title').value.length > 250) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Index general de la página:\n"
			}
		error=error+"     El titulo de la página no puede superar los 250 caracteres\n";
		}
	if (document.getElementById('indx_desc').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Index general de la página:\n"
			}
		error=error+"     La descripción de la página no puede estar vacía\n";
		}
	if (document.getElementById('indx_desc').value.length > 500) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Index general de la página:\n"
			}
		error=error+"     La descripción de la página no puede superar los 500 carácteres\n";
		}
	if (document.getElementById('indx_meta').value.length > 1000) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Index general de la página:\n"
			}
		error=error+"     El campo Meta no puede superar los 1000 carácteres\n";
		}
	return error;
	}

function check_title (error) {
	cont=0;
	if (document.getElementById('cont_html_100').value.length == 0) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Título:\n"
			}
		error=error+"     El título no puede estar vacío\n";
		}
	if (document.getElementById('cont_html_100').value.length > 500) {
		cont=cont+1;
		if (cont == 1) {
			error=error+"Título:\n"
			}
		error=error+"     El título no puede superar los 500 carácteres\n";
		}
	return error;
	}
	
function addBookmark()
{
  if (window.external)
    external.AddFavorite("http://www.pp.es", "www.pp.es")
  else
	alert("Su navegador no soporta esta caracteristica");
}

function CapturaTecla(e) {
	var tecla;
	/*if(document.all)
		tecla=event.keyCode;
	else {
		tecla=e.which; 
	}*/
	var code; 
	if(document.all) code = event.keyCode; 
	else code = e.which;
	if(code==13) {
		//alert('si');
		getSearch(200,0);
	}
	return true;
} 