
function getCookie(name){
  cookie = " "+document.cookie;
  offset = cookie.indexOf(" "+name+"=");

  if (offset == -1) return undefined;

  offset += name.length+2;
  end     = cookie.indexOf(";", offset)

  if (end == -1) end = cookie.length;

  return unescape(cookie.substring(offset, end));
}



function validar(){
	//alert(getCookie("idi"));
	if (document.correo.nombre.value=='' || document.correo.email.value=='' || document.correo.mensaje.value=='')	{
		//alert( (getCookie("idi")==0) ? 'Por favor, rellene los campos obligatorios' : 'Por favor, cubra os campos obrigatorios');
		alert('Por favor, rellene los campos obligatorios');
		return 0;
	}
	else return 1; 
}


function changeImage(name,ImgName){ document.images[name].src = ImgName; }



function getParam(t){
	//alert(t);
	var params='?params=1&';
	for(var i=0; i<t.elements.length; i++){
		alert(t.elements[i].value);
		if (t.elements[i].value!="undefined") params+=t.elements[i].name+'='+t.elements[i].value+'&';
	}
		return params;
}

/* quita borde punteado de los links ---------------------------------------------------------------------------*/
function noplink() {
	lnks=document.getElementsByTagName("a").length;
	for (i=0;i<lnks;i++)
	document.getElementsByTagName("a").item(i).onfocus=new Function(" (this.blur)?this.blur():NULL;")
}


function itemMenu(itm){
	//alert(itm.className);
	for(i=1; document.getElementById('itm'+i); i++) if (document.getElementById('itm'+i).className=='item') document.getElementById('itm'+i).className='menu';
	itm.className='item';

}




/* ajusta la altura de la capa principal al contenido ---------------------------------------------------------------------------*/
function hifr(kp, limite, ifr) {
	var altura=(kp.offsetHeight>limite)?kp.offsetHeight:limite;
	//alert(altura);
	//alert(ifr.style.height);
	ifr.style.height=(altura+50)+'px';
}


function imgPreloader(vct){ for (var i in vct){ var img = new Image(); img.src=vct[i]; } }


function fMiCuenta(){
	parent.document.getElementById('bloque3_3').innerHTML='<p style="margin:0px 0 0 15px; border:0px solid #ccc; width:150px; height:50px; text-align:right; "><a href="admin"><img src="img/update2.jpg" /></a></p>'; 
}



function lm(){
	document.getElementById('lermais').style.display='block';
	document.getElementById('pl').style.display='none';
}













