var SVP="//www.ushomeproducts.com/";var SSL="https://www.ushomeproducts.com/";function chk_login(obj){if(obj.login_email.value==""){alert("Please enter email to login");obj.login_email.focus();return false;}if(obj.login_password.value==""){alert("Please enter your password to login");obj.login_password.focus();return false;}return true;}function reg_chk(){if(document.reg_frm.reg_fname.value==""){alert("Please enter your first name.");document.reg_frm.reg_fname.focus();return false;}if(document.reg_frm.reg_lname.value==""){alert("Please enter your last name.");document.reg_frm.reg_lname.focus();return false;}if(document.reg_frm.reg_email.value==""){alert("Please enter your email address.");document.reg_frm.reg_email.focus();return false;}var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(document.reg_frm.reg_email.value.search(reg)=="-1"){alert('Invalid email address');document.reg_frm.reg_email.focus();return false;}if(document.reg_frm.reg_cemail.value==""){alert("Please enter your confirm email address.");document.reg_frm.reg_cemail.focus();return false;}if(document.reg_frm.reg_cemail.value.search(reg)=="-1"){alert('Invalid confirm email address');document.reg_frm.reg_cemail.focus();return false;}if(document.reg_frm.reg_email.value!=document.reg_frm.reg_cemail.value){alert("Please repeat your confirm email address. Both email address must be the same.");document.reg_frm.reg_cemail.focus();return false}if(document.reg_frm.reg_password.value==""){alert("Please enter your password.");document.reg_frm.reg_password.focus();return false;}if(document.reg_frm.reg_password.value.length<4){alert("Your password must contain 4 characters or more.");document.reg_frm.reg_password.focus();return false}if(document.reg_frm.reg_cpassword.value==""){alert("Please enter your confirm password.");document.reg_frm.reg_cpassword.focus();return false;}if(document.reg_frm.reg_cpassword.value.length<4){alert("Your confirm password must contain 4 characters or more.");document.reg_frm.reg_cpassword.focus();return false}if(document.reg_frm.reg_cpassword.value!=document.reg_frm.reg_password.value){alert("Please repeat your password. Both passwords must be the same.");document.reg_frm.reg_cpassword.focus();return false}if(document.reg_frm.howdidyoufind.selectedIndex==0){alert("Please tell us how you found us.");document.reg_frm.howdidyoufind.focus();return false;}if(document.reg_frm.captcha.value==""){alert("Please enter your security code.");document.reg_frm.captcha.focus();return false;}if(document.reg_frm.agree.checked!=true){alert("You must tick the checkbox at the bottom to confirm you agree with our Terms and Conditions.");document.reg_frm.agree.focus();return false;}return true;}function toggleblock_other(){if(document.reg_frm.howdidyoufind.selectedIndex==6){document.getElementById("toggleblock_other").style.display="block";document.reg_frm.howdidyoufind_other.focus();return true;}else{document.getElementById("toggleblock_other").style.display="none";return true;}}function chk_password(){if(document.fpass_frm.forgot_email.value==""){alert("Please enter your email address.");document.fpass_frm.forgot_email.focus();return false;}var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(document.fpass_frm.forgot_email.value.search(reg)=="-1"){alert('Invalid Email Address');document.fpass_frm.forgot_email.focus();return false;}return true;}function send_verification_mail(a){document.verify_frm.uid.value=a;document.verify_frm.submit();}function sel_finish(obj){var val=obj.id.split("_");var ds_id=this.document.getElementById("ds_id").value;this.finish_ifr.document.getElementById("selectfinish").childNodes[0].nodeValue=val[1];this.glaze_ifr.document.getElementById("selectglaze").childNodes[0].nodeValue="No Glaze"; js_xml_form_submit("door_style.php","act=finish_glazes&fsh_id="+obj.value+"&ds_id="+ds_id);}function sel_glaze(obj){var val=obj.id.split("_");var ds_id=this.document.getElementById("ds_id").value;this.glaze_ifr.document.getElementById("selectglaze").childNodes[0].nodeValue=val[1]; js_xml_form_submit("catalog.php","act=calculate_glaze&glz_id="+obj.value+"&ds_id="+ds_id);}function tab_visible(id){var ds_id=this.document.getElementById("ds_id").value;var tab_list=document.getElementById("tab_list").value;var tab_arr=tab_list.split(',');for(i=0;i";}document.getElementById(id+"_tab").className="active";js_xml_form_submit("catalog.php","act=catalog_list&pc_id="+id+"&ds_id="+ds_id);}function show_container(cid){var id="container_"+cid;var id2="show_"+cid;if(this.document.getElementById(id)){if(this.document.getElementById(id).style.display=="none"){this.document.getElementById(id).style.display="";this.document.getElementById(id2).innerHTML="Hide  ";}else{this.document.getElementById(id).style.display="none";this.document.getElementById(id2).innerHTML="Expand  ";}}}function display_category(cid,ds_id){var id="container_"+cid;var id2="show_"+cid;if(this.document.getElementById(id).style.display=="none"){this.document.getElementById(id).style.display="";this.document.getElementById(id2).innerHTML="Hide  ";}else{this.document.getElementById(id).style.display="none";this.document.getElementById(id2).innerHTML="Expand  ";checkPageHeight();}}function force_show_cat(cid){var id="container_"+cid;var id2="show_"+cid;this.document.getElementById(id).style.display="";this.document.getElementById(id2).innerHTML="Hide  ";}function add_cart(frm_obj){var finish_val=parent.finish_ifr.document.getElementById("selectfinish").childNodes[0].nodeValue;var glaze_val=parent.glaze_ifr.document.getElementById("selectglaze").childNodes[0].nodeValue;if(parent.document.getElementById("tot_finish").value>0&&finish_val=="Finish Selector"){alert("Please choose the finish of this door style.");return false;}if(parent.document.getElementById("tot_glaze").value>0&&glaze_val=="Glaze Selector"){alert("Please choose the glaze of this door style.");return false;}var err_attr=0;for(var i=0;i0){style="";empty_style="none";}document.getElementById("empty_scart").style.display=empty_style;document.getElementById("scart_qty").style.display=style;document.getElementById("scart_qty").innerHTML=""+qty+" Items in cart ";document.getElementById("scart_amount").style.display=style;document.getElementById("scart_amount").innerHTML=" $"+amt+" Total";}function removeOptions(id){var selectObj=this.glaze_ifr.document.getElementById(id);var i;for(i=selectObj.length-1;i>=0;i--){selectObj.remove(i);}}function addOption(id,opt_txt,opt_val){var selOptNew=this.glaze_ifr.document.createElement('option');selOptNew.text=opt_txt;selOptNew.value=opt_val;var selectObj=this.glaze_ifr.document.getElementById(id);try{selectObj.add(selOptNew,null);}catch(ex){selectObj.add(selOptNew);}}function select_finish(title){var id="finish_"+title;this.document.getElementById(id).checked=true;sel_finish(this.document.getElementById(id));}function select_glaze(title){var id="glaze_"+title;this.document.getElementById(id).checked=true;sel_glaze(this.document.getElementById(id));}function set_item_qty(ocid,type){var id="prod_qty_"+ocid;var qty=parseInt(this.document.getElementById(id).value);if(type=="up"){qty=qty+1;}else{qty=qty-1;}if(qty<=0){qty=1;}this.document.getElementById(id).value=qty;document.cart_frm.act.value="cart_recalc";js_xml_form_submit(SSL+"cart.php",js_form_submit(document.cart_frm));return false;}function show_shipping_address(){var obj=this.document.cart_frm;if(obj.same_address.checked==true){obj.shipping_fname.value=obj.billing_fname.value;obj.shipping_lname.value=obj.billing_lname.value;obj.shipping_company.value=obj.billing_company.value;obj.shipping_address1.value=obj.billing_address1.value;obj.shipping_address2.value=obj.billing_address2.value;obj.shipping_city.value=obj.billing_city.value;obj.shipping_state.value=obj.billing_state.value;obj.shipping_state1.value=obj.billing_state1.value;obj.shipping_country.value=obj.billing_country.value;obj.shipping_zipcode.value=obj.billing_zipcode.value;obj.shipping_phone1.value=obj.billing_phone1.value;obj.shipping_phone2.value=obj.billing_phone2.value;obj.shipping_phone3.value=obj.billing_phone3.value;}else{obj.shipping_fname.value="";obj.shipping_lname.value="";obj.shipping_company.value="";obj.shipping_address1.value="";obj.shipping_address2.value="";obj.shipping_city.value="";obj.shipping_state.value="-1";obj.shipping_state1.value="";obj.shipping_country.value="-1";obj.shipping_zipcode.value="";obj.shipping_phone1.value="";obj.shipping_phone2.value="";obj.shipping_phone3.value="";}}function show_state(a){var state=a+"_state";var state1=a+"_state1";var country=a+"_country";if(this.document.getElementById(country).value=="1"){this.document.getElementById(state).style.display="";this.document.getElementById(state1).style.display="none";}else{this.document.getElementById(state).style.display="none";this.document.getElementById(state1).style.display="";}}function show_cart_step(m){var bar_title=new Array("Step 1 - Register/Login","Step 2 - Billing/Shipping Address","Step 3 - Review Order","Step 4 - Payment Options","Step 5 - Finalize Order");for(i=1;i<=5;i++){if(i1&&document.cart_frm.billing_state1.value==""){err+="- Please enter the state of the billing section \n";}if(document.cart_frm.billing_country.value=="-1"){err+="- Please choose the country of the billing section \n";}if(document.cart_frm.billing_zipcode.value==""){err+="- Please enter zipcode of the billing section \n";}if(document.cart_frm.billing_phone1.value==""&&document.cart_frm.billing_phone2.value==""&&document.cart_frm.billing_phone3.value==""){err+="- Please enter the first name of the billing section \n";}if(document.cart_frm.shipping_fname.value==""){err+="- Please enter the first name of the shipping section \n";}if(document.cart_frm.shipping_lname.value==""){err+="- Please enter the last name of the shipping section \n";}if(document.cart_frm.shipping_address1.value==""){err+="- Please enter the address of the shipping section \n";}if(document.cart_frm.shipping_city.value==""){err+="- Please enter the city of the shipping section \n";}if(document.cart_frm.billing_country.value=="-1"&&document.cart_frm.shipping_state1.value==""&&document.cart_frm.shipping_state.value=="-1"){err+="- Please enter the state of the shipping section \n";}if(document.cart_frm.shipping_country.value==1&&document.cart_frm.shipping_state.value=="-1"){err+="- Please choose the US State of the shipping section \n";}if(document.cart_frm.shipping_country.value>1&&document.cart_frm.shipping_state1.value==""){err+="- Please enter the state of the shipping section \n";}if(document.cart_frm.shipping_country.value=="-1"){err+="- Please choose the country of the shipping section \n";}if(document.cart_frm.shipping_zipcode.value==""){err+="- Please enter zipcode of the shipping section \n";}if(document.cart_frm.shipping_phone1.value==""&&document.cart_frm.shipping_phone2.value==""&&document.cart_frm.shipping_phone3.value==""){err+="- Please enter the phone of the shipping section \n";}if(err!=""){alert("Kindly provide us the missing or incorrect information of billing/shipping section enclosed below \n"+err);return false;}this.document.cart_frm.act.value="cart_address_proceed";js_xml_form_submit(SSL+"cart.php",js_form_submit(this.document.cart_frm));return false;}function cart_creditcard_chk(){var err="";if(document.cart_frm.cart_cc_type.value==""){err+="- Please credit card type in payment section \n";}if(document.cart_frm.cart_cc_no.value==""){err+="- Please enter the credit card number in payment section \n";}var card_len=document.cart_frm.cart_cc_no.value.length;if(document.cart_frm.cart_cc_no.value!=""&&(card_len<15||card_len>16)){err+="- Please enter the correct card number in payment section \n";}if(document.cart_frm.cart_ccv_number.value==""){err+="- Please enter the cvv no of credit card in payment section \n";}var ccv_len=document.cart_frm.cart_ccv_number.value.length;if(document.cart_frm.cart_ccv_number.value!=""&&(ccv_len<3||ccv_len>4)){err+="- Please enter the CVV number in payment section \n";}if(document.cart_frm.cart_zip_number.value==""){err+="- Please enter the zipcode in payment section \n";}if(document.cart_frm.billing_state.value==""){err+="- Please enter the state of the billing section \n";}var today=new Date();var todayYear=today.getFullYear();var todayMonth=today.getMonth()+1;if(todayYear>document.cart_frm.cart_cc_expiry_yy.value){err+="- Please select a valid expire date. \n";}else if(todayYear==document.cart_frm.cart_cc_expiry_yy.value){if(todayMonth>document.cart_frm.cart_cc_expiry_mm.value){err+="- Please select a valid expire date. \n";}}if(err!=""){alert("Kindly provide us the missing or incorrect information of payment section enclosed below \n"+err);return false;}return true;}function chk_payment_method(a){if(this.document.cart_frm.terms.checked==false){alert("Please accept the terms & conditions.");return false;}this.document.cart_frm.payment.value=a;this.document.getElementById("cc_detail").style.display="none";if(a==3){show_cart_step(5);}else if(a==2 || a==5){show_cart_step(5);this.document.getElementById("cc_detail").style.display="";}else{submit_order();}}function submit_order(){document.getElementById('checkout-loader-img').style.display = 'block';if(this.document.cart_frm.payment.value=="2" || this.document.cart_frm.payment.value=="5"){if(!cart_creditcard_chk()){document.getElementById('checkout-loader-img').style.display = 'none';return false;}}this.document.cart_frm.action=SSL+"cart.php";this.document.cart_frm.act.value="cart_payment_proceed";js_xml_form_submit(SSL+"cart.php",js_form_submit(this.document.cart_frm));return false;}function empty_cart(){if(confirm("Are you sure to empty this shopping cart?")){this.document.cart_frm.act.value="empty_order";js_xml_form_submit(SSL+"cart.php",js_form_submit(this.document.cart_frm));}}function show_save_cart(){alert('Please login first to save this cart.');document.save_cart_frm.act.value="save_order_login";document.save_cart_frm.submit();}function save_cart(){if(this.document.save_cart_frm.save_name.value==""){alert("Please enter save cart title.");return false;}this.document.save_cart_frm.act.value="save_order_chk";js_xml_form_submit(SSL+"cart.php",js_form_submit(this.document.save_cart_frm));return false;}function save_cart_alert(title,a){if(confirm("One cart has been already saved as "+title+". Are you sure to overwrite it?")){this.document.save_cart_frm.cart_overwrite_id.value=a;this.document.save_cart_frm.act.value="save_order";this.document.save_cart_frm.submit();}}function chk_personal_info(){var err="";if(document.acc_frm.billing_fname.value==""){err+="- Please enter the first name of the billing section \n";}if(document.acc_frm.billing_lname.value==""){err+="- Please enter the last name of the billing section \n";}if(document.acc_frm.billing_address1.value==""){err+="- Please enter the address of the billing section \n";}if(document.acc_frm.billing_city.value==""){err+="- Please enter the city of the billing section \n";}if(document.acc_frm.billing_country.value=="-1"&&document.acc_frm.billing_state1.value==""&&document.acc_frm.billing_state.value=="-1"){err+="- Please enter the state of the billing section \n";}if(document.acc_frm.billing_country.value==1&&document.acc_frm.billing_state.value=="-1"){err+="- Please choose the US state of the billing section \n";}if(document.acc_frm.billing_country.value>1&&document.acc_frm.billing_state1.value==""){err+="- Please enter the state of the billing section \n";}if(document.acc_frm.billing_country.value=="-1"){err+="- Please choose the country of the billing section \n";}if(document.acc_frm.billing_zipcode.value==""){err+="- Please enter zipcode of the billing section \n";}if(document.acc_frm.billing_phone1.value==""&&document.acc_frm.billing_phone2.value==""&&document.acc_frm.billing_phone3.value==""){err+="- Please enter the first name of the billing section \n";}if(err!=""){alert("Kindly provide us the missing or incorrect information of Personal Info. section enclosed below \n"+err);return false;}this.document.acc_frm.act.value="update_personal_info";js_xml_form_submit(SSL+"myaccount.php",js_form_submit(this.document.acc_frm));return true;}function chk_shipping_info(){var err="";if(document.acc_frm.shipping_fname.value==""){err+="- Please enter the first name of the shipping section \n";}if(document.acc_frm.shipping_lname.value==""){err+="- Please enter the last name of the shipping section \n";}if(document.acc_frm.shipping_address1.value==""){err+="- Please enter the address of the shipping section \n";}if(document.acc_frm.shipping_city.value==""){err+="- Please enter the city of the shipping section \n";}if(document.acc_frm.shipping_country.value=="-1"&&document.acc_frm.shipping_state1.value==""&&document.acc_frm.shipping_state.value=="-1"){err+="- Please enter the state of the shipping section \n";}if(document.acc_frm.shipping_country.value==1&&document.acc_frm.shipping_state.value=="-1"){err+="- Please choose the US state of the shipping section \n";}if(document.acc_frm.shipping_country.value>1&&document.acc_frm.shipping_state1.value==""){err+="- Please enter the state of the shipping section \n";}if(document.acc_frm.shipping_country.value=="-1"){err+="- Please choose the country of the shipping section \n";}if(document.acc_frm.shipping_zipcode.value==""){err+="- Please enter zipcode of the shipping section \n";}if(document.acc_frm.shipping_phone1.value==""&&document.acc_frm.shipping_phone2.value==""&&document.acc_frm.shipping_phone3.value==""){err+="- Please enter the phone of the shipping section \n";}if(err!=""){alert("Kindly provide us the missing or incorrect information of shipping info. section enclosed below \n"+err);return false;}this.document.acc_frm.act.value="update_shipping_info";js_xml_form_submit(SSL+"myaccount.php",js_form_submit(this.document.acc_frm));return true;}function chk_password_info(){var err="";if(document.acc_frm.old_password.value==""){err+="- Please enter the current password. \n";}if(document.acc_frm.new_password.value==""){err+="- Please enter new password.\n";}if(document.acc_frm.new_password.value!=""&&document.acc_frm.new_password.value.length<4){err+="- New password must contain 4 characters or more.";}if(document.acc_frm.new_cpassword.value==""){err+="- Please enter the confirm new password. \n";}if(document.acc_frm.new_cpassword.value!=""&&document.acc_frm.new_cpassword.value.length<4){err+="- Confirm new password must contain 4 characters or more.";}if(document.acc_frm.new_password.value!=document.acc_frm.new_cpassword.value){err+="- Please repeat your new password. Both passwords must be the same. \n";}if(err!=""){alert("Kindly provide us the missing or incorrect information of shipping info. section enclosed below \n"+err);return false;}this.document.acc_frm.act.value="update_password_info";js_xml_form_submit(SSL+"myaccount.php",js_form_submit(this.document.acc_frm));return true;}function show_acc_shipping_address(){var obj=this.document.acc_frm;if(obj.same_address.checked==true){obj.shipping_fname.value=obj.billing_fname.value;obj.shipping_lname.value=obj.billing_lname.value;obj.shipping_company.value=obj.billing_company.value;obj.shipping_address1.value=obj.billing_address1.value;obj.shipping_address2.value=obj.billing_address2.value;obj.shipping_city.value=obj.billing_city.value;obj.shipping_state.value=obj.billing_state.value;obj.shipping_state1.value=obj.billing_state1.value;obj.shipping_country.value=obj.billing_country.value;obj.shipping_zipcode.value=obj.billing_zipcode.value;obj.shipping_phone1.value=obj.billing_phone1.value;obj.shipping_phone2.value=obj.billing_phone2.value;obj.shipping_phone3.value=obj.billing_phone3.value;}else{obj.shipping_fname.value="";obj.shipping_lname.value="";obj.shipping_company.value="";obj.shipping_address1.value="";obj.shipping_address2.value="";obj.shipping_city.value="";obj.shipping_state.value="-1";obj.shipping_state1.value="";obj.shipping_country.value="-1";obj.shipping_zipcode.value="";obj.shipping_phone1.value="";obj.shipping_phone2.value="";obj.shipping_phone3.value="";}}function show_account_step(m){for(i=1;i<=3;i++){this.document.getElementById("step"+i+"_container").style.display="none";if(i0){if(confirm("Loading cart will delete all items currently in the cart. Would you like to proceed?")){this.document.order_frm.oid.value=a;this.document.order_frm.act.value="load_order";this.document.order_frm.submit();}}else{this.document.order_frm.oid.value=a;this.document.order_frm.act.value="load_order";this.document.order_frm.submit();}}function delete_save_cart(a){if(confirm("Are you sure to delete this save kitchen?")){this.document.order_frm.oid.value=a;this.document.order_frm.act.value="delete_save_order";this.document.order_frm.submit();}}function delete_cart(a){if(confirm("Are you sure to delete this order?")){this.document.order_frm.oid.value=a;this.document.order_frm.act.value="delete_view_order";this.document.order_frm.submit();}}function chk_testimonial(){var err="";if(document.acc_frm.testimonial.value==""){err+="- Please enter your feedback. \n";}if(document.acc_frm.person.value==""){err+="- Please enter your name.\n";}if(document.acc_frm.location.value==""){err+="- Please enter your location. \n";}if(err!=""){alert("Kindly provide us the missing or incorrect information of shipping info. section enclosed below \n"+err);return false;}this.document.acc_frm.act.value="save_testimonial";return true;}