<!--
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 MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

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 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 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 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 ValidateOnlyContain() {
// Description: Check the a field contain only valid characters.
// Syntax: ValidateOnlyContain ('txtfield','letters_allowed',['txtfield_name'])
var errormsg='', args=ValidateOnlyContain.arguments, val=FindObj(args[0]), checkStr=val.value, checkOK=args[1], allValid=true;
if (!args[2]) args[2]=val.name;
for (i = 0;  (i < checkStr.length) && allValid;  i++) {
	var ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			break;
	if (j == checkOK.length) {
	allValid = false;
	break;
	}
}
if (!allValid) {
	errormsg='\n- Το πεδίο "'+args[2]+'" περιέχει μη αποδεκτούς χαρακτήρες. Αποδεκτοί χαρακτήρες είναι: ['+args[1]+'].';
	// val.value="";
	// val.focus();
  }
return errormsg;
}

function ValidateOnlyDigits() {
// Description: Validate a field that contains only digits.
var checkOK="1234567890";
var args=ValidateOnlyDigits.arguments, val=FindObj(args[0]);
if (!args[1]) args[1]=val.name;
var errormsg=ValidateOnlyContain(args[0],checkOK,args[1]);
if (errormsg) {
  errormsg='\n- Το πεδίο "'+args[1]+'" πρέπει να περιέχει μόνο ψηφία [0..9].';
  // val.value="";
  // val.focus();
  }
return errormsg;
}

function FilterProducts() {
  var sortorder, price_from, price_to;
  //sortorder = document.frmsort.sort.options[document.frmsort.sort.selectedIndex].value;
  if (document.frmsort.price_from) {price_from = document.frmsort.price_from.value;}
  if (document.frmsort.price_to) {price_to = document.frmsort.price_to.value;}
  window.location='/filterproducts.asp?price_from='+escape(price_from)+'&price_to='+escape(price_to)+'&redir='+escape(window.document.URL);
}

function SearchProduct() {
  if (document.frm_search.q.value.length<3) {
    alert("Παρακαλούμε δώστε τουλάχιστον 3 γράμματα, για να πραγματοποιηθεί αναζήτηση!");
    document.frm_search.q.focus();
    return false;
  }
  else {
    //MM_goToURL('parent','/search.asp?q='+escape(document.frm_search.q.value));
	window.location='/search.asp?q='+escape(document.frm_search.q.value);
	return true;
  }
}

function AddToBasketCosm(productid) {
   var answer;
   answer=window.confirm ('Το προϊόν προστέθηκε στο καλάθι σας.\n\nΓια να παραμείνετε στην ίδια σελίδα και να συνεχίσετε τις αγορές σας επιλέξτε "ΟΚ",\nαλλιώς θα εμφανιστεί το καλάθι με τις αγορές σας.');
   if (answer==true) {
     window.location='/eshop/my_basket.asp?action=add&ptype=cosm&pid=' + escape(productid) + '&redir=' + escape(document.URL);
     return true;	 
   }
   else {
     window.location='/eshop/my_basket.asp?action=add&ptype=cosm&pid=' + escape(productid) + '&redir=' + escape('/eshop/show_basket.asp');
     return true;
   }
}

function DeleteBasket() {
  // Delete Basket & Cancel Order
  if (confirm('Επιθυμείτε να ακυρώσετε την παραγγελία;\n\nΑμέσως, μετά θα επιστρέψετε στην αρχική σελίδα.')) {
	window.location='/eshop/my_basket.asp?action=delete&redir=../../default.asp';
	return true;
  }
  else {
   return false;
  }
}

function UpdateBasket() {
  // Updates Basket Quantities
  var i,len,pid,qty;
  pid=''; qty='';
  len=((document.frm_mybasket.length)-3)/2 // exclude 2 buttons + 1 hidden field (i.e -3) and divide by 2
  if (len>1) {
	// more than one product into basket
    for (i=0; i<len; i+=1) {
      pid+=document.frm_mybasket.pid[i].value + ',';
      qty+=document.frm_mybasket.qty[i].value + ',';
    }
    pid=pid.substring(0,pid.length-1); // remove last comma
    qty=qty.substring(0,qty.length-1);
  }
  else {
	// only one product into basket
	pid=document.frm_mybasket.pid.value;
	qty=document.frm_mybasket.qty.value;
  }
  window.location='/eshop/my_basket.asp?action=update&pid='+escape(pid)+'&qty='+escape(qty)+'&redir=' + escape(document.URL);
  return true;
}

