<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function FindObj(n,d) {
  return MM_findObj(n,d);
}

function ValidateRequired(){
// Description: Check if a field is not empty (required).
var errormsg='', args=ValidateRequired.arguments, val=FindObj(args[0]);
if (!args[1]) args[1]=val.name;
if (val.value.length < 1){
    errormsg='\n- Το πεδίο "'+args[1]+'" είναι απαραίτητο να συμπληρωθεί.';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateRequired_en(){
// Description: Check if a field is not empty (required).
var errormsg='', args=ValidateRequired_en.arguments, val=FindObj(args[0]);
if (!args[1]) args[1]=val.name;
if (val.value.length < 1){
    errormsg='\n- Field "'+args[1]+'" is required.';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateEmail(){
// Description: Validates an email.
var errormsg='', args=ValidateEmail.arguments, val=FindObj(args[0]);
if (!args[1]) args[1]=val.name;
if (val.value.length<8 || val.value.indexOf('@',0)<1 || val.value.lastIndexOf('.')<val.value.indexOf('@',0)){
    errormsg='\n- Το πεδίο "'+args[1]+'" δεν περιέχει σωστή διεύθυνση ηλεκτρονικού ταχυδρομείου (e-mail).';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateEmail_en(){
// Description: Validates an email.
var errormsg='', args=ValidateEmail_en.arguments, val=FindObj(args[0]);
if (!args[1]) args[1]=val.name;
if (val.value.length<8 || val.value.indexOf('@',0)<1 || val.value.lastIndexOf('.')<val.value.indexOf('@',0)){
    errormsg='\n- Field "'+args[1]+'" is not contain a valid email address.';
	// val.value="";
	// val.focus();
  }
return errormsg;
}


function ValidateMinLength(){
// Description: Check if a field has at least a minimum number of characters.
// Syntax: ValidateMinLength('txtfield','length',['txtfield_name'])
var errormsg='', args=ValidateMinLength.arguments, val=FindObj(args[0]), len=args[1];
if (!args[2]) args[2]=val.name;
if (val.value.length < len){
    errormsg='\n- To πεδίο "'+args[2]+'" πρέπει να έχει ελάχιστο μήκος '+len+' χαρακτήρες.';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateMinLength_en(){
// Description: Check if a field has at least a minimum number of characters.
// Syntax: ValidateMinLength('txtfield','length',['txtfield_name'])
var errormsg='', args=ValidateMinLength_en.arguments, val=FindObj(args[0]), len=args[1];
if (!args[2]) args[2]=val.name;
if (val.value.length < len){
    errormsg='\n- Field "'+args[2]+'" should be at least '+len+' characters long.';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateUCase() {
// Description: Convert a field to Upper Case.
var args,val
args=ValidateUCase.arguments;
val=FindObj(args[0]);
val.value=val.value.replace(/ά/g,'Α');
val.value=val.value.replace(/έ/g,'Ε');
val.value=val.value.replace(/ή/g,'Η');
val.value=val.value.replace(/ί/g,'Ι');
val.value=val.value.replace(/ό/g,'Ο');
val.value=val.value.replace(/ύ/g,'Υ');
val.value=val.value.replace(/ώ/g,'Ω');
val.value=val.value.replace(/’/g,'Α');
val.value=val.value.replace(/Έ/g,'Ε');
val.value=val.value.replace(/Ή/g,'Η');
val.value=val.value.replace(/Ί/g,'Ι');
val.value=val.value.replace(/Ό/g,'Ο');
val.value=val.value.replace(/Ύ/g,'Υ');
val.value=val.value.replace(/Ώ/g,'Ω');
val.value=val.value.replace(/ϊ/g,'Ϊ');
val.value=val.value.replace(/ϋ/g,'Υ');
val.value=val.value.replace(/ΐ/g,'Ϊ');
val.value=val.value.replace(/ΰ/g,'Υ');
val.value=val.value.replace(/ς/g,'Σ');
val.value=val.value.toUpperCase();
return;
}

function ValidateLCase(){
// Description: Convert a field to Lower Case.
// Syntax: ValidateLCase('txtfield')
var args=ValidateLCase.arguments, val=FindObj(args[0]);
val.value=val.value.toLowerCase();
val.value=val.value.replace(/σ /g,'ς ');
val.value=val.value.replace(/σ$/g,'ς');
return;
}

function ValidateContactForm() {
  // Validate Contact Form
  var errormsg='';	
  ValidateUCase('lastname');
  ValidateUCase('firstname');
  ValidateLCase('email');
  errormsg+=ValidateRequired('lastname','Επώνυμο');
  errormsg+=ValidateRequired('firstname','Όνομα');
  errormsg+=ValidateRequired('email','E-mail');
  errormsg+=ValidateEmail('email','E-mail');
  errormsg+=ValidateRequired('message','Μήνυμα');
  if (errormsg) {
    alert('Εμφανίστηκαν τα παρακάτω λάθη:\n'+errormsg); 
    return false;
  }
  else {
    document.forms[0].submit();
    return true;
  }
}


function ValidateContactForm_en() {
  // Validate Contact Form
  var errormsg='';	
  ValidateUCase('lastname');
  ValidateUCase('firstname');
  ValidateLCase('email');
  errormsg+=ValidateRequired_en('lastname','Lastname');
  errormsg+=ValidateRequired_en('firstname','Firstname');
  errormsg+=ValidateRequired_en('email','E-mail');
  errormsg+=ValidateEmail_en('email','E-mail');
  errormsg+=ValidateRequired_en('message','Message');
  if (errormsg) {
    alert('The following errors occured:\n'+errormsg); 
    return false;
  }
  else {
    document.forms[0].submit();
    return true;
  }
}

//-->
