function abrirDocumento(iIdDocumento){
      var windowDocumento;
      windowDocumento = window.open("popupdocumento.asp?documento="+iIdDocumento,"Documento","width=600,height=450,top=10,left=10,scrollbars=yes,toolbar=yes,location=yes,menubar=yes,resizable=yes");
}

function abrirPM(MP,MS,MT){
	window.location.href="interior.asp?MP="+MP+"&MS="+MS+"&MT="+MT
}

function verImagen(iIdImagen){
      var windowImagen;
      windowImagen = window.open("popupimagen.asp?imagen="+iIdImagen,"Documento","width=100,height=10,top=10,left=10");
}

function utilidad(valor){

	switch(valor.value){
		case "1":{
		  valor.style.behavior='url(#default#homepage)';
		  valor.setHomePage('http://www.grupomelca.com');
		  focus()
		}
			break;
		case "2":{
		  window.external.AddFavorite('http://www.grupoMelca.com','Portal Web del GrupoMelca');
		  focus()
		}
			break;
		case "3":{
		  window.open("enviarAmigo.asp?","","width=520 height=370 left=25 top=25 scrollbars=yes toolbar=no");
		}
			break;
		default:{}
	}
valor.blur()
}

function favoritos(){
	window.external.AddFavorite('http://www.grupoMelca.com','Portal Web del GrupoMelca');
}

function enviarContenido(iIdContenido){
	//abre un popup pasándole el id del contenido
  var windowa;
  windowa = window.open("enviarContenido.asp?iIdContenido="+iIdContenido,"","width=520 height=370 left=25 top=25 scrollbars=yes toolbar=no");
}

function recomendar(){
	//abre un popup
  var windowa;
  windowa = window.open("enviarAmigo.asp?","","width=520 height=370 left=25 top=25 scrollbars=yes toolbar=no");
}

function imprimirContenido(iIdContenido){
	//abre un popup pasándole el id del contenido
  var windowa;
  windowa = window.open("imprimirContenido.asp?iIdContenido="+iIdContenido,"","width=600 height=500 left=25 top=25 scrollbars=yes toolbar=no");
}

function verImagen(idImagen){
  var windowa;
  windowa = window.open("popupimagen.asp?idImagen="+idImagen,"","width=550 height=390 left=25 top=25 scrollbars=yes toolbar=no");
}

function buscador(){
  var windowa;
  var sValor = document.formBuscar.texto.value;
  if(sValor.length<3) {
  	alert("Debe introducir al menos 3 caracteres")
	
	formBuscar.texto.focus()
	formBuscar.texto.select()
  }
  else  		
  	document.location.href="interior.asp?MP=27&texto="+sValor	
}

function calendario(formulario,campo,tipo,campoCompara)
{

    if (campoCompara != ""){
	    compara = eval("document.forms['"+formulario+"']."+campoCompara+".value")
    } else {
   	   compara = ""
    }
    windowa = window.open('recursos/aplicaciones/fechador.asp?formulario='+formulario+'&campo='+campo+'&tipo='+tipo+'&compara='+compara,'Calendario','top=100,left=200,height=132,width=150');
}

function popupNoticia(idNoticia){
  var windowa;
  windowa = window.open("popupNoticias.asp?idNoticia="+idNoticia,"","width=600 height=340 left=25 top=25 scrollbars=yes toolbar=no");
}

function popupPrensa(idNoticia){
  var windowa;
  windowa = window.open("popupPrensa.asp?idNoticia="+idNoticia,"","width=600 height=340 left=25 top=25 scrollbars=yes toolbar=no");
}

function popupPolitica(){
  var windowa;
  windowa = window.open("popupPolitica.asp","","width=600 height=340 left=25 top=25 scrollbars=yes toolbar=no");
}
function popupLegal(){
  var windowa;
  windowa = window.open("popupLegal.asp","","width=600 height=340 left=25 top=25 scrollbars=yes toolbar=no");
}
function popupContacto(){
  var windowa;
  windowa = window.open("popupContacto.asp","","width=600 height=340 left=25 top=25 scrollbars=yes toolbar=no");
}

function volver() {
	//location..go(-1)
}

function menupersonal()
{
document.location.href="interior.asp"+document.forms['mPersonal'].pMenus[document.forms['mPersonal'].pMenus.selectedIndex].value;
}

function desactivar(){
		document.location.href=location.search + "&desactivar=si";
}

function irAOfertasEmpleo(){
	document.location.href="interior.asp?MP=20"
}

function enviarCorreo(MP){
	document.location.href="interior.asp?MP="+MP+"&TR=A&IDR=13"
}

function submitar(){
		if (document.forms['formPassword'].email.value == "")
		{
			alert("Debe rellenar el campo E-Mail para que le enviemos su password")
		}else
		document.forms['formPassword'].submit()
}

function limpiar(){
	document.forms['formBoletin'].nombre.value="";
	document.forms['formBoletin'].apellidos.value="";
	document.forms['formBoletin'].email.value="";

	document.forms['formBoletin'].empresaParticular[0].checked=false;
	document.forms['formBoletin'].empresaParticular[1].checked=false;

	document.forms['formBoletin'].rSocial.value="";
	document.forms['formBoletin'].cargo[0].selected=true;

	document.forms['formBoletin'].telefono.value="";
	document.forms['formBoletin'].fax.value="";
	document.forms['formBoletin'].url.value="";

	//areas de interés: vacías
	document.forms['formBoletin'].checkbox0.checked = false
	document.forms['formBoletin'].checkbox1.checked = false
	document.forms['formBoletin'].checkbox2.checked = false
	document.forms['formBoletin'].checkbox3.checked = false
	document.forms['formBoletin'].checkbox4.checked = false
	document.forms['formBoletin'].checkbox5.checked = false
	document.forms['formBoletin'].checkbox6.checked = false
	document.forms['formBoletin'].checkbox7.checked = false
	document.forms['formBoletin'].checkbox8.checked = false
	document.forms['formBoletin'].checkbox9.checked = false
	document.forms['formBoletin'].checkbox10.checked = false

	document.forms['formBoletin'].comentarios.value="";

	document.forms['formBoletin'].pprivacidad.checked = false

}

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 CargarContenido(iIdContenido){

 if(location.href.indexOf("IDR")!=-1){
  re1 = new RegExp("IDR=[0-9]*","gi");
  sTexto = location.href.replace(re1,"IDR="+iIdContenido);
 }else{
  sTexto = location.href+"&TR=C&IDR="+iIdContenido;
 }

 location.href=sTexto;

}

function enter(){
	if (navigator.appName=="Microsoft Internet Explorer")
 		if (window.event.keyCode == 13){		
		  		buscador();
		}
}