function UpdateVATBasket(isFrontier) {
  window.location='/eshop/my_basket.asp?action=updatevat&vattype='+escape(isFrontier)+'&redir='+ escape(document.URL);
  return true;
}

function DeleteFromBasket(orderline) {
  if (confirm('Επιθυμείτε να διαγράψετε το προϊόν από την παραγγελία;\n\nΑν είναι το μοναδικό προϊόν θα ακυρωθεί η παραγγελία σας και θα επιστρέψετε στην αρχική σελίδα.')) {
    if (document.frm_mybasket.elements.length<6) { // 2 buttons + 1 hidden field + 
      document.frm_mybasket.qty.value='0';
    }
	else {
	  document.frm_mybasket.qty[orderline-1].value='0';
	}
	UpdateBasket();
    return true;
  }
  else {
    return false;
  }
}


function login() {
  var errmsg="";
  var f=document.frm_login;
  ValidateLCase('username');
  errmsg+=ValidateEmail('username','E-MAIL');
  errmsg+=ValidateMinLength('password',4,'ΚΩΔΙΚΟΣ ΠΡΟΣΒΑΣΗΣ');
  if (errmsg!="") {
    alert("Παρακαλούμε, διορθώστε τα παρακάτω λάθη:\n" + errmsg);
	return false;
  }
  else {
    f.submit();
    return true;
  }
}


function register() {
  var errmsg="";
  var f=document.frm_register;
  ValidateUCase('lastname');
  ValidateUCase('firstname');
  ValidateUCase('address');
  ValidateUCase('city');
  ValidateLCase('email');
  ValidateLCase('email2');
  errmsg+=ValidateMinLength('lastname',4,'Επώνυμο');
  errmsg+=ValidateMinLength('firstname',4,'Όνομα');
  errmsg+=ValidateMinLength('address',4,'Διεύθυνση');
  errmsg+=ValidateMinLength('city',2,'Πόλη');
  errmsg+=ValidateMinLength('postcode',5,'Τ.Κ.');
  errmsg+=ValidateOnlyDigits('postcode','Τ.Κ.');
  errmsg+=ValidateMinLength('phone',10,'Τηλέφωνο');
  errmsg+=ValidateOnlyDigits('phone','Τηλέφωνο');
  errmsg+=ValidateOnlyDigits('fax','Fax');
  errmsg+=ValidateEmail('email','Email');
  if (f.email.value!=f.email2.value) {
    f.email.value="";
	f.email2.value="";
	errmsg+="\n- Η επαλήθευση του email σας δεν είναι σωστή.";
  }
  if (f.receipt[1].checked)  {
    ValidateUCase('company_name');
    ValidateUCase('company_desc');
    ValidateUCase('doy');
    errmsg+=ValidateMinLength('company_name',4,'Επωνυμία Επιχείρησης');
    errmsg+=ValidateMinLength('company_desc',4,'Δραστηριότητα');
    errmsg+=ValidateMinLength('afm',8,'Α.Φ.Μ.');
    errmsg+=ValidateOnlyDigits('afm','Α.Φ.Μ.');
    errmsg+=ValidateMinLength('doy',5,'Δ.Ο.Υ.');
  }
  // if (!f.terms.checked) errmsg+="\n- Πρέπει να αποδεκτείτε τους όρους χρήσης της υπηρεσίας.";
  if (errmsg!="") {
    alert("Παρακαλούμε, διορθώστε τα παρακάτω λάθη:\n" + errmsg);
	return false;
  }
  else {
    f.submit();
    return true;
  }
}


function forgotpwd() {
  var errmsg="";
  var f=document.frm_forgotpwd;
  ValidateLCase('email');
  errmsg+=ValidateEmail('email','Email');
  if (errmsg!="") {
    alert("Παρακαλούμε, διορθώστε τα παρακάτω λάθη:\n" + errmsg);
	return false;
  }
  else {
    f.submit();
    return true;
  }
}


