var alertMsg="";function DoValidation(){var b=document.forms[0].elements;document.ValidFields=true;for(var a=0;a<b.length;++a){if(b[a].type=="text"){if(b[a].name=="EmailAddress"){emailCheck(b[a]);if(document.ValidFields==false)break}if(b[a].name=="YourName"){alertMsg=b[a].name+" is required.";validateEntry(b[a]);if(document.ValidFields==false)break}}if(b[a].name=="Interest"){alertMsg="Please choose a subject.";chkOption(b[a]);if(document.ValidFields==false)break}}} function trimstr(b){return(b||"").replace(/\s+|\s+$/g,"")}function validateEntry(b){for(var a=b.value,c=a.length;a.slice(0,1)==" ";){a=a.substr(1,c-1);c=a.length}for(;a.slice(c-1,c)==" ";){a=a.substr(0,c-1);c=a.length}for(;a.slice(0,1)==" ";){a=a.substr(1,c-1);c=a.length}for(;a.slice(c-1,c)==" ";){a=a.substr(0,c-1);c=a.length}b.value=a;if(b.value==""){alert(alertMsg);b.focus();document.ValidFields=false}} function chkOption(b){for(var a=0;a<b.options.length;++a)if(b.options[a].selected!="")if(b.options[a].value=="Choose"){alert(alertMsg);b.focus();document.ValidFields=false;return}} function emailCheck(b){var a=b.value,c=1,d=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/,f=/^(.+)@(.+)$/,k='\\(\\)><@,;:\\\\\\"\\.\\[\\]',g="[^\\s"+k+"]",h='("[^"]*")';k=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;g=g+"+";h="("+g+"|"+h+")";h=new RegExp("^"+h+"(\\."+h+")*$");var m=new RegExp("^"+g+"(\\."+g+")*$");a=a.match(f);if(a==null){alert("Email address seems incorrect (check @ and .'s)");document.ValidFields=false;b.focus()}if(document.ValidFields!=false){var e= a[1],j=a[2];for(a=0;a<e.length;a++)if(e.charCodeAt(a)>127){alert("This username contains invalid characters.");document.ValidFields=false;b.focus();return}}if(document.ValidFields!=false)for(a=0;a<j.length;a++)if(j.charCodeAt(a)>127){alert("This domain name contains invalid characters.");document.ValidFields=false;b.focus();return}if(document.ValidFields!=false)if(e.match(h)==null){alert("The name doesn't seem to be valid.");document.ValidFields=false;b.focus();return}if(document.ValidFields!=false){e= j.match(k);if(e!=null)for(a=1;a<=4;a++)if(e[a]>255){alert("Destination IP address is invalid!");document.ValidFields=false;b.focus();return}document.ValidFields=true}if(document.ValidFields!=false){e=new RegExp("^"+g+"$");var i=j.split("."),l=i.length;for(a=0;a<l;a++)if(i[a].search(e)==-1){alert("The domain name does not seem to be valid.");document.ValidFields=false;b.focus();return}}if(document.ValidFields!=false)if(c&&i[i.length-1].length!=2&&i[i.length-1].search(d)==-1){alert("The address must end in a well-known domain or two letter country."); document.ValidFields=false;b.focus();return}if(document.ValidFields!=false)if(l<2){alert("This address is missing a hostname!");document.ValidFields=false;b.focus()}}var winl=30,wint=30;function NewWindow(b,a,c,d,f){winprops="height="+d+",width="+c+",top="+wint+",left="+winl+",resizable=0,scrollbars="+f+",menubar=no,status=no";win=window.open(b,a,winprops);parseInt(navigator.appVersion)>=4&&win.window.focus()} function openCS(){window.open("http://greekgear.helpserve.com/index.php","w1","width=880,height=780,scrollbars=1,resizable=1")}function openAW(){window.open("artwork.html","w1","width=880,height=780,scrollbars=1")} function findSelectOptions(b){b=b;var a=0;if(shipcount!=0){var c=document.getElementById("main-qty");for(a=1;a<=shipcount;a++){var d=a+1;if(d=document.getElementById("shipcharge"+d.toString()))d.value=c.value}}for(a=0;a<b.elements.length;a++){currentEl=b.elements[a];if(currentEl.type=="select-one")if(currentEl.selectedIndex==0)if(currentEl.options[currentEl.selectedIndex].innerHTML=="Choose"){b=currentEl.name.toLowerCase().replace(/vw.*_/gi,"");alert("Please select a "+b+" to proceed.");return false}}if(b.elements["Additional Personalization"]){c= b.getElementsByTagName("input");a=b.elements["Additional Personalization"].value;a=a.split(" ");var f=a[0].toLowerCase();for(a=0;a<c.length;a++)if(c[a].name!="vwquantity"&&c[a].type!="hidden"&&c[a].type!="image"){d=c[a].value;nameContent=trimstr(d);if(nameContent==""&&f=="yes"){alert("Please enter the "+c[a].name+" field");return false}if(nameContent!=""&&f!="yes"){alert("Please select Additional Personalization to Yes");return false}}}b.submit();return false} function openpopup9(){var b="email-image.html";winpops=window.open(b,"","width=450,height=430,top=175,left=200,toolbar=0,scrollbars=1,location=1,status=0,menubar=0,resizable=0")};
