<!--

document.oncontextmenu = new Function("if(!event.ctrlKey){event.returnValue=false;}");

function bi_copy_set(theform){
if(theform.bi_flag.checked==true){
theform.si_fname.value=theform.bi_fname.value;
theform.si_lname.value=theform.bi_lname.value;
theform.si_company.value=theform.bi_company.value;
theform.si_address.value=theform.bi_address.value;
theform.si_city.value=theform.bi_city.value;
theform.si_country.value=theform.bi_country.value;
theform.si_state.value=theform.bi_state.value;
theform.si_zip.value=theform.bi_zip.value;
theform.si_phone.value=theform.bi_phone.value;
theform.si_email.value=theform.bi_email.value;
set_tax(theform);
}}

function si_lock_set(theform){
if(theform.si_flag.checked==true){
window.si_div.style.display='none';
theform.si_fname.disabled=true;
theform.si_lname.disabled=true;
theform.si_company.disabled=true;
theform.si_address.disabled=true;
theform.si_city.disabled=true;
theform.si_country.disabled=true;
theform.si_zip.disabled=true;
theform.si_phone.disabled=true;
theform.si_email.disabled=true;
}else{
window.si_div.style.display='';
theform.si_fname.disabled=false;
theform.si_lname.disabled=false;
theform.si_company.disabled=false;
theform.si_address.disabled=false;
theform.si_city.disabled=false;
theform.si_country.disabled=false;
theform.si_zip.disabled=false;
theform.si_phone.disabled=false;
theform.si_email.disabled=false;
}}

function set_si_tax(theform){
if(theform.si_flag.checked==true){
	theform.si_state.value=theform.bi_state.value;
	set_tax(theform);
}}

function set_tax(theform){
if(theform.si_state.value=="TX"){
var tax_val,ss_val,total_val;
ss_val=parseFloat(theform.ol_ss.value);
tax_val=parseFloat(adv_format(ss_val*0.0825,2));
ss_total=adv_format(parseFloat(ss_val+tax_val),2);
theform.ol_tax.value=tax_val;
theform.ol_total.value=ss_total;
window.sts_tax.innerHTML="&nbsp;$ "+tax_val;
window.sts_total.innerHTML="&nbsp;<font color=red>$ "+ss_total+"</font>";
}
else{
theform.ol_tax.value=0;
theform.ol_total.value=theform.ol_ss.value;
window.sts_tax.innerHTML="&nbsp;$ 0";
window.sts_total.innerHTML="&nbsp;<font color=red>$ "+theform.ol_ss.value+"</font>";
}}

function adv_format(value,num)   
    {
    var a_str = formatnumber(value,num);
    var a_int = parseFloat(a_str);
    if (value.toString().length>a_str.length)
        {
        var b_str = value.toString().substring(a_str.length,a_str.length+1)
        var b_int = parseFloat(b_str);
        if (b_int<5) 
            {
            return a_str
            }
        else
            {
            var bonus_str,bonus_int;
            if (num==0)
                {
                bonus_int = 1;
                }
            else
                { 
                bonus_str = "0."
                for (var i=1; i<num; i++)
                    bonus_str+="0";
                bonus_str+="1";
                bonus_int = parseFloat(bonus_str);
                }
            a_str = formatnumber(a_int + bonus_int, num)
            }
        } 

        return a_str
    }

function formatnumber(value,num)    
    {
    var a,b,c,i
    a = value.toString();
    b = a.indexOf('.');
    c = a.length;
    if (num==0)
        {
        if (b!=-1)
            a = a.substring(0,b);
        }
    else
        {
        if (b==-1)
            {
            a = a + "."; 
            for (i=1;i<=num;i++)
                a = a + "0";
            }
        else
            {
            a = a.substring(0,b+num+1);
            for (i=c;i<=b+num;i++)
                a = a + "0";
            }
        }
    return a
    } 
				
function chksubmit(theform) {
if(theform.bi_fname.value==''){
alert("Please Keyin First Name ");
theform.bi_fname.focus();
return false;
}
if(theform.bi_lname.value==''){
alert("Please Keyin Last Name ");
theform.bi_lname.focus();
return false;
}
if(theform.bi_address.value==''){
alert("Please Keyin Address ");
theform.bi_address.focus();
return false;
}
if(theform.bi_city.value==''){
alert("Please Keyin City ");
theform.bi_city.focus();
return false;
}
if(theform.bi_country.value==''){
alert("Please Choose Country ");
theform.bi_country.focus();
return false;
}
if(theform.bi_state.value==''){
alert("Please Choose State ");
theform.bi_state.focus();
return false;
}
if(theform.bi_zip.value==''){
alert("Please keyin Zip/Postal Code ");
theform.bi_zip.focus();
return false;
}
if(theform.bi_phone.value==''){
alert("Please keyin Phone ");
theform.bi_phone.focus();
return false;
}
if(theform.bi_email.value==''){
alert("Please keyin Email Address ");
theform.bi_email.focus();
return false;
}

if (theform.si_flag.checked!=true){
if(theform.si_fname.value==''){
alert("Please Keyin First Name ");
theform.si_fname.focus();
return false;
}
if(theform.si_lname.value==''){
alert("Please Keyin Last Name ");
theform.si_lname.focus();
return false;
}
if(theform.si_address.value==''){
alert("Please Keyin Address ");
theform.si_address.focus();
return false;
}
if(theform.si_city.value==''){
alert("Please Keyin City ");
theform.si_city.focus();
return false;
}
if(theform.si_country.value==''){
alert("Please Choose Country ");
theform.si_country.focus();
return false;
}
if(theform.si_state.value==''){
alert("Please Choose State ");
theform.si_state.focus();
return false;
}
if(theform.si_zip.value==''){
alert("Please keyin Zip/Postal Code ");
theform.si_zip.focus();
return false;
}
if(theform.si_phone.value==''){
alert("Please keyin Phone ");
theform.si_phone.focus();
return false;
}
if(theform.si_email.value==''){
alert("Please keyin Email Address ");
theform.si_email.focus();
return false;
}
}

if(theform.card_name.value == ""){
alert("Please select Credit Card ");
theform.card_name.focus();
return false;
}
if(theform.card_no.value == ""){      
alert("Please Keyin Credit Card NO. ");      
theform.card_no.focus();
return false;
}
if(theform.card_user.value==""){      
alert("Please Input Card Holder's Name ");      
theform.card_user.focus();
return false;
}
if(theform.card_mm.value==""){      
alert("Please Choose ExpDate Month ");      
theform.card_mm.focus();
return false;
}
if(theform.card_yy.value==""){      
alert("Please Choose ExpDate Year ");      
theform.card_yy.focus();
return false;
}

if(theform.card_crc.value==""){
alert("Please Keyin CVV2 Number ");      
theform.card_crc.focus();
return false;
}

if(theform.lockval.value=="1"){
return false;}
theform.lockval.value="1";
return true;
}

function hi_sub(){
//setTimeout("hi_sub()", 500); 
window.sts_sub.innerHTML="<img src='img/submit0.gif' alt='Please wait...' width=140 height=27 border=0>";
setTimeout("sh_sub()", 5000); 
}

function sh_sub(){
window.sts_sub.innerHTML="<INPUT name='submit2' type='image' style='CURSOR: hand' onclick='return chksubmit(this.form);' src='img/submit1.gif' alt='Place Order' width='140' height='27' border=0>";
document.myshop.lockval.value="0";
}

//-->