function viewform(m, w, h, scrol) { var scrolling = 'no'; var settings; var LeftPosition; var TopPosition; var win; if (!scrol) scrol = 'no'; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrol; if (scrol == 'no') settings = settings + ',resizable=no,maximize=no'; if (scrol == 'yes') settings = settings + ',resizable=yes,maximize=yes'; settings = settings + ',status=no,toolbar=no,directories=no,menubar=no,location=no'; win = window.open(m, 'pre', settings); win.name = 'name'; win.focus();}
function inputCustomInfo(frm) { var prefix0 = 'get_'; var input_array = new Array('address','city','zip_code'); var error_array = new Array('an Address','a city','a valid zip code'); if (frm.elements['get_first_name'].value.length == 0) { alert('Please enter your first name'); frm.elements['get_first_name'].focus(); return false;}
if (frm.elements['get_last_name'].value.length == 0) { alert('Please enter your last name'); frm.elements['get_last_name'].focus(); return false;}
if (!(validEmail(frm.elements['get_email'].value))) { alert('Please enter a valid email address in the form of email@host.tag.'); frm.elements['get_email'].focus(); return false;}
if (frm.elements['get_password_1'].value.length == 0) { alert('Please enter a password 6-10 characters long using only letters or numbers.'); frm.elements['get_password_1'].focus(); return false;}
if (frm.elements['get_password_2'].value.length == 0) { alert('Please confirm Password.'); frm.elements['get_password_2'].focus(); return false;}
if (frm.elements['get_password_1'].value != frm.elements['get_password_2'].value) { alert('Your password confirmation does not match the original password'); frm.elements['get_password_2'].focus(); return false;}
for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert('Please enter '+error_array[i]); frm.elements[source].focus(); return false;}
}
if (frm.elements['get_zip_code'].value) { myreg = new RegExp("^\\d{5}$"); res = myreg.test(frm.elements['get_zip_code'].value); if (!res) { alert('Please enter a valid zip code'); frm.elements['get_zip_code'].focus(); return false;}
}
return true;}
function isDigit (c) { return ((c >= "0") && (c <= "9"))
}
function isInteger (s,message){ var i; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (!isDigit(c)) { alert(message); return false;}
}
return true;}
function check_duration(obj){ var m = obj.value; var split_m = m.split(":"); if(split_m.length != 3){ alert("Please enter valid duration!");}
else{ if(!isInteger(split_m[0],"Please enter valid duration!")) {obj.focus();}
if(!isInteger(split_m[1],"Please enter valid duration!")) {obj.focus();}
if(!isInteger(split_m[2],"Please enter valid duration!")) {obj.focus();}
}
}
function check_lenght(obj,len){ if (obj.value.length > len){ alert('Too much symbols!'); var str=obj.value; obj.value = str.slice(0,len);}
}
function inputSize(frm){ ref_size = frm.get_ref_size.options[frm.get_ref_size.selectedIndex].value; if (ref_size > 0){ return true;}
else{ alert('You must select a size to add this product to your cart'); return false;}
}
function inputMembership() { return false;}
function inputCustomInfo2(frm) { var prefix0 = 'get_'; var input_array = new Array('address','city','zip_code','ph01','ph02','ph03'); var error_array = new Array('an Address','a city','a valid zip code','a valid phone number', 'a valid phone number','a valid phone number' ); if (frm.elements['get_first_name'].value.length == 0) { alert('Please enter your first name'); frm.elements['get_first_name'].focus(); return false;}
if (frm.elements['get_last_name'].value.length == 0) { alert('Please enter your last name'); frm.elements['get_last_name'].focus(); return false;}
if (!(validEmail(frm.elements['get_email'].value))) { alert('Please enter a valid email address in the form of email@host.tag.'); frm.elements['get_email'].focus(); return false;}
for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert('Please enter '+error_array[i]); frm.elements[source].focus(); return false;}
}
if (frm.elements['get_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_zip_code'].value); if (frm.elements['get_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid zip code'); frm.elements['get_zip_code'].focus(); return false;}
}
if (frm.elements['get_ph01'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_ph01'].value); if (frm.elements['get_ph01'].value == '0') res = 0; if (!res) { alert('Please enter a valid phone number'); frm.elements['get_ph01'].focus(); return false;}
}
if (frm.elements['get_ph02'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_ph02'].value); if (frm.elements['get_ph02'].value == '0') res = 0; if (!res) { alert('Please enter a valid phone number'); frm.elements['get_ph02'].focus(); return false;}
}
if (frm.elements['get_ph03'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_ph03'].value); if (frm.elements['get_ph03'].value == '0') res = 0; if (!res) { alert('Please enter a valid phone number'); frm.elements['get_ph03'].focus(); return false;}
}
return true;}
function validEmail(email) { invalidChars = " /:,;"; if (email == "") { return false;}
for (i=0; i<invalidChars.length;i++) { badChar = invalidChars.charAt(i); if (email.indexOf(badChar,0) > -1) { return false;}
}
atPos = email.indexOf("@",1); if (atPos == -1) { return false;}
if (email.indexOf("@",atPos+1) > -1) { return false;}
periodPos = email.indexOf(".",atPos); if (periodPos == -1) { return false;}
if (periodPos+3 > email.length) { return false;}
return true;}
function viewform(m, w, h, scrol) { var scrolling = 'no'; var settings; var LeftPosition; var TopPosition; var win; if (!scrol) scrol = 'no'; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrol; if (scrol == 'no') settings = settings + ',resizable=no,maximize=no'; if (scrol == 'yes') settings = settings + ',resizable=yes,maximize=yes'; settings = settings + ',status=no,toolbar=no,directories=no,menubar=no,location=no'; win = window.open(m, 'pre', settings); win.name = 'name'; win.focus();}
function changePswd(frm) { if (frm.elements['get_password_1'].value.length == 0) { alert('Please enter a password 6-10 characters long using only letters or numbers.'); frm.elements['get_password_1'].focus(); return false;}
if (frm.elements['get_password_2'].value.length == 0) { alert('Please enter a Re-Password.'); frm.elements['get_password_2'].focus(); return false;}
if (frm.elements['get_password_1'].value != frm.elements['get_password_2'].value) { alert('Your password confirmation does not match the original password'); frm.elements['get_password_2'].focus(); return false;}
return true;}
function check_basket_quantity(frm) { var i; var sum; for (i=0; i < frm.elements.length; i++) { if (frm.elements[i].type == "text") { if ((frm.elements[i].value.length == 0) || (frm.elements[i].value == 0)) { alert('Quantity should be greater than 0'); frm.elements[i].focus(); return false;}
myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements[i].value); if (!res) { alert('Quantity should be digit'); frm.elements[i].focus(); return false;}
}
}
return true;}
function validateQty(frm) { var i; var sum; sum=0; for (i=0; i < frm.elements.length; i++) { if (frm.elements[i].type == "text") { if (frm.elements[i].value > 0) { sum=sum+1;}
myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements[i].value); if (!res) { alert('Quantity should be digit'); frm.elements[i].focus(); return false;}
}
}
if (sum > 0)
return true; else{ alert('Quantity should be greater than 0'); return false;}
}
function useCustomInfo2(chck, frm, prefix, prefix2) { var prefix0 = 'get_'; var input_array = new Array('firstname','lastname','email','address','city','zip_code','phone'); var select_array = new Array('ref_country', 'ref_state'); if (chck.checked) { for (var i=0; i<input_array.length; i++) { var source = prefix0+prefix+input_array[i]; var destin = prefix0+prefix2+input_array[i]; frm.elements[destin].value = frm.elements[source].value;}
for (var i=0; i<select_array.length; i++) { var source = prefix0+prefix+select_array[i]; var destin = prefix0+prefix2+select_array[i]; frm.elements[destin].options.length = 0; for (var j=0; j < frm.elements[source].options.length; j++) { frm.elements[destin].options.length = j+1; frm.elements[destin].options[j].value = frm.elements[source].options[j].value; frm.elements[destin].options[j].text = frm.elements[source].options[j].text;}
frm.elements[destin].selectedIndex = frm.elements[source].selectedIndex;}
}
return true;}
function useBillingInfo(chck, frm, prefix, prefix2) { var prefix0 = 'get_'; var input_array = new Array('firstname','lastname','email','address','city','zip_code','ph01','ph02','ph03','ph04'); var select_array = new Array('ref_country', 'ref_state'); if (chck.checked) { for (var i=0; i<input_array.length; i++) { var source = prefix0+prefix+input_array[i]; var destin = prefix0+prefix2+input_array[i]; frm.elements[destin].value = frm.elements[source].value;}
for (var i=0; i<select_array.length; i++) { var source = prefix0+prefix+select_array[i]; var destin = prefix0+prefix2+select_array[i]; frm.elements[destin].options.length = 0; for (var j=0; j < frm.elements[source].options.length; j++) { frm.elements[destin].options.length = j+1; frm.elements[destin].options[j].value = frm.elements[source].options[j].value; frm.elements[destin].options[j].text = frm.elements[source].options[j].text;}
frm.elements[destin].selectedIndex = frm.elements[source].selectedIndex;}
}
return true;}
function OrderCheckout(frm) { var flag=0; for (var i=0; i<frm.elements.length; i++){ if(frm.elements[i].type == "radio"){ if(frm.elements[i].checked == true){ flag = 1;}
}
}
if (flag == 0){ alert('Please select Shipping Type.'); return false;}
for (var i=0; i<frm.elements.length; i++)
if(frm.elements[i].name == 'ref_order'){ if(frm.elements[i].value > 0 )
frm.submit(); return false;}
alert('Please calculate order'); return false;}
function inputOrderInfo(frm) { var prefix0 = 'get_'; var input_array = new Array('billing_firstname','billing_lastname','billing_address','billing_city','billing_zip_code', 'shipping_firstname','shipping_lastname','shipping_email','shipping_address','shipping_city','shipping_zip_code' ); var error_array = new Array('Billing Firstname','Billing Lastname','Billing Address','Billing City','Billing Zip Code', 'Shipping Firstname','Shipping Lastname','Shipping Email','Shipping Address','Shipping City','Shipping Zip Code' ); for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' can not be empty '); frm.elements[source].focus(); return false;}
}
if (frm.elements['get_billing_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_billing_zip_code'].value); if (frm.elements['get_billing_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid billing zip code'); frm.elements['get_billing_zip_code'].focus(); return false;}
}
if (frm.elements['get_shipping_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_shipping_zip_code'].value); if (frm.elements['get_shipping_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid shipping zip code'); frm.elements['get_shipping_zip_code'].focus(); return false;}
}
return true;}
function inputOrderBillingInfo(frm) { var prefix0 = 'get_'; var input_array = new Array('billing_firstname','billing_lastname','billing_email','billing_address','billing_city','billing_zip_code'); var error_array = new Array('Billing Firstname','Billing Lastname','Billing Email','Billing Address','Billing City','Billing Zip Code'); for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' can not be empty '); frm.elements[source].focus(); return false;}
}
if (frm.elements['get_billing_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_billing_zip_code'].value); if (frm.elements['get_billing_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid billing zip code'); frm.elements['get_billing_zip_code'].focus(); return false;}
}
return true;}
function inputOrderShippingInfo(frm) { var prefix0 = 'get_'; var input_array = new Array('shipping_firstname','shipping_lastname','shipping_email','shipping_address','shipping_city','shipping_zip_code'); var error_array = new Array('Shipping Firstname','Shipping Lastname','Shipping Email','Shipping Address','Shipping City','Shipping Zip Code'); for (var i=0; i<input_array.length; i++) { var source = prefix0+input_array[i]; if (frm.elements[source].value.length == 0) { alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' can not be empty '); frm.elements[source].focus(); return false;}
}
if (frm.elements['get_shipping_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_shipping_zip_code'].value); if (frm.elements['get_shipping_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid shipping zip code'); frm.elements['get_shipping_zip_code'].focus(); return false;}
}
return true;}
function checkReg2(frm) { var input_array = new Array('first_name','last_name','email'); var error_array = new Array('Firstname','Lastname','Email'); for (var i=0; i<input_array.length; i++) { var source = input_array[i]; if (frm.elements[source].value.length == 0) { alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' can not be empty '); frm.elements[source].focus(); return false;}
}
if(!validEmail(frm.elements['email'].value)){ alert('Please enter a valid email'); frm.elements['email'].focus(); return false;}
frm.elements['agreement'].value = frm.elements['agreement'].value.toLowerCase(); return true;}
function inputOrderShippingZIP(frm) { if (frm.elements['get_shipping_zip_code'].value.length == 0) { alert('Please enter a valid shipping zip code'); frm.elements['get_shipping_zip_code'].focus(); return false;}
if (frm.elements['get_shipping_zip_code'].value) { myreg = new RegExp("^\\d+$"); res = myreg.test(frm.elements['get_shipping_zip_code'].value); if (frm.elements['get_shipping_zip_code'].value == '0') res = 0; if (!res) { alert('Please enter a valid shipping zip code'); frm.elements['get_shipping_zip_code'].focus(); return false;}
}
frm.submit(); return false;}
function HideALL() { if (document.all) { document.all['UPS'].style.display = "none"
document.all['FIXED'].style.display = "none"
}else if (document.getElementById) { document.getElementById('UPS').style.display = "none"
document.getElementById('FIXED').style.display = "none"
}
}
function ShowDIV(sDIV) { HideALL(); if (document.all) { document.all[sDIV].style.display = "block"
}else if (document.getElementById) { document.getElementById(sDIV).style.display = "block"
}
}
function onOrderAdd(frm) { if (!inputOrderShippingInfo(frm)) return false; if (!frm.shipping_flag.value) { alert('Shipping must be calculated before order processing.'); return false;}
if (!frm.discount_flag.value) { alert('Discount coupon was not found in our database or expired. Please specify valid code or continue without it.'); return false;}
return true;}
function resize() { var i=0; var LeftPosition; var TopPosition; var w; var h; if (navigator.appName == 'Netscape') i=40; if (document.images[0].name != 'close')
{ w = document.images[0].width+100; h = document.images[0].height+130-i; window.resizeTo(w, h); LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; window.moveTo(LeftPosition, TopPosition);}else{ w = 420; h = 370; window.resizeTo(w, h); LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; window.moveTo(LeftPosition, TopPosition);}
self.focus();}
function viewform(m, w, h) { var scroll = 'yes'; var settings; var LeftPosition; var TopPosition; var win; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll; settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no,dependent=yes'; win = window.open(m, 'pre', settings); win.name = 'name'; win.focus(); return false;}
ourDate = new Date( ); document.cookie = "bbtimezone=" + ourDate.getTimezoneOffset( ) + "; myexpires=0"; function onCategoryNavJump(sel) { str = sel.options[sel.selectedIndex].value; window.location.href=str+'-Coaching';}

