function viewLayer(id){
  this.hidePubAndSWF();

  this.oMask = document.getElementById("alphalayer");
  this.oMask.style.height = document.documentElement.scrollHeight + "px";
  this.oMask.style.width = document.documentElement.scrollWidth + "px";  
  this.oMask.style.visibility = "visible";
  this.oMask.style.display = "";
  
	oMsgBox = document.getElementById(id);	
	try{
		if(navigator.appName.indexOf("Microsoft") != -1){
			if(typeof document.body.style.maxHeight != "undefined"){
				//explorer 7
				oMsgBox.style.left = Math.floor((( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) - 432)/2) + "px";
				oMsgBox.style.top = 100 + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + "px";		
			}else{
				oMsgBox.style.left = Math.floor((( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth )-432)/2) + "px";
				oMsgBox.style.top = 100 + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + "px";	
			}
		}else{
			oMsgBox.style.left = Math.floor((( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) - 432)/2) + "px";
			oMsgBox.style.top = 100 + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) + "px";		
		}
	}catch(ee){ }

	oMsgBox.style.visibility = "visible";
	oMsgBox.style.display = "block";
	document.getElementById("motivo").focus();
}        

function closeLayer(id){
  this.showPubAndSWF();
  
	this.oMask = document.getElementById("alphalayer");

	this.oMask.style.visibility = "hidden";
  this.oMask.style.display = "none";

	document.getElementById(id).style.visibility = "hidden";
	document.getElementById(id).style.display = "none";
}       

function showConditions(link_url){  
  window.open(link_url, "", "width=" + screen.availWidth +",height=" + screen.availHeight +",resizable=no,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no");  
  
  return false; 
}

function hidePubAndSWF(){  
  var divs = document.getElementsByTagName("div");
  
  for (var i=0;i<divs.length;i++){
    if (divs[i].className.indexOf("banner")>=0||divs[i].className.indexOf("roba")>=0||divs[i].className.indexOf("video")>=0){
      divs[i].style.visibility="hidden";
    }
  }  
}

function showPubAndSWF(){  
  var divs = document.getElementsByTagName("div");
    
  for (var i=0;i<divs.length;i++){
    if (divs[i].className.indexOf("banner")>=0||divs[i].className.indexOf("roba")>=0||divs[i].className.indexOf("video")>=0){
      divs[i].style.visibility="visible";
    }
  }
}

function subscribeBulletin(){
	var mail=document.formu.mail.value;	
	if (mail == ""){ 
    document.getElementById("error_mail").innerHTML = "<font color='red'>introduce un email</font>"; return false; 
  }
  else{
  	//Los datos no son vacios, compruebo que sean válidos
  	//Compruebo que compruebo que el correo sea correcto
  	var reg_exp_email = new RegExp('^([A-z, 0-9]+|[A-z, 0-9][A-z, 0-9, \\., \\-,\\+]*[A-z, 0-9])'+'@'+'([A-z, 0-9]+|[A-z, 0-9][A-z, 0-9, \\.,\\-]*[A-z, 0-9])'+'\\.'+'([A-z]+|[A-z]+[A-z\.]+[A-z]+)$', 'i');
  	if (mail.match(reg_exp_email) == null){
  	  document.getElementById("error_mail").innerHTML = "<font color='red'>introduce un email correcto</font>";
  	  return false;	  
  	}
  	else{
  	  document.getElementById("error_mail").innerHTML = "";
    }
  }
    document.formu.submit();
}


