
function EnterEvent(VwpURL)
{
    VwpFrame = document.getElementById('iframeevent');
    VwpFrame.style.width="600px";
    VwpFrame.style.height="500px";
    VwpFrame.style.padding="80px";
    VwpFrame.style.visibility="visible";
    VwpFrame.src=VwpURL;
  }

function EnterEvent2(AccURL,VccMacURL){
/* var VccMacFrame = document.createElement("IFRAME");
  	//VccMacFrame.setAttribute("src", VccMacURL);
	  VccMacFrame.setAttribute("frameBorder", 0);
    VccMacFrame.setAttribute("width", 1);
	  VccMacFrame.setAttribute("height", 1);
	  VccMacFrame.setAttribute("scrolling", "no");
	  VccMacFrame.setAttribute("allowTransparency", true);
    VccMacFrame.src=VccMacURL;
    VccMacFrame.style.visibility="visible";
  	document.body.appendChild(VccMacFrame); */
var AccFrame = document.getElementById('iframeevent');
    AccFrame.style.width="600px";
    AccFrame.style.height="500px";
    AccFrame.style.padding="80px";
    AccFrame.style.visibility="visible";
    AccFrame.src=AccURL; 
    /*window.open(AccURL,'miaFinestra','width=600,height=500 ,toolbar=no, location=no,status=yes,menubar=yes,scrollbars=no,resizable=no');  */
}

function clear_field(field){
  if (field.value==field.defaultValue){
        field.value=''
  }
}

function check_field(field){
  if (field.value=='' || field.value==' '){
      field.value=field.defaultValue
  }
}
function validate_form(){
pattern = /^([a-zA-Z\xE0\xE8\xE9\xF9\xF2\xEC\x27]\s?)+$/;   
  if(document.mntvieweb.nome.value=="" || !pattern.test(document.mntvieweb.nome.value)){
    alert('\nNessun Nome inserito o carattere non accettato.')
    document.mntvieweb.nome.select()
    document.mntvieweb.nome.focus()
    return false
  }

  if(document.mntvieweb.cognome.value=="" || !pattern.test(document.mntvieweb.cognome.value)){
    alert('\nNessun Cognome inserito o carattere non accettato.')
    document.mntvieweb.cognome.select()
    document.mntvieweb.cognome.focus()
    return false
  }
  if (document.mntvieweb.email.value==''){
    alert('\nNessun indirizzo email valido.')
    document.mntvieweb.email.select()
    document.mntvieweb.email.focus()
    return false
  }
  if (document.mntvieweb.email.value.indexOf('@',0)==-1 || document.mntvieweb.email.value.indexOf('.',0)==-1){
    alert('\nEmail non valida.')
    document.mntvieweb.email.select()
    document.mntvieweb.email.focus()
    return false
  }
  if(document.mntvieweb.event!=""){
    if(document.mntvieweb.event.type!="hidden"){
      if (document.mntvieweb.event.value==''){
        alert('\nNessun numero evento inserito.')
        document.mntvieweb.event.select()
        document.mntvieweb.event.focus()
        return false
      }
    }
  }
}

function validate_form2(){
  if (document.mntvieweb.email.value.indexOf('@',0)==-1 || document.mntvieweb.email.value.indexOf('.',0)==-1){
    alert('\nEmail non valida.')
    document.mntvieweb.email.select()
    document.mntvieweb.email.focus()
    return false
  }else if(document.mntvieweb.password.value==""){
    alert('\nNessuna password inserita.')
    document.mntvieweb.password.select()
    document.mntvieweb.password.focus()
    return false
  }
}
function Vai(){
var ll = document.createElement("INPUT");
ll.type = "hidden";
ll.name = "ospite";
ll.id = "ospite";
ll.value = "1";
document.mntvieweb.appendChild(ll);
 document.mntvieweb.submit();
}

function ChiediPassword(event,email,nome,cognome){
var PswFrame = parent.document.getElementById('iframeevent');
    PswFrame.style.width="600px";
    PswFrame.style.height="360px";
    PswFrame.style.padding="80px";
    PswFrame.style.visibility="visible";
    PswFrame.src="PswLogin.php?ev="+event+"&email="+email+"&nome="+nome+"&cognome="+cognome;  
}


