function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 2));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie   = (agent.indexOf("msie") != -1);
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
}

var prevm=-1;
var is = new Is();
var layerRef="null", styleSwitch="null";

if(is.ns4) {
	layerRef="document";
	styleSwitch="";
} else if(is.ie4) {
	layerRef="document.all";
	styleSwitch=".style";
}

function showLayer(layerName)
{ eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"'); }

function hideLayer(layerName)
{ eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); }

function hidePopup(m) {
	if (m==1 || m==2 || m==3 || m==4 || m==5) { hideLayer("popup"+m.toString()); }
}

function hideMenu(m) {
	if (is.ie4) {
		
	
	}
}

function showPopup(m) {
	if (m==1 || m==2 || m==3 || m==4 || m==5) { showLayer("popup"+m.toString()); }
}

function showMenu(m) {
	if (is.ie4) {
		
	}
}

function menuover(i) { 
	if (prevm>=0) { 
		hideMenu(prevm); 
		hidePopup(prevm);
	}
	
	showMenu(i);
	showPopup(i);
	prevm=i;

	if (is.ie4) window.event.cancelBubble = true;
}

function popupover(i1,i2) { 
	l=eval(layerRef+'["p'+i1.toString()+i2.toString()+'"]'+styleSwitch);
	if (is.ie4) l.background="#0000FF";
}

function popupout(i1,i2) { 
	l=eval(layerRef+'["p'+i1.toString()+i2.toString()+'"]'+styleSwitch);
	if (is.ie4) l.background="#0000AA";
}

function menuout() {
	if (prevm>=0) { hideMenu(prevm); }

	window.event.cancelBubble = true;
}

function blow() {
	if (prevm>=0) { 
		hideMenu(prevm); 
		hidePopup(prevm);
		prevm=-1;
	}
}

function start()
{
	showLayer('barbas');
}

function none()
{}

function validateMail(){
 
   flag = true
  flag1 = true
  flag2 = true
  flag3 = true
  flag4 = true
 
  errstr = ""
 
   if (document.contactform.mail.value == '') {
   return (true);
  } else {
   flag1 = false
   flag2 = false
   electmail = document.contactform.mail.value
   StrLn = electmail.length - 1
   if (electmail.charAt(0) == "@") {
   // errstr = errstr + "\n\nΠαρακαλώ γράψτε ένα έγκυρο e-mail."
    flag1=false
   } else {
    for (var i=0; i <= StrLn; i++) {
     if (electmail.charAt(i) == "@"){
      flag1 = true
      if ( i == StrLn ) {
       flag1 = false
      } else {
       if ( electmail.charAt(i + 1) == "." ) {
        flag1 = false
       }
      }
     }
     if (electmail.charAt(i) == ".") {
      flag2 = true
      if ( i == StrLn ) {
       flag2 = false
      }
     }
    }
   }
   if ((!flag1) || (!flag2)) {
    errstr = errstr + "\n\nΠαρακαλώ γράψτε ένα έγκυρο e-mail."
   }
  }
 
  if (flag && flag1 && flag2 && flag3) {
   return true;
  } else {
   alert(errstr)
   return false;
  }
 
  return (true);
   }
   