function productContact(b,d){if(d==""){d=1;}var c=new Array();var a=new Array();c[1]="Ενδιαφέρομαι για το προιόν";c[2]="I'm interested in";a[1]="[Κλείσιμο]";a[2]="[CLOSE]";if(b!=""&&d!=""){new Boxy.load("cprod.php?s="+b,{title:c[d],closeText:a[d],closeable:true,cache:false,unloadOnHide:true});}return false;}function validContactProd(d){if(d==""){d=1;}var c=new Array();c[1]="";c[2]="";var a=0;if($("#resultcontactprod").hasClass("error_box")){$("#resultcontactprod").removeClass("error_box");}$(":input").removeClass("inputerror");if($("input#contact").val()==""){a++;c[1]+="Παρακαλούμε εισάγετε το όνομα σας<br>";c[2]+="Please type your Name<br>";$("input#contact").addClass("inputerror");}else{if($("input#contact").val().length<3){a++;c[1]+="Το όνομα σας είναι πολύ μικρό<br>";c[2]+="Your Name is too small<br>";$("input#contact").addClass("inputerror");}}if($("input#tel").val()==""){a++;c[1]+="Παρακαλούμε εισάγετε το τηλεφωνό σας<br>";c[2]+="Please type your tel number<br>";$("input#contact").addClass("inputerror");}else{if($("input#tel").val().length<7){a++;c[1]+="To τηλέφωνο σας είναι πολύ μικρό<br>";c[2]+="Your tel is too small<br>";$("input#contact").addClass("inputerror");}if(!valid_tel($("input#tel").val())){a++;c[1]+="Το τηλεφωνό σας δεν είναι έγκυρο(μόνο αριθμοί επιτρέπονται<br>";c[2]+="Your tel is not valid (only numbers are allowed<br>";$("input#contact").addClass("inputerror");}}if($("input#comments").val()==""){a++;c[1]+="Δεν έχετε εισάγει σχόλια!<br>";c[2]+="Please type some comments!<br>";$("input#contact").addClass("inputerror");}if(a>0){$("#resultcontactprod").html(c[d]);$("#resultcontactprod").addClass("error_box");return false;}var b=$("#contactformdata").serialize();$("#formcontentprod").hide("slow");clear("#resultcontactprod");$.ajax({type:"POST",url:"_inc/_z_contact.php",data:b,loading:loadingrequest("#resultcontactprod"),success:function(f){var e=jQuery.trim(f.toString());c=new Array();c[1]="";c[2]="";switch(e){case"INVALID":$("#formcontentprod").show("slow");c[1]+="Φαίνεται οτι έχετε αποστείλει λανθασμένα δεδομένα.Παρακαλούμε ανανεώστε τη σελίδα<br>";c[2]+="It appears that you have sent the wrong details.Please refresh your page<br>";$("#resultcontactprod").html(c[d]);$("#formcontent").show("slow");break;case"REQUIRED":$("#formcontentprod").show("slow");c[1]+="Φαίνεται οτι δεν έχετε αποστείλει όλα τα δεδομένα.Παρακαλούμε δοκιμάστε πάλι<br>";c[2]+="It appears that you have not sent all required information. Please try again<br>";$("#resultcontactprod").html(c[d]);$("#formcontentprod").show("slow");break;case"MISSING":$("#formcontentprod").show("slow");c[1]+="Παρακαλούμε συμπληρώστε όλα τα απαραίτητα πεδία<br>";c[2]+="Please fill in all required information<br>";$("#resultcontactprod").html(c[d]);$("#formcontentprod").show("slow");break;case str_no:$("#formcontentprod").show("slow");c[1]+="Τα στοιχεία που εισάγατε δεν είναι σωστά.Προσπαθείστε πάλι!<br>";c[2]+="Your information is not correct. Please try again<br>";$("#resultcontactprod").html(c[d]);$("#formcontentprod").show("slow");break;case str_yes:c[1]="Η αποστολή ήταν επιτυχής! Κάποιος συνεργάτης μας θα επικοινωνήσει μαζί σας, σύντομα.Ευχαριστούμε<br>";c[2]="Your message was delivered to one of our sales representatives.We will contact you shortly.Thank you<br>";$("#resultcontactprod").html(c[d]);$("#formcontentprod").html("");break;default:$("#formcontentprod").show("slow");c[1]+="Παρακαλούμε ανανεώστε τη σελίδα<br>";c[2]+="Please refresh your page<br>";$("#resultcontactprod").html(c);$("#formcontentprod").show("slow");break;}return false;}});return false;}
