function getCookie(NameOfCookie){if(document.cookie.length>0){begin=document.cookie.indexOf(NameOfCookie+"=");if(begin!=-1){begin+=NameOfCookie.length+1;end=document.cookie.indexOf(";",begin);if(end==-1){end=document.cookie.length;}return unescape(document.cookie.substring(begin,end));}}}function openwin2(url){window.open("http://www.emedoutlet.com/"+url,"Emedoutlet","resizable=yes,scrollbars=yes,toolbar=no,width=250,height=200,top=50");}function check(){var search_string=document.getElementById("searchd").value;if(search_string==""){alert("Please Enter Search Criteria");document.getElementById("searchd").focus();return false;}}function check1(){var med=document.search_brand_cat.txtcate.value;if(med!="Select Category"){window.location.href="/"+med+"-medicine.html";}}function MakeRedirection(){window.location.href="http://www.superdrugsaver.com";}var tgs=new Array("div","td","tr","a");var szs=new Array("xx-small","x-small","small","medium","large","x-large","xx-large");var startSz=2;function ts(trgt,inc){if(!document.getElementById){return;}var d=document,cEl=null,sz=startSz,i,j,cTags;sz=inc;if(sz<0){sz=0;}if(sz>6){sz=6;}startSz=sz;if(!(cEl=d.getElementById(trgt))){cEl=d.getElementsByTagName(trgt)[0];}cEl.style.fontSize=szs[sz];for(i=0;i<tgs.length;i++){cTags=cEl.getElementsByTagName(tgs[i]);for(j=0;j<cTags.length;j++){cTags[j].style.fontSize=szs[sz];}}}function menu(which,counter){flag=true;if(document.getElementById("divSub"+which).style.display==""){flag=false;}for(i=0;i<counter;i++){document.getElementById("divSub"+i).style.display="none";imgtmp=eval("document.imgA"+i);imgtmp.src="../images/foldoutmenu_arrow.gif";}if(flag){document.getElementById("divSub"+which).style.display="";imgtmp=eval("document.imgA"+which);imgtmp.src="../images/foldoutmenu_arrow_open.gif";}return false;}function chk_validate1(){d=document.frmsearch1;if(d.txtemail.value==""){alert("Please Enter E-Mail");d.txtemail.focus();return false;}if(d.txtpwd.value==""){alert("Please Password");d.txtpwd.focus();return false;}}function show_me(idid){var test_cst=document.getElementById("divTop_"+idid).style.display;if(test_cst=="none"){document.getElementById("divTop_"+idid).style.display="";}else{document.getElementById("divTop_"+idid).style.display="none";}}function Open_FlashVideo(){var strWidth=screen.width;var strHeight=screen.height;window.open("../emedvideo.html","MyWindow","menubar=0,resizable=1,scrollbars=1,location=0,width=1000,height=700px");}function vclear(){document.getElementById("eemail").value="";document.getElementById("eemail").focus();}var is_input=document.URL.indexOf("?");if(is_input!=-1){addr_str=document.URL.substring(is_input+1,document.URL.length);url=document.URL.substring(is_input+1,document.URL.length);}else{url="";}var http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType("text/xml");}}else{if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}}if(!http_request){alert("Giving up :( Cannot create an XMLHTTP instance");}http_request.onreadystatechange=function(){alertContents(http_request);};http_request.open("GET","new.php?"+url,true);http_request.send(null);function alertContents(http_request){if(http_request.readyState==4){if(http_request.status==200){}else{}}}function getObject(name){var ns4=(document.layers)?true:false;var w3c=(document.getElementById)?true:false;var ie4=(document.all)?true:false;if(ns4){return eval("document."+name);}if(w3c){return document.getElementById(name);}if(ie4){return eval("document.all."+name);}return false;}function openfeedback(url){var xc=window.open("/"+url,"Emedoutlet","resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,width=560,height=610,top=50");if(xc){xc.focus();}}function show(no_of_cat,pid,no_of_products,total_viewall_categories){id="cat_"+pid;cat_no="category_"+pid;anchor_id="anch_"+pid;for(var i=1;i<=no_of_cat;i++){getObject("category_"+i).style.display="none";getObject("cat_"+i).className="link_transparent_1";getObject("anch_"+i).className="text_color";}for(var k=1;k<=no_of_products;k++){getObject(cat_no+"_product_"+k).style.display="none";}for(l=1;l<=total_viewall_categories;l++){getObject("viewall_cat_"+l).style.display="none";}getObject(cat_no).style.display="block";getObject(cat_no+"_product_1").style.display="block";getObject(id).className="link_transparent";getObject(anchor_id).className="blueLink";getObject("cat_6").className="link_transparent_1";getObject("anch_6").className="text_color";getObject("category_6").style.display="none";}function shownext(category_no,no_of_prod){var prodno;for(var i=1;i<=no_of_prod;i++){if(getObject("category_"+category_no+"_product_"+i).style.display=="block"){prodno=i;break;}}nextproduct=++prodno;if(nextproduct<=no_of_prod){getObject("category_"+category_no+"_product_"+nextproduct).style.display="block";getObject("category_"+category_no+"_product_"+i).style.display="none";}}function showprevious(category_no,no_of_prod){var prod1;for(var j=1;j<=no_of_prod;j++){if(getObject("category_"+category_no+"_product_"+j).style.display=="block"){prod1=j;break;}}lastproduct=--prod1;if(lastproduct<=no_of_prod&&lastproduct>0){getObject("category_"+category_no+"_product_"+lastproduct).style.display="block";getObject("category_"+category_no+"_product_"+j).style.display="none";}}function viewall(total_categories,total_no_of_viewallprod1){for(var i=1;i<=total_categories;i++){getObject("category_"+i).style.display="none";getObject("cat_"+i).className="link_transparent_1";getObject("anch_"+i).className="text_color";}for(n=1;n<=total_no_of_viewallprod1;n++){getObject("viewall_cat_"+n).style.display="none";}getObject("cat_6").className="link_transparent";getObject("anch_6").className="blueLink";getObject("category_6").style.display="block";}function viewall_products(product_no,start,end){getObject("category_6").style.display="none";for(var a=start;a<=end;a++){if(getObject("category_6_product_"+a).style.display=="block"){getObject("category_6_product_"+a).style.display="none";}}getObject("viewall_cat_"+product_no).style.display="block";getObject("category_6_product_"+start).style.display="block";}function shownext_viewall(category_no,no_of_prod,start,end){var prodno;for(var i=start;i<=end;i++){if(getObject("category_"+category_no+"_product_"+i).style.display=="block"){prodno=i;break;}}nextproduct=++prodno;if(nextproduct<=end){getObject("category_"+category_no+"_product_"+nextproduct).style.display="block";getObject("category_"+category_no+"_product_"+i).style.display="none";}}function showprevious_viewall(category_no,no_of_prod,start,end){var prod1;for(var j=start;j<=end;j++){if(getObject("category_"+category_no+"_product_"+j).style.display=="block"){prod1=j;break;}}lastproduct=--prod1;if(lastproduct<=end&&lastproduct>=start){getObject("category_"+category_no+"_product_"+lastproduct).style.display="block";getObject("category_"+category_no+"_product_"+j).style.display="none";}}var speed=3;function init(){var el=document.getElementById("marquee_replacement");el.style.overflow="hidden";scrollFromBottom();}var go=0;var timeout="";function scrollFromBottom(){clearTimeout(timeout);var el=document.getElementById("marquee_replacement");if(el.scrollTop>=el.scrollHeight-200){el.scrollTop=0;}el.scrollTop=el.scrollTop+speed;if(go==0){timeout=setTimeout("scrollFromBottom()",50);}}function stop(){go=1;}function startit(){go=0;scrollFromBottom();}function checkemail(){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;d=document.email_sub;if((!(filter.test(d.eemail.value)))){alert("Please Enter Your Email address in abc@xyz.com");d.eemail.focus();return false;}}function ShowMedicalOptions(val){for(i=1;i<=21;i++){if(getObject("div"+i)){if(i==val){if(getObject("div"+val).style.display=="none"){getObject("div"+val).style.display="";}else{getObject("div"+val).style.display="";}}else{getObject("div"+i).style.display="none";}}}}function ChkTickMark(){if(document.FrmAddMedicalHistory.CheckTerm.checked==false){alert("Please check the Terms & Conditions box");document.FrmAddMedicalHistory.CheckTerm.focus();return false;}}function BoxWindow(url){var hWnd=window.open("pre_upload/"+url,"Emedoutlet","width=450,height=340,resizable=no,scrollbars=yes,left=250,top=280");if(hWnd.focus!=null){hWnd.focus();}}var xx;var j;j=0;function myfun(){var agree;for(i=0;i<document.del.length;++i){if(document.del.elements[i].value=="1"){if(document.del.elements[i].checked){j=j+1;agree=true;if(j==1){xx=document.del.elements[i].name;}else{xx=xx+","+document.del.elements[i].name;}}}}document.del.delvalue.value=xx;if(agree){return confirm("Are You sure you want to delete this items?");}return false;}function checkall(){for(i=0;i<document.del.elements.length;i++){document.del.elements[i].checked=document.del.chk.checked;}}function myfun1(){var agree;for(i=0;i<document.del1.length;++i){if(document.del1.elements[i].value=="1"){if(document.del1.elements[i].checked){j=j+1;agree=true;if(j==1){xx=document.del1.elements[i].name;}else{xx=xx+","+document.del1.elements[i].name;}}}}document.del1.delvalue.value=xx;if(agree){return confirm("Are You sure you want to delete this items?");}return false;}function checkall1(){for(i=0;i<document.del1.elements.length;i++){document.del1.elements[i].checked=document.del1.chk.checked;}}function cl(){if((document.del.txt_qty_1.value)<=0){alert("Prodeuct Quantity Cannot Be Zero");document.del.txt_qty_1.value=1;}}var zxcBlankImg="images/space.gif";var zxcOOPCnt=0;function zxcZoomText(zxcobj,zxcssz,zxcfsz,zxcspd){if(typeof(zxcobj)=="string"){zxcobj=document.getElementById(obj);}if(!zxcobj.oopct){zxcspd=zxcspd||100;if(zxcBlankImg){zxcobj.style.backgroundImage="url("+zxcBlankImg+")";}zxcobj.oopct=new zxcOOPTxtZoom(zxcobj,zxcssz,zxcfsz,zxcspd);}clearTimeout(zxcobj.oopct.to);zxcobj.oopct.minmax[4]*=-1;zxcobj.oopct.cngtxt();}function zxcOOPTxtZoom(zxcobj,zxcssz,zxcfsz,zxcspd){this.obj=zxcobj;if(zxcobj.style.position){if(zxcobj.style.position="absolute"){this.abs=[zxcobj.offsetLeft,zxcobj.offsetWidth];}}this.ref="zxcoopct"+zxcOOPCnt++;window[this.ref]=this;this.minmax=[zxcssz,Math.min(zxcssz,zxcfsz),Math.max(zxcssz,zxcfsz),zxcspd,(zxcssz<zxcfsz)?-1:1];this.to=null;}zxcOOPTxtZoom.prototype.cngtxt=function(){if((this.minmax[4]>0&&this.minmax[0]<this.minmax[2])||(this.minmax[4]<0&&this.minmax[0]>this.minmax[1])){this.obj.style.fontSize=(this.minmax[0]+=this.minmax[4])+"px";if(this.abs){this.obj.parentNode.style.width=(this.obj.offsetWidth+parseInt(this.obj.style.fontSize))+"px";this.obj.parentNode.style.left=(parseInt(this.obj.style.fontSize)/2)+"px";}this.to=this.setTimeOut("cngtxt();",this.minmax[3]);}};zxcOOPTxtZoom.prototype.setTimeOut=function(zxcf,zxcd){this.to=setTimeout("window."+this.ref+"."+zxcf,zxcd);};var httpObject1=null;var httpObject2=null;var lb_err_msg="";function getHTTPObject1(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}else{if(window.XMLHttpRequest){return new XMLHttpRequest();}else{alert("Your browser does not support AJAX.");return null;}}}function get_output(){if(httpObject1.readyState==4){var result=httpObject1.responseText;result=trim(result);var len=result.length;var err_msg="";if(len=="1"||len==1){err_msg=result;err_msg=get_errmsg(err_msg);document.getElementById("page_loader").style.display="none";document.getElementById("temsandconditions").style.display="block";document.getElementById("emailcontent_option").style.display="none";document.getElementById(lb_err_msg).innerHTML=err_msg;}else{document.getElementById("page_loader").style.display="none";document.getElementById("temsandconditions").style.display="none";document.getElementById("emailcontent_option").style.display="block";document.getElementById(lb_err_msg).innerHTML="";document.getElementById("div_invite_step").innerHTML=result;}}}function goto_step2(email,pass,provider,step,service_provider){var flag_email=true;var flag_pass=true;var flag_terms=true;var lb_email_id="lb_email_box";var lb_password_id="lb_password_box";switch(service_provider){case"gmail":lb_email_id="lb_email_box";lb_password_id="lb_password_box";lb_err_msg="lb_err_msg_gmail";break;case"yahoo":lb_email_id=lb_email_id+"_"+service_provider;lb_password_id=lb_password_id+"_"+service_provider;lb_err_msg="lb_err_msg_yahoo";break;case"hotmail":lb_email_id=lb_email_id+"_"+service_provider;lb_password_id=lb_password_id+"_"+service_provider;lb_err_msg="lb_err_msg_hotmail";break;case"aol":lb_email_id=lb_email_id+"_"+service_provider;lb_password_id=lb_password_id+"_"+service_provider;lb_err_msg="lb_err_msg_aol";break;case"msn":lb_email_id=lb_email_id+"_"+service_provider;lb_password_id=lb_password_id+"_"+service_provider;lb_err_msg="lb_err_msg_msn";break;default:lb_email_id="lb_email_box";lb_password_id="lb_password_box";lb_err_msg="lb_err_msg";}if(!document.getElementById("arg").checked){alert("You must agree all Terms & Conditions");document.getElementById("arg").focus();flag_terms=false;}else{flag_terms=true;}var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(reg.test(email)==false||email==""){document.getElementById(lb_email_id).innerHTML="Enter Valid Email Address";flag_email=false;}else{flag_email=true;document.getElementById(lb_email_id).innerHTML="";}if(pass==""){document.getElementById(lb_password_id).innerHTML="Enter Password";flag_pass=false;}else{flag_pass=true;document.getElementById(lb_password_id).innerHTML="";}if(flag_email==true&&flag_pass==true&&flag_terms==true){document.getElementById(lb_err_msg).innerHTML="";document.getElementById("page_loader").style.display="block";document.getElementById(lb_email_id).innerHTML="";document.getElementById(lb_password_id).innerHTML="";httpObject1=getHTTPObject1();if(httpObject1!=null){httpObject1.open("GET","invitefriends_step2.php?email_box="+email+"&password_box="+pass+"&provider_box="+provider+"&step="+step,true);httpObject1.send(null);httpObject1.onreadystatechange=get_output;}}else{document.getElementById("temsandconditions").style.display="block";document.getElementById("emailcontent_option").style.display="none";}}function get_output_step3(){if(httpObject2.readyState==4){var result=httpObject2.responseText;result=trim(result);var len=result.length;var err_msg="";if(len=="1"||len==1){err_msg=result;err_msg=get_errmsg(err_msg);document.getElementById("page_loader").style.display="none";document.getElementById(lb_err_msg).innerHTML=err_msg;}else{document.getElementById("page_loader").style.display="none";document.getElementById("emailcontent_option").style.display="none";document.getElementById("div_invite_step").innerHTML=result;}}}function goto_step3(email,provider,step,os_session,contact_count){var total="";var chk_val="";var rdb_val="";var rdb_len=document.form_email_content.rdb_email.length;var chkbx_len=document.openinviter.chkbox_email.length;for(var i=0;i<rdb_len;i++){if(document.form_email_content.rdb_email[i].checked){rdb_val=document.form_email_content.rdb_email[i].value;break;}}for(var i=0;i<chkbx_len;i++){if(document.openinviter.chkbox_email[i].checked){if(i+1==chkbx_len){chk_val+=document.openinviter.chkbox_email[i].value;}else{chk_val+=document.openinviter.chkbox_email[i].value+",";total+=document.openinviter.chkbox_email[i].value+"\n";}}}if(!total==""){document.getElementById("page_loader").style.display="block";httpObject2=getHTTPObject1();if(httpObject2!=null){httpObject2.open("GET","invitefriends_step3.php?email_box="+email+"&provider_box="+provider+"&oi_session_id="+os_session+"&step="+step+"&radio_email="+rdb_val+"&contact_count="+contact_count+"&chkbox_email="+chk_val,true);httpObject2.send(null);httpObject2.onreadystatechange=get_output_step3;}}else{alert("Select atleast One contact to send Invite.");}}function trim(str){if(!str||typeof str!="string"){return null;}return str.replace(/^[\s]+/,"").replace(/[\s]+$/,"").replace(/[\s]{2,}/," ");}function get_errmsg(err_msg){switch(err_msg){case"1":err_msg="Error : Email missing !";break;case"2":err_msg="Error : Password missing !";break;case"3":err_msg="Error : Provider missing !";break;case"4":err_msg="Error : Login failed. Please check the email and password you have provided and try again later !";break;case"5":err_msg="Error : Unable to fetch contacts, Please try again!!!";break;case"6":err_msg="You do not have any contacts in your address book.";break;case"7":err_msg="Inviter information missing !";break;case"8":err_msg="No active session !";break;case"9":err_msg="You haven't selected any contacts to invite !";break;case"10":err_msg="There were errors while sending your invites.<br>Please try again later!";break;default:err_msg="";}return err_msg;}function toggleAll(element){var form=document.forms.openinviter,z=0;for(z=0;z<form.length;z++){if(form[z].type=="checkbox"){form[z].checked=element.checked;}}}function validate_form(){var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var address=document.getElementByID("email_box").value;if(reg.test(address)==false||document.getElementByID("email_box").value==""){document.getElementById("lb_email_box").innerHTML="Enter Valid Email Address";document.getElementByID("email_box").focus();return false;}else{document.getElementById("lb_email_box").innerHTML="";}if(document.getElementByID("password_box").value==""){document.getElementById("lb_password_box").innerHTML="Enter Password";document.getElementByID("password_box").focus();return false;}else{document.getElementById("lb_password_box").innerHTML="";}return true;}function openwinnew(){window.open("term_referrer.php","TERMS","toolbar=0, statusbar=0, scrollbars=yes, menubar=0, resizable=0, width=780, height=500, top=10, left=10");}function passusername(){var username="";var country="";window.open("ftc_referrer.php?username="+username+"&country="+country,"More","toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=1, width=700, height=600, left = 262, top = 134");}function OpenWindow(val){if(val){window.open(val,"_blank");}}function openriskform(){}function openshowinvoice(){window.open("print_invoice_new.php?q=<?php print base64_encode($uid); ?>&inv_id=<?php echo $order_id; ?>&transid=<?php print $order_id; ?>&payway=<?php print $payway; ?>&refdisc=<?php print $referral_discount; ?>&ord_flag=<?php print $ord_flag; ?>","SHOWINVOICE","width=800 top=10 left=200 scrollbars=1 statusbar=0 toolbars=0");}function urlWindow(url){var hWnd=window.open(url,"emedoutlet","width=450,height=600,resizable=no,scrollbars=yes,left=250,top=0");if(hWnd.focus!=null){hWnd.focus();}}function insert_ship_add1(){document.getElementById("alt_ship1").style.display="";chck_all_form=1;document.modify_det.sfname.focus();}function ValidateForm(){if(document.modify_det.bfname.value==""){alert("Please Enter Billing First Name");document.modify_det.bfname.focus();return false;}if(document.modify_det.blname.value==""){alert("Please Enter Billing Last Name");document.modify_det.blname.focus();return false;}if(document.modify_det.dob_month.value==""){alert("Please Enter the Date of Birth");document.modify_det.dob_month.focus();return(false);}if(document.modify_det.dob_day.value==""){alert("Please Enter the Date of Birth");document.modify_det.dob_day.focus();return(false);}if(document.modify_det.dob_year.value==""){alert("Please Enter the Date of Birth");document.modify_det.dob_year.focus();return(false);}if(document.modify_det.badd1.value==""){alert("Please Enter Billing Address");document.modify_det.badd1.focus();return false;}if(document.modify_det.bcity.value==""){alert("Please Enter the Billing Address City");document.modify_det.bcity.focus();return false;}if(document.modify_det.bcountry.value==""){alert("Please select Billing Country");document.modify_det.bcountry.focus();return false;}if((document.modify_det.bcountry.value!="United States of America")&&(document.modify_det.bstate_txt.value=="")){alert("Please Enter Billing State");document.modify_det.bstate_txt.focus();return false;}if((document.modify_det.bcountry.value=="United States of America")&&(document.modify_det.bstate_dd.value=="")){alert("Please Enter Billing State");document.modify_det.bstate_dd.focus();return false;}if(document.modify_det.szip.value==""){alert("Please Enter Zip Code for Shipping");document.modify_det.szip.focus();return false;}if(document.modify_det.ship_to_phone.value==""){alert("Please Enter Phone for Home");document.modify_det.ship_to_phone.focus();return false;}if(document.modify_det.sfname.value==""){alert("Please Enter Shipping First Name");document.modify_det.sfname.focus();return false;}if(document.modify_det.slname.value==""){alert("Please Enter Shipping Last Name");document.modify_det.slname.focus();return false;}if(document.modify_det.sadd1.value==""){alert("Please Enter Shipping Address");document.modify_det.sadd1.focus();return false;}if(document.modify_det.scity.value==""){alert("Please Enter the Shipping Address City");document.modify_det.scity.focus();return false;}if(document.modify_det.scountry.value==""){alert("Please select Shipping Country");document.modify_det.scountry.focus();return false;}if((document.modify_det.scountry.value!="United States of America")&&(document.modify_det.sstate_txt.value=="")){alert("Please Enter Shipping State");document.modify_det.sstate_txt.focus();return false;}if((document.modify_det.scountry.value=="United States of America")&&(document.modify_det.sstate_dd.value=="")){alert("Please Enter Shipping State");document.modify_det.sstate_dd.focus();return false;}if(document.modify_det.szip.value==""){alert("Please Enter Zip Code for Shipping");document.modify_det.szip.focus();return false;}if(document.modify_det.ship_to_phone.value==""){alert("Please Enter Phone for Home");document.modify_det.ship_to_phone.focus();return false;}}function fill(){if(document.modify_det.bcountry.value!="United States of America"){document.getElementById("div3").style.display="none";document.getElementById("div4").style.display="block";document.modify_det.sstate_txt.value=document.modify_det.bstate_txt.value;}if(document.modify_det.bcountry.value=="United States of America"){document.getElementById("div3").style.display="block";document.getElementById("div4").style.display="none";document.modify_det.sstate_dd.value=document.modify_det.bstate_dd.value;}document.modify_det.scountry.value=document.modify_det.bcountry.value;document.modify_det.sfname.value=document.modify_det.bfname.value;document.modify_det.slname.value=document.modify_det.blname.value;document.modify_det.sadd1.value=document.modify_det.badd1.value;document.modify_det.sadd2.value=document.modify_det.badd2.value;document.modify_det.scity.value=document.modify_det.bcity.value;document.modify_det.sstate.value=document.modify_det.bstate.value;document.getElementById("sstate").value=document.getElementById("bstate").value;document.modify_det.szip.value=document.modify_det.bzip.value;document.modify_det.ship_to_company.value=document.modify_det.bill_to_company.value;document.modify_det.scountry.value=document.modify_det.bcountry.value;document.modify_det.scountry.value=document.modify_det.bcountry.value;document.modify_det.ship_to_phone.value=document.modify_det.bill_to_phone.value;document.modify_det.ship_to_company_phone.value=document.modify_det.bill_to_company_phone.value;}function remove_ship1(){document.getElementById("alt_ship1").style.display="";chck_all_form=0;document.modify_det.bfname.focus();}function setAndReset(box){if(document.modify_det.bcountry.value=="United States of America"){document.getElementById("div1").style.display="block";document.getElementById("div2").style.display="none";}else{document.getElementById("div2").style.display="block";document.getElementById("div1").style.display="none";}}function setAndReset1(box){if(document.modify_det.scountry.value=="United States of America"){document.getElementById("div3").style.display="block";document.getElementById("div4").style.display="none";}else{document.getElementById("div4").style.display="block";document.getElementById("div3").style.display="none";}}function chk_country(){if(document.modify_det.bcountry.value=="United States of America"){document.getElementById("div1").style.display="block";document.getElementById("div2").style.display="none";}else{if(document.modify_det.bcountry.value!="United States of America"){document.getElementById("div2").style.display="block";document.getElementById("div1").style.display="none";}}if(document.modify_det.scountry.value=="United States of America"){document.getElementById("div3").style.display="block";document.getElementById("div4").style.display="none";}else{if(document.modify_det.scountry.value!="United States of America"){document.getElementById("div4").style.display="block";document.getElementById("div3").style.display="none";}}}function chkship(vals,typ){var ss;ss=vals.split("_");if(document.del.count_pharmacy.value==1){if(document.del.optship[0].checked==true){phaship=document.del.optship[0].value;}else{if(document.del.optship[1].checked==true){phaship=document.del.optship[1].value;}}pha_ship1=phaship.split("_");pha_ship_amt=pha_ship1[0];}else{pha_ship_amt=0;}if(document.del.count_otc.value==1){if(document.del.optship1[0].checked==true){otcship=document.del.optship1[0].value;}else{if(document.del.optship1[1].checked==true){otcship=document.del.optship1[1].value;}}otc_ship1=otcship.split("_");otc_ship_amt=otc_ship1[0];}else{otc_ship_amt=0;}if(document.del.count_lens.value==1){if(document.del.optship2[0].checked==true){lensship=document.del.optship2[0].value;}else{if(document.del.optship2[1].checked==true){lensship=document.del.optship2[1].value;}}lens_ship1=lensship.split("_");lens_ship_amt=lens_ship1[0];}else{lens_ship_amt=0;}if(document.del.count_pets.value==1){if(document.del.optship3[0].checked==true){petsship=document.del.optship3[0].value;}else{if(document.del.optship3[1].checked==true){petsship=document.del.optship3[1].value;}}pets_ship1=petsship.split("_");pets_ship_amt=pets_ship1[0];}else{pets_ship_amt=0;}if(ss[2]=="Y"){document.del.final_amt.value=parseFloat(document.del.tot_amt_b.value)+parseFloat(ss[0]);document.del.final_amt.value=formatNumber(document.del.final_amt.value,2);}else{document.del.final_amt.value=parseFloat(document.del.tot_amt_b.value)+parseFloat(ss[0]);document.del.final_amt.value=formatNumber(document.del.final_amt.value,2);}if(document.del.hidship_handling.value!=""){document.del.final_amt.value=parseFloat(document.del.final_amt.value)+parseFloat(document.del.hidship_handling.value);}if(document.del.count_pharmacy.value==1){if(typ=="PHA"){document.del.final_amt.value=parseFloat(document.del.final_amt.value)+parseFloat(otc_ship_amt)+parseFloat(lens_ship_amt)+parseFloat(pets_ship_amt);}}if(document.del.count_otc.value==1){if(typ=="OTC"){document.del.final_amt.value=parseFloat(document.del.final_amt.value)+parseFloat(pha_ship_amt)+parseFloat(lens_ship_amt)+parseFloat(pets_ship_amt);}}if(document.del.count_lens.value==1){if(typ=="Lens"){document.del.final_amt.value=parseFloat(document.del.final_amt.value)+parseFloat(otc_ship_amt)+parseFloat(pha_ship_amt)+parseFloat(pets_ship_amt);}}if(document.del.count_pets.value==1){if(typ=="Pets"){document.del.final_amt.value=parseFloat(document.del.final_amt.value)+parseFloat(otc_ship_amt)+parseFloat(pha_ship_amt)+parseFloat(lens_ship_amt);}}txtnewval=document.del.final_amt.value;document.del.final_amt1.value="$"+txtnewval;}function formatNumber(myNum,numOfDec){var decimal=1;for(i=1;i<=numOfDec;i++){decimal=decimal*10;}var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec);return myFormattedNum;}function change_val(val1,val2){document.getElementById(val2).selectedIndex=document.getElementById(val1).selectedIndex;}function change_val1(val1){}function chk_lens(){error="";error1="";err=0;if(document.getElementById("Leftqty_1").selectedIndex>0){if(document.getElementById("basecurve_1").selectedIndex==""){error="Left Eye Base Curve\n";}if(document.getElementById("power_1").selectedIndex==""){error=error+"Left Eye Power\n";}if(document.getElementById("cyl_flag").value=="1"){if(document.getElementById("cylinder_1").selectedIndex==""){error=error+"Left Eye Cylinder\n";}}if(document.getElementById("ax_flag").value=="1"){if(document.getElementById("axis_1").selectedIndex==""){error=error+"Left Eye Axis\n";}}if(document.getElementById("col_flag").value=="1"){if(document.getElementById("color_1").selectedIndex==""){error=error+"Left Eye Color\n";}}if(document.getElementById("d_n_flag").value=="1"){if(document.getElementById("d_n_1").selectedIndex==""){error=error+"Left Eye D/N \n";}}if(document.getElementById("pwr_flag").value=="1"){if(document.getElementById("pwr_1").selectedIndex==""){error1=error1+"Left Eye Add Power\n";}}if(error!=""){alert("Please enter the required prescription information below:\n"+error);return false;}}else{err=1;}if(document.getElementById("Leftqty_2").selectedIndex>0){if(document.getElementById("basecurve_2").selectedIndex==""){error1="Right Eye Base Curve\n";}if(document.getElementById("power_2").selectedIndex==""){error1=error1+"Right Eye Power\n";}if(document.getElementById("cyl_flag").value=="1"){if(document.getElementById("cylinder_2").selectedIndex==""){error1=error1+"Right Eye Cylinder\n";}}if(document.getElementById("ax_flag").value=="1"){if(document.getElementById("axis_2").selectedIndex==""){error1=error1+"Right Eye Axis\n";}}if(document.getElementById("col_flag").value=="1"){if(document.getElementById("color_2").selectedIndex==""){error1=error1+"Right Eye Color\n";}}if(document.getElementById("d_n_flag").value=="1"){if(document.getElementById("d_n_2").selectedIndex==""){error1=error1+"Right Eye D/N \n";}}if(document.getElementById("pwr_flag").value=="1"){if(document.getElementById("pwr_2").selectedIndex==""){error1=error1+"Right Eye Add Power\n";}}if(error1!=""){alert("Please enter the required prescription information below:\n"+error1);return false;}}else{err=err+1;}if(err==2){alert("Either the left or right eye prescription is required");return false;}}
