function mode_default(_v) {
		var _a = document.all?document.all.r1.style:document.r1;
		var _b = document.all?document.all.r2.style:document.r2;
		if (_v == 1) {
			_a.visibility="visible";
			_b.visibility="hidden";
		}
		if (_v == 2) {
			_a.visibility="hidden";
			_b.visibility="visible";
		}
	}
	
	function validate_paraggelia_form()
	{
		x=document.paraggelia;
		at=x.email.value.indexOf("@");
		teleia=x.email.value.indexOf(".");
			
		if (document.paraggelia.name.value == '' || document.paraggelia.email.value == ''  || document.paraggelia.addr1.value == '' || document.paraggelia.addr2.value == '' || document.paraggelia.tel.value == '')
		{
			alert ('Παρακαλώ συμπληρώστε όλα τα υποχρωτικά πεδία');
			return false;	
		}
		else if (document.paraggelia.parastatiko[1].checked)
		{
			if (document.paraggelia.job.value == '')
			{
				alert ('Παρακαλώ συμπληρώστε το πεδίο Επάγγελμα');
				return false;
			}
			else if (document.paraggelia.afm.value == '')
			{
				alert ('Παρακαλώ συμπληρώστε το πεδίο Α.Φ.Μ.');
				return false;
			}
			else if (document.paraggelia.doy.value == '')
			{
				alert ('Παρακαλώ συμπληρώστε το πεδίο Δ.Ο.Υ.');
				return false;
			}	
		}
		
		if (at == -1 || teleia == -1)
		{
			alert ('Παρακαλώ συμπληρώστε το πεδίο e-mail με ένα έγκυρο e-mail');
			return false;	
		}

		if(document.paraggelia.group_password_enable.checked) {
			var group_password = document.paraggelia.group_password.value;
			if( (!group_password) || group_password.length != 7 || 
							( ! group_password.match(/[01][0-9]{6}/)) ) {
				alert ('Παρακαλώ δώστε έναν έγκυρο κωδικό μέλους ομάδας ειδικής τιμής');
				return false;
			}
		}
	}

function validate_paraggelia_form_en()
	{
		x=document.paraggelia;
		at=x.email.value.indexOf("@");
		teleia=x.email.value.indexOf(".");
			
		if (document.paraggelia.name.value == '' || document.paraggelia.email.value == ''  || document.paraggelia.addr1.value == '' || document.paraggelia.addr2.value == '' || document.paraggelia.tel.value == '')
		{
			alert ('Please fill all the required fields');
			return false;	
		}
		else if (document.paraggelia.parastatiko[1].checked)
		{
			if (document.paraggelia.job.value == '')
			{
				alert ('Please fill the field Business');
				return false;
			}
			else if (document.paraggelia.afm.value == '')
			{
				alert ('Please fill the field A.F.M.');
				return false;
			}
			else if (document.paraggelia.doy.value == '')
			{
				alert ('Please fill the field D.0.Y.');
				return false;
			}	
		}
		
		if (at == -1 || teleia == -1)
		{
			alert ('Please fill the field Business/Property e-mail with a valid e-mail');
			return false;	
		}	
	}


function Foto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

function enter_email(elem){
	var your_mail = prompt("Email:", ""); 
	if (your_mail == "" || your_mail == " "){ // OK pressed but no text 
		alert("Πρέπει να εισάγετε την ηλεκτρονική σας διεύθυνση."); 
	} 
	else if(your_mail==null){}
	else 
	{
		document.location.href='submit.scr?check=1&email=' + your_mail;
	} 
}

/*function enter_email(){
	popup = window.open('','popup','toolbar=no,menubar=no,width=250,height=150');	
	popup.document.open();
	popup.document.write("<html><head></head><body bgcolor=#CEDBE9>");
	popup.document.write("<form method=post>");
	popup.document.write("<INPUT TYPE=hidden name=enter value=1>");
	popup.document.write("Email:<INPUT type=text name=email>");
	popup.document.write("<input type=submit name=ok value=Είσοδος>");
	popup.document.write("</form>");
	popup.document.write("</body></html>");
	popup.document.close();
}*/