function flip_tabs(layer,li){document.getElementById(layer).style.display='block';document.getElementById(li).className='at';for(var i=1;i<6;i++){if(layer!='content-'+i){document.getElementById('content-'+i).style.display='none';document.getElementById('li-content-'+i).className='notat';}}}
function emma_pop(){window.open('https://app.e2ma.net/app/view:Join/signupId:41109','signup','menubar=no,location=no,toolbar=no,scrollbars=yes,height=500');return true;}
function confirm_aero(){var answer=confirm('Please review your cart before proceeding, click OK to continue checkout.\n\nPlease Note:\n------------------------------------\n1. Once you click OK, your cart will be transferred to Google Checkout.\n2. If you would like edit your cart now, please click Cancel.\n3. If you would like to edit your cart after clicking OK, please re-add desired items to your cart.');if(answer){document.goog.action="goog_pass";return true;}
return false;}
function checkout(){document.forms.goog.submit();return true;}
function confirm_amz(dat){var amz_ans=confirm('Due to the stock level of the following product(s):\n\n    '+dat+'\n\nWe cannot offer checkout via Amazon Payments at this time for these products.  Sorry for the Inconvience.\n\nPlease click "OK" to proceed to Amazon & purchase the rest of your cart.\n     - or -\nClick "Cancel" to choose another checkout method.');if(amz_ans){return true;}
return false;}
function validate_list(form){var field=form.email;var str=field.value;var fname=form.fname.value;var lname=form.lname.value;var zip=form.zip.value;var reg1=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var reg2=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;if(!fname||fname=='* First Name'){alert("Please fill in the 'First Name' field.");return false;}if(!lname||lname=='* Last Name'){alert("Please fill in the 'Last Name' field.");return false;}if(!zip||zip=='* Zip Code'){alert("Please fill in the 'Zip' field.");return false;}
if(!reg1.test(str)&&reg2.test(str)){return true;}else{alert("\""+str+"\" is an invalid e-mail!");field.focus();field.select();return false;}}
var aValue;var nI=0;var aURLArguments=location.search.substring(1).split('&');for(nI=0;nI<aURLArguments.length;nI++){aValue=aURLArguments[nI].split('=');if(aValue[0].toLowerCase()=='srccode'){document.cookie='srccode='+escape(aValue[1])+';expires=';}
if(aValue[0].toLowerCase()=='cpncode'){document.cookie='cpncode='+escape(aValue[1])+';expires=';}
if(aValue[0].toLowerCase()=='refer'){var expDate=new Date();expDate.setTime(expDate.getTime()+30*1000*60*60*24)
document.cookie='refer='+escape(aValue[1])+';expires='+expDate+';path=/';}
if(aValue[0].toLowerCase()=='refer_id'){var expDate=new Date();expDate.setTime(expDate.getTime()+30*1000*60*60*24)
document.cookie='refer='+escape(aValue[1])+';expires='+expDate+';path=/';}}
function per_page_1(){per=document.res_per_page_1.num.options[document.res_per_page_1.num.selectedIndex].value;cat_id=document.res_per_page_1.cat_id.value;sub_id=document.res_per_page_1.sub_id.value;location.href="subcategory?per_page="+per+"&sub_id="+sub_id+"&cat_id="+cat_id;return true;}
function per_page_2(){per=document.res_per_page_2.num.options[document.res_per_page_2.num.selectedIndex].value;cat_id=document.res_per_page_2.cat_id.value;sub_id=document.res_per_page_2.sub_id.value;location.href="subcategory?per_page="+per+"&sub_id="+sub_id+"&cat_id="+cat_id;return true;}
function select_filter(cat_id,sub_id){URL=new String(document.location);vars=URL.split("/");page=vars[3].substring(0,11);if(page=='subcategory'){file=page;}
page2=vars[3].substring(0,13);if(page2=='tags_reg_mark'){file=page2;}
page3=vars[3].substring(0,19);if(page3=='tags_clearance_mark'){file=page3;}
stock_id=document.filter.filter_stock.options[document.filter.filter_stock.selectedIndex].value;location.href=file+"?cat_id="+cat_id+"&sub_id="+sub_id+"&filter_stock="+stock_id;return true;}
function MM_findObj(n,d){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);return x;}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function MM_displayStatusMsg(msgStr){status=msgStr;document.MM_returnValue=true;}
function gotoInNash(){gotoURL=getURL(document.LocForm.inNash);if(gotoURL!==""){location.href=gotoURL;}}
function gotoInMTN(){gotoURL=getURL(document.LocForm.inMTN);if(gotoURL!==""){location.href=gotoURL;}}
function PopupNoShip(msgtext){url='noship?man_msgtext='+msgtext;window.open(url,'noship','height=170,width=370');}
function getURL(o){for(i=0;i<o.length;i++){if(o[i].selected==true){return o[i].value;}}
return"";}
function CheckMyInput(){var name=document.app.Fname.value;if(name.length==0){alert("Please fill the Name Field!");return false;}}
function callSubmit()
{document.frmApplicationTermsCond.submit();}
function check_bill(check){alert(check.value);if(check.value){showLayers('billing');}else{showLayers('nobilling');}}
var origWidth,origHeight;if(document.layers){origWidth=window.innerWidth;origHeight=window.innerHeight;window.onresize=function(){if(window.innerWidth!=origWidth||window.innerHeight!=origHeight)history.go(0);}}
var cur_lyr;function swapLayers(id){if(cur_lyr)hideLayer(cur_lyr);showLayer(id);cur_lyr=id;}
function showLayer(id){var lyr=getElemRefs(id);if(lyr&&lyr.css)lyr.css.visibility="visible";}
function hideLayer(id){var lyr=getElemRefs(id);if(lyr&&lyr.css)lyr.css.visibility="hidden";}
function getElemRefs(id){var el=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:(document.layers)?document.layers[id]:null;if(el)el.css=(el.style)?el.style:el;return el;}
function check_pri_phone_1(){var digits_pri_1=document.create_account.pri_phone_1.value.length+1;if(digits_pri_1<=3){document.create_account.pri_phone_1.focus();}
else{document.create_account.pri_phone_2.focus();}}
function check_pri_phone_2(){var digits_pri_2=document.create_account.pri_phone_2.value.length+1;if(digits_pri_2<=3){document.create_account.pri_phone_2.focus();}
else{document.create_account.pri_phone_3.focus();}}
function check_alt_phone_1(){var digits_alt_1=document.create_account.alt_phone_1.value.length+1;if(digits_alt_1<=3){document.create_account.alt_phone_1.focus();}
else{document.create_account.alt_phone_2.focus();}}
function check_alt_phone_2(){var digits_alt_2=document.create_account.alt_phone_2.value.length+1;if(digits_alt_2<=3){document.create_account.alt_phone_2.focus();}
else{document.create_account.alt_phone_3.focus();}}
function submit_form(){document.product.submit();}