function Validate_ContactRa1() {
  // Validate Order Information
  var errormsg='';	
  ValidateUCase('firstname');
  ValidateUCase('lastname');
  ValidateUCase('company_name');
  ValidateUCase('company_desc');
  ValidateUCase('phone');
  ValidateLCase('email');
  errormsg+=ValidateRequired('lastname','ΕΠΩΝΥΜΟ');
  errormsg+=ValidateRequired('firstname','ΟΝΟΜΑ');
  errormsg+=ValidateRequired('phone','ΤΗΛΕΦΩΝΟ');
  errormsg+=ValidateMinLength('phone',10,'ΤΗΛΕΦΩΝΟ');
  errormsg+=ValidateRequired('message','MHNYMA');
  if (errormsg) {
    alert('Tα παρακάτω λάθη εμφανίστηκαν:\n'+errormsg); 
    return false;
  }
  else {
    document.frm_contact.submit();
    return true;
  }
}


function OrderInfo() {
  // Validate Order Information
  var errormsg='';
  var f=document.frm_order;
  ValidateUCase('lastname');
  ValidateUCase('firstname');
  ValidateUCase('address');
  ValidateUCase('postcode');
  ValidateUCase('city');
  ValidateUCase('phone');
  ValidateUCase('fax');
  ValidateLCase('email');
  ValidateLCase('email2');
  ValidateUCase('comments');
  ValidateUCase('company_name');
  ValidateUCase('company_desc');
  ValidateUCase('afm');
  ValidateUCase('doy');
  errormsg+=ValidateEmail('email','E-MAIL');
  if (f.email.value!=f.email2.value) {
	errormsg+="\n- Η επαλήθευση του E-MAIL σας δεν είναι σωστή.";
  };
  errormsg+=ValidateMinLength('password1',4,'ΚΩΔΙΚΟΣ ΠΡΟΣΒΑΣΗΣ');
  errormsg+=ValidateOnlyDigits('password1','ΚΩΔΙΚΟΣ ΠΡΟΣΒΑΣΗΣ');
  if (f.password1.value!=f.password2.value) {
	errormsg+="\n- Η επαλήθευση του ΚΩΔΙΚΟΥ ΠΡΟΣΒΑΣΗΣ δεν είναι σωστή.";
  };
  errormsg+=ValidateRequired('lastname','ΕΠΩΝΥΜΟ');
  errormsg+=ValidateRequired('firstname','ΟΝΟΜΑ');
  errormsg+=ValidateRequired('address','ΔΙΕΥΘΥΝΣΗ');
  errormsg+=ValidateRequired('city','ΠΟΛΗ/ΠΕΡΙΟΧΗ');
  errormsg+=ValidateMinLength('phone',10,'ΤΗΛΕΦΩΝΟ');
  errormsg+=ValidateMinLength('postcode',5,'Τ.Κ.');
  errormsg+=ValidateOnlyDigits('phone','ΤΗΛΕΦΩΝΟ');
  errormsg+=ValidateOnlyDigits('fax','FAX');
  errormsg+=ValidateOnlyDigits('postcode','Τ.Κ.');
  errormsg+=ValidateOnlyDigits('afm','ΑΦΜ');
  if (f.payment.selectedIndex == 0) {
	errormsg+='\n- Eπιλέξτε έναν από τους διαθέσιμες ΤΡΟΠΟΥΣ ΠΛΗΡΩΜΗΣ.';
  };
  if (f.receipt[1].checked) {
	errormsg+=ValidateRequired('company_name','ΕΠΩΝΥΜΙΑ ΕΠΙΧΕΙΡΗΣΗΣ');
	errormsg+=ValidateRequired('company_desc','ΕΠΑΓΓΕΛΜΑ / ΔΡΑΣΤΗΡΙΟΤΗΤΑ');
	errormsg+=ValidateRequired('afm','ΑΦΜ');
    errormsg+=ValidateRequired('doy','ΔΟΥ');
    errormsg+=ValidateMinLength('afm',9,'ΑΦΜ');
    errormsg+=ValidateMinLength('doy',5,'ΔΟΥ');
  };
  if (errormsg) {
    alert('Tα παρακάτω λάθη εμφανίστηκαν:\n'+errormsg); 
    return false;
  }
  else {
    f.submit();
    return true;
  };
}

function showhide_help(){
	if (document.getElementById('help_div').style.display=='block') {
	  document.getElementById('help_div').style.display='none';
	}
	else {
	  document.getElementById('help_div').style.display='block';
	}
}


function showhand(t) {
  t.style.cursor='pointer';
}


function showlogin (){
	if (document.getElementById('customerlogin').value=='0') {
	  document.getElementById('customerlogin_div').style.display='block';
	  document.getElementById('newcustomer_div').style.display='none';
	}
	else {
      document.getElementById('customerlogin_div').style.display='none';
	  document.getElementById('newcustomer_div').style.display='block';
	}
}

function showpayment (){
	document.getElementById('antikatavoli_info').style.display='none';
	document.getElementById('bank_info').style.display='none';
    document.getElementById('cc_info').style.display='none';
	if (document.frm_order.payment.value=='ΑΝΤΙΚΑΤΑΒΟΛΗ') {
	  document.getElementById('antikatavoli_info').style.display='block';
	};
	if (document.frm_order.payment.value=='ΚΑΤΑΘΕΣΗ') {
	  document.getElementById('bank_info').style.display='block';
	};	
	if (document.frm_order.payment.value=='ΠΙΣΤΩΤΙΚΗ') {
	  document.getElementById('cc_info').style.display='block';
	};	
}

function changelogin (){
	if (document.getElementById('logininfo_div').style.display=='block') {
	  document.getElementById('logininfo_div').style.display='none';
	}
	else {
	  document.getElementById('logininfo_div').style.display='block';
	}
}

function show_top_companies (letter) {
	document.getElementById('top_best').style.display='none';
	document.getElementById('top_a').style.display='none';
	document.getElementById('top_b').style.display='none';
	document.getElementById('top_c').style.display='none';
	document.getElementById('top_d').style.display='none';
	document.getElementById('top_e').style.display='none';
	document.getElementById('top_f').style.display='none';
	document.getElementById('top_g').style.display='none';
	document.getElementById('top_h').style.display='none';
	document.getElementById('top_i').style.display='none';
	document.getElementById('top_j').style.display='none';
	document.getElementById('top_k').style.display='none';
	document.getElementById('top_l').style.display='none';
	document.getElementById('top_m').style.display='none';
	document.getElementById('top_n').style.display='none';
	document.getElementById('top_o').style.display='none';
	document.getElementById('top_p').style.display='none';
	document.getElementById('top_q').style.display='none';
	document.getElementById('top_r').style.display='none';
	document.getElementById('top_s').style.display='none';
	document.getElementById('top_t').style.display='none';
	document.getElementById('top_u').style.display='none';
	document.getElementById('top_v').style.display='none';
	document.getElementById('top_w').style.display='none';
	document.getElementById('top_x').style.display='none';
	document.getElementById('top_y').style.display='none';
	document.getElementById('top_z').style.display='none';
	switch (letter)	{
	  case 'a':document.getElementById('top_a').style.display='block';break;
	  case 'b':document.getElementById('top_b').style.display='block';break;
	  case 'c':document.getElementById('top_c').style.display='block';break;
	  case 'd':document.getElementById('top_d').style.display='block';break;
	  case 'e':document.getElementById('top_e').style.display='block';break;
	  case 'f':document.getElementById('top_f').style.display='block';break;
	  case 'g':document.getElementById('top_g').style.display='block';break;
	  case 'h':document.getElementById('top_h').style.display='block';break;
	  case 'i':document.getElementById('top_i').style.display='block';break;
	  case 'j':document.getElementById('top_j').style.display='block';break;
	  case 'k':document.getElementById('top_k').style.display='block';break;
	  case 'l':document.getElementById('top_l').style.display='block';break;
	  case 'm':document.getElementById('top_m').style.display='block';break;
	  case 'n':document.getElementById('top_n').style.display='block';break;
	  case 'o':document.getElementById('top_o').style.display='block';break;
	  case 'p':document.getElementById('top_p').style.display='block';break;
	  case 'q':document.getElementById('top_q').style.display='block';break;
	  case 'r':document.getElementById('top_r').style.display='block';break;
	  case 's':document.getElementById('top_s').style.display='block';break;
	  case 't':document.getElementById('top_t').style.display='block';break;
	  case 'u':document.getElementById('top_u').style.display='block';break;
	  case 'v':document.getElementById('top_v').style.display='block';break;
	  case 'w':document.getElementById('top_w').style.display='block';break;
	  case 'x':document.getElementById('top_x').style.display='block';break;
	  case 'y':document.getElementById('top_y').style.display='block';break;
	  case 'z':document.getElementById('top_z').style.display='block';break;
	}
}
-->