var browser = {
               name : navigator.userAgent,
               isMSIE : /MSIE/.test ( navigator.userAgent ) || !! ( window.attachEvent && !window.opera ),
               isOpera : /Opera/.test ( navigator.userAgent ) || !!window.opera,
               isWebKit : /KHTML/.test ( navigator.userAgent ) && /Apple/.test ( navigator.userAgent ),
               isGecko : /Gecko/.test ( navigator.userAgent ) && !/Konqueror|KHTML/.test ( navigator.userAgent ),
               isKonqueror : /Konqueror|KHTML/.test ( navigator.userAgent ) && !/Apple/.test ( navigator.userAgent ),
               isMobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
          },

          OS = {
               isWindows: navigator.platform.indexOf("Win") > -1,
               isMac: navigator.platform.indexOf("Mac") > -1,
               isLinux: navigator.platform.indexOf("Linux") > -1
          };

function doClear(theText) {
  if (theText.value == theText.defaultValue) {
    theText.value = ""
  }
}

function onLoad_Frame_fr3(_divid_fr3,_frameid_fr3,_framename_fr3) {
  _divobject_fr3   = document.getElementById(_divid_fr3);
  _iframeObject_fr3 = document.getElementById(_frameid_fr3);
  _oper_fr3='';
  try{
    _document_fr3 = _iframeObject_fr3.contentWindow.document;
    document.getElementById('cartcount').innerHTML=_document_fr3.getElementById('cartcount').innerHTML;
    document.getElementById('carttotal').innerHTML=_document_fr3.getElementById('carttotal').innerHTML;
  }catch(e_fr3){
    document.getElementById('leftcartcount').innerHTML='<span class="cartlink" onclick="reload_frame(\'add_cart.cgi\',\'3\');"><span class="small">click to</span></span>';
    document.getElementById('leftcarttotal').innerHTML='<span class="cartlink" onclick="reload_frame(\'add_cart.cgi\',\'3\');"><span class="small">refresh</span></span>';
   }
  try{
    _document_fr3 = _iframeObject_fr3.contentWindow.document;
    document.getElementById('leftcartcount').innerHTML=_document_fr3.getElementById('cartcount').innerHTML;
    document.getElementById('leftcarttotal').innerHTML=_document_fr3.getElementById('carttotal').innerHTML;
  }catch(e_fr3){
    document.getElementById('leftcartcount').innerHTML='<span class="cartlink" onclick="reload_frame(\'add_cart.cgi\',\'3\');"><span class="small">click to</span></span>';
    document.getElementById('leftcarttotal').innerHTML='<span class="cartlink" onclick="reload_frame(\'add_cart.cgi\',\'3\');"><span class="small">refresh</span></span>';
   }
}

function beforeMainFrameLoad() {
  scroll(0,0);
  _divobject_fr4   = document.getElementById('divmain');
  _divobject_fr4.innerHTML = '<p align=center>Loading ...</p>';
}

function onLoad_Frame_fr4(_divid_fr4,_frameid_fr4,_framename_fr4) {
  scroll(0,0);
  _divobject_fr4   = document.getElementById(_divid_fr4);
  _iframeObject_fr4 = document.getElementById(_frameid_fr4);
  _oper_fr4='';
  try{
  _document_fr4 = _iframeObject_fr4.contentWindow.document;
  _hrefs_fr4 = _document_fr4.getElementsByTagName('a');

  for (i_fr4=0; i_fr4<_hrefs_fr4.length; i_fr4++) {
    if (_hrefs_fr4[i_fr4].getAttribute('href')!=null) {
      _oper_fr4='0_'+i_fr4;
      if (_hrefs_fr4[i_fr4].tagName=='a' || _hrefs_fr4[i_fr4].tagName=='A') {
      try{
        _oper_fr4='1';

        if (_hrefs_fr4[i_fr4].getAttribute('href').indexOf('view_saved_cart.cgi')>-1){
          _hrefs_fr4[i_fr4].setAttribute('href',
            _hrefs_fr4[i_fr4].getAttribute('href').replace('view_saved_cart.cgi','view_saved_cart_n.cgi'));
        }
        if (_hrefs_fr4[i_fr4].getAttribute('href').indexOf('product_view.cgi')>-1){
          _hrefs_fr4[i_fr4].setAttribute('href',
            _hrefs_fr4[i_fr4].getAttribute('href').replace('product_view.cgi','product_view_f.cgi'));
          _hrefs_fr4[i_fr4].setAttribute('target',_framename_fr4);
        }
        if (_hrefs_fr4[i_fr4].getAttribute('href').indexOf('view_sys_c.cgi')>-1){
          _hrefs_fr4[i_fr4].setAttribute('href',
            _hrefs_fr4[i_fr4].getAttribute('href').replace('view_sys_c.cgi','view_sys.cgi'));
          _hrefs_fr4[i_fr4].setAttribute('target',_framename_fr4);
        }
      _oper_fr4='2';
      } catch(e_fr4){};
      if (_hrefs_fr4[i_fr4].getAttribute('target')=='' || _hrefs_fr4[i_fr4].getAttribute('target')==null) {
      _oper_fr4='3';
        _hrefs_fr4[i_fr4].setAttribute('target',_framename_fr4);
      _oper_fr4='4';
      }}
    }
  }
  _oper_fr4 += '5_';

for (i_fr4=0; i_fr4<_document_fr4.forms.length; i_fr4++) {
    _oper_fr4 += '7_';

    if (_document_fr4.forms[i_fr4].getAttribute('target')=='' || _document_fr4.forms[i_fr4].getAttribute('target')==null) {
      _oper_fr4+='6_';
      _document_fr4.forms[i_fr4].setAttribute('target',_framename_fr4);
    }
}
_oper_fr4 += '8.2_';
for (i_fr4=0; i_fr4<_document_fr4.forms.length; i_fr4++) {
    _oper_fr4 += '8_'+i_fr4;

    if (_document_fr4.forms[i_fr4].getAttribute('action').indexOf('view_saved_cart.cgi')>-1){
      _document_fr4.forms[i_fr4].setAttribute('action',
        _document_fr4.forms[i_fr4].getAttribute('action').replace('view_saved_cart.cgi','view_saved_cart_n.cgi'));
    }
    if (_document_fr4.forms[i_fr4].getAttribute('action').indexOf('product_view.cgi')>-1){
      _document_fr4.forms[i_fr4].setAttribute('action',
        _document_fr4.forms[i_fr4].getAttribute('action').replace('product_view.cgi','product_view_f.cgi'));
      _hrefs_fr4[i_fr4].setAttribute('target',_framename_fr4);
    }
    if (_document_fr4.forms[i_fr4].getAttribute('action').indexOf('view_sys_c.cgi')>-1){
      _document_fr4.forms[i_fr4].setAttribute('action',
        _document_fr4.forms[i_fr4].getAttribute('action').replace('view_sys_c.cgi','view_sys.cgi'));
      _hrefs_fr4[i_fr4].setAttribute('target',_framename_fr4);
    }

    _oper_fr4 += '8_'+i_fr4+'end';
}
  _oper_fr4+='10_';

  if (_iframeObject_fr4.contentWindow.location.href.indexOf('/view_sys_test.cgi')==-1 &&
      _iframeObject_fr4.contentWindow.location.href.indexOf('/ord_stat_a.cgi')==-1 &&
      _iframeObject_fr4.contentWindow.location.href.indexOf('/view_sys_m.cgi')==-1){
    _iframeObject_fr4.width="0";
    _iframeObject_fr4.height="0";
    _divobject_fr4.innerHTML = _document_fr4.body.innerHTML;
    _document_fr4.body.innerHTML = '';
  }
  else {
    _divobject_fr4.innerHTML = '';
    _iframeObject_fr4.width="1024";
    _iframeObject_fr4.height="780";
    _document_fr4.body.background="/img_new/bg_text.jpg";
  }
  _oper_fr4+='11_';
  }catch(e_fr4){_divobject_fr4.innerHTML="Can't load page : "+e_fr4.message;
    _divobject_fr4.innerHTML = '';
    _iframeObject_fr4.width="1024";
    _iframeObject_fr4.height="780";
  }  ;
}

function reload_frame(_reload_frame_action,_reload_frame_target) {
  document.forms.Add_Cart_Form.target = _reload_frame_target;
  document.forms.Add_Cart_Form.action = _reload_frame_action;
  document.forms.Add_Cart_Form.submit();
}

function Blink(divname){
 var div_=document.getElementById(divname);
 var dcolor=div_.style.color;
 var timeout_=2000;
 if (document.getElementById('cartcount').innerHTML.substring(0,1)=='0'){dcolor='red'};
 if (dcolor=='red' || dcolor=='#ff0000') {dcolor='white'} else {dcolor='red';timeout_=500}
 div_.style.color=dcolor;
   setTimeout("Blink('"+divname+"')",timeout_);
}

function goBack2_specs (item) {

  var link = "add_cart.cgi?" + item + "&cart";
  document.forms.Cart.target = "3";
  document.forms.Cart.action = link;
  document.forms.Cart.submit();

}

function chkForm_retrieve_cart() {

 if (document.Form_retrieve_cart.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_retrieve_cart.email.focus();
   return false 
 }

 if (document.Form_retrieve_cart.email.value!="") {

   if (document.Form_retrieve_cart.email.value.indexOf("@")==-1 ||
       document.Form_retrieve_cart.email.value.indexOf(".")==-1 ||
       document.Form_retrieve_cart.email.value.indexOf(" ")!=-1 ||
       document.Form_retrieve_cart.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_retrieve_cart.email.focus();
       return false
   }
 }

 if (document.Form_retrieve_cart.passw.value=="") {
    alert("Password is a required field!");
    document.Form_retrieve_cart.passw.focus();
    return false
  }

}


function chkForm_retrieve_cart_passw1() {

 if (document.Form_retrieve_cart_passw1.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_retrieve_cart_passw1.email.focus();
   return false 
 }

 if (document.Form_retrieve_cart_passw1.email.value!="") {

   if (document.Form_retrieve_cart_passw1.email.value.indexOf("@")==-1 ||
       document.Form_retrieve_cart_passw1.email.value.indexOf(".")==-1 ||
       document.Form_retrieve_cart_passw1.email.value.indexOf(" ")!=-1 ||
       document.Form_retrieve_cart_passw1.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_retrieve_cart_passw1.email.focus();
       return false
   }
 }

 if (document.Form_retrieve_cart_passw1.passw1.value=="") {
    alert("Password is a required field!");
    document.Form_retrieve_cart_passw1.passw1.focus();
    return false
  }

}


function chkForm1_order_zip() {

 if (document.Form1_order_zip.orderno.value=="" || document.Form1_order_zip.orderno.value=="CD-") {
   alert("Order No is a required field!");
   document.Form1_order_zip.orderno.focus();
   return false
 }

 if (document.Form1_order_zip.zip.value=="") {
   alert("Zip Code is a required field!");
   document.Form1_order_zip.zip.focus();
   return false
 }

}

function chkForm2_cust_info() {


 if (document.Form2_cust_info.fname.value=="") {
   alert("First Name is a required field!");
   document.Form2_cust_info.fname.focus();
   return false
 }

 if (document.Form2_cust_info.lname.value=="") {
   alert("Last Name is a required field!");
   document.Form2_cust_info.lname.focus();
   return false
 }

 if (document.Form2_cust_info.addr1.value=="") {
   alert("Address is a required field!");
   document.Form2_cust_info.addr1.focus();
   return false
 }

 if (document.Form2_cust_info.city.value=="") {
   alert("City is a required field!");
   document.Form2_cust_info.city.focus();
   return false
 }

 if (document.Form2_cust_info.state.value=="") {
   alert("Please Select State!");
   document.Form2_cust_info.state.focus();
   return false
 }

 if (document.Form2_cust_info.zip_a.value=="") {
   alert("Zip Code is a required field!");
   document.Form2_cust_info.zip_a.focus();
   return false
 }


 if (document.Form2_cust_info.phone.value=="") {
   alert("Phone No is a required field!");
   document.Form2_cust_info.phone.focus();
   return false
 }


 if (document.Form2_cust_info.phone.value.length < 10) {
   alert("Phone No is incorrect!");
   document.Form2_cust_info.phone.focus();
   return false
 }


 if (document.Form2_cust_info.fname_ship.value=="") {
   alert("First Name is a required field!");
   document.Form2_cust_info.fname_ship.focus();
   return false
 }

 if (document.Form2_cust_info.lname_ship.value=="") {
   alert("Last Name is a required field!");
   document.Form2_cust_info.lname_ship.focus();
   return false
 }

 if (document.Form2_cust_info.addr1_ship.value=="") {
   alert("Address is a required field!");
   document.Form2_cust_info.addr1_ship.focus();
   return false
 }

 if (document.Form2_cust_info.city_ship.value=="") {
   alert("City is a required field!");
   document.Form2_cust_info.city_ship.focus();
   return false
 }

 if (document.Form2_cust_info.state_ship.value=="") {
   alert("Please Select State!");
   document.Form2_cust_info.state_ship.focus();
   return false
 }

 if (document.Form2_cust_info.zip_ship.value=="") {
   alert("Zip Code is a required field!");
   document.Form2_cust_info.zip_ship.focus();
   return false
 }

 if (document.Form2_cust_info.email_a.value=="") {
   alert("Email Address is a required field!");
   document.Form2_cust_info.email_a.focus();
   return false
 }

 if (document.Form2_cust_info.email_a.value!="") {

   if (document.Form2_cust_info.email_a.value.indexOf("@")==-1 ||
       document.Form2_cust_info.email_a.value.indexOf(".")==-1 ||
       document.Form2_cust_info.email_a.value.indexOf(" ")!=-1 ||
       document.Form2_cust_info.email_a.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form2_cust_info.email.focus();
       return false
   }
 }

 if (document.Form2_cust_info.passw1.value=="") {
   alert("Password is a required field!");
   document.Form2_cust_info.passw1.focus();
   return false
 }

 if (document.Form2_cust_info.passw1.value.length < 6) {
   alert("Password cannot be less than 6 characters!");
   document.Form2_cust_info.passw1.focus();
   return false
 }

 if (document.Form2_cust_info.passw2.value=="") {
   alert("Password is a required field!");
   document.Form2_cust_info.passw2.focus();
   return false
 }

 if (document.Form2_cust_info.passw1.value != document.Form2_cust_info.passw2.value) {
   alert("You entered two different passwords!");
   document.Form2_cust_info.passw2.focus();
   return false
 }


}


function chkForm2_ord_cart() {


if (document.Form2_ord_cart.fname.value=="") {
   alert("First Name is a required field!");
   document.Form2_ord_cart.fname.focus();
   return false
}

if (document.Form2_ord_cart.lname.value=="") {
   alert("Last Name is a required field!");
   document.Form2_ord_cart.lname.focus();
   return false
}

if (document.Form2_ord_cart.email.value=="") {
   alert("Email Address is a required field!");
   document.Form2_ord_cart.email.focus();
   return false
}

if (document.Form2_ord_cart.email.value!="") {

   if (document.Form2_ord_cart.email.value.indexOf("@")==-1 ||
       document.Form2_ord_cart.email.value.indexOf(".")==-1 ||
       document.Form2_ord_cart.email.value.indexOf(" ")!=-1 ||
       document.Form2_ord_cart.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form2_ord_cart.email.focus();
       return false
   }
}

if (document.Form2_ord_cart.passw.value=="") {
   alert("Password is a required field!");
   document.Form2_ord_cart.passw.focus();
   return false
}

if (document.Form2_ord_cart.passw.value.length < 6) {
   alert("Password cannot be less than 6 characters!");
   document.Form2_ord_cart.passw.focus();
   return false
}

if (document.Form2_ord_cart.passw.value != document.Form2_ord_cart.passw_c.value) {
   alert("You entered two different passwords!");
   document.Form2_ord_cart.passw_c.focus();
   return false
}
}

function chkForm_rma() {

if (document.Form_rma.typ.options[document.Form_rma.typ.selectedIndex].value=="000") {
   alert("Please Select Type of Return!");
   document.Form_rma.typ.focus();
   return false
}

if (document.Form_rma.cond.options[document.Form_rma.cond.selectedIndex].value=="000") {
   alert("Please Select Condition of Product!");
   document.Form_rma.cond.focus();
   return false
}


if (document.Form_rma.serial.value=="") {
   alert("Serial Product No is a required field!");
   document.Form_rma.serial.focus();
   return false
}

}

function chkForm1_rma_submit() {

if (document.Form1_rma_submit.email.value=="") {
   alert("Email Address is a required field!");
   document.Form1_rma_submit.email.focus();
   return false
}

if (document.Form1_rma_submit.email.value!="") {

   if (document.Form1_rma_submit.email.value.indexOf("@")==-1 ||
       document.Form1_rma_submit.email.value.indexOf(".")==-1 ||
       document.Form1_rma_submit.email.value.indexOf(" ")!=-1 ||
       document.Form1_rma_submit.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form1_rma_submit.email.focus();
       return false
   }
}

if (document.Form1_rma_submit.orderno.value=="") {
   alert("Order No is a required field!");
   document.Form1_rma_submit.orderno.focus();
   return false
}

if (document.Form1_rma_submit.passw.value=="") {
   alert("Password is a required field!");
   document.Form1_rma_submit.passw.focus();
   return false
}

}



function chkForm1_rma_cntr() {

if (document.Form1_rma_cntr.email.options[document.Form1_rma_cntr.email.selectedIndex].value == "000")
  {
    alert("Please Select Email Message");
    document.Form1_rma_cntr.email.focus();
    return false
  }
}

function chkForm2_rma_cntr() {

if (document.Form2_rma_cntr.upd.value != "")
   {
     if (document.Form2_rma_cntr.stat.options[document.Form2_rma_cntr.stat.selectedIndex].value == "000")
        {
          alert("Please Select RMA Status");
          document.Form2_rma_cntr.stat.focus();
          return false
        }
     if (document.Form2_rma_cntr.stat.options[document.Form2_rma_cntr.stat.selectedIndex].text == "Shipped" && document.Form2_rma_cntr.track.value=="")
        {
          alert("Please Enter Tracking No");
          document.Form2_rma_cntr.track.focus();
          return false
        }
   }
}

function chkForm2_rma_cntr_3() {

  document.Form2_rma_cntr.sale_cmnt.value = document.Form2_rma_cntr.cmnt_input.value;
  document.Form2_rma_cntr.cmnt_input.value = "";
}

function chkForm2_rma_cntr_4() {


  if (document.Form2_rma_cntr.date_call.value == "mm/dd/yyyy")
     {
       alert("Please Select Date");
       document.Form2_rma_cntr.date_call.focus();
       return false
     }

  if (document.Form2_rma_cntr.time_call.options[document.Form2_rma_cntr.time_call.selectedIndex].value == "00:00")
     {
       alert("Please Select Time");
       document.Form2_rma_cntr.time_call.focus();
       return false
     }

  if (document.Form2_rma_cntr.cmnt_input.value != "")
     {
       document.Form2_rma_cntr.sale_cmnt.value = document.Form2_rma_cntr.cmnt_input.value;
       document.Form2_rma_cntr.cmnt_input.value = "";
     }

}



function chkForm1_ord_cntr() {

if (document.Form1_ord_cntr.email.options[document.Form1_ord_cntr.email.selectedIndex].value == "000")
  {
    alert("Please Select Email Message");
    document.Form1_ord_cntr.email.focus();
    return false
  }
}

function chkForm2_ord_cntr() {

if (document.Form2_ord_cntr.upd.value != "")
   {
     if (document.Form2_ord_cntr.stat.options[document.Form2_ord_cntr.stat.selectedIndex].value == "000" && document.Form2_ord_cntr.est_ship_time.value == 'mm/dd/yy')
        {
          alert("Please Select Order Status");
          document.Form2_ord_cntr.stat.focus();
          return false
        }
     if (document.Form2_ord_cntr.stat.options[document.Form2_ord_cntr.stat.selectedIndex].text == "Shipped" && document.Form2_ord_cntr.track.value=="")
        {
          alert("Please Enter Tracking No");
          document.Form2_ord_cntr.track.focus();
          return false
        }
   }
}

function chkForm2_ord_cntr_3() {

  if (document.Form2_ord_cntr.cmnt_input.value == "")
     {
       alert("Please Enter Comment");
       document.Form2_ord_cntr.cmnt_input.focus();
       return false
     }
  document.Form2_ord_cntr.sale_cmnt.value = document.Form2_ord_cntr.cmnt_input.value;
  document.Form2_ord_cntr.cmnt_input.value = "";

}

function chkForm2_ord_cntr_4() {


  if (document.Form2_ord_cntr.date_call.value == "mm/dd/yyyy")
     {
       alert("Please Select Date");
       document.Form2_ord_cntr.date_call.focus();
       return false
     } 

  if (document.Form2_ord_cntr.time_call.options[document.Form2_ord_cntr.time_call.selectedIndex].value == "00:00")
     {
       alert("Please Select Time");
       document.Form2_ord_cntr.time_call.focus();
       return false
     }

  if (document.Form2_ord_cntr.cmnt_input.value != "")
     {
       document.Form2_ord_cntr.sale_cmnt.value = document.Form2_ord_cntr.cmnt_input.value;
       document.Form2_ord_cntr.cmnt_input.value = "";
     }

}


function chkForm2_cust_info_a() {


 if (document.Form2_cust_info_a.fname.value=="") {
   alert("First Name is a required field!");
   document.Form2_cust_info_a.fname.focus();
   return false
 }

 if (document.Form2_cust_info_a.lname.value=="") {
   alert("Last Name is a required field!");
   document.Form2_cust_info_a.lname.focus();
   return false
 }

 if (document.Form2_cust_info_a.addr1.value=="") {
   alert("Address is a required field!");
   document.Form2_cust_info_a.addr1.focus();
   return false
 }

 if (document.Form2_cust_info_a.city.value=="") {
   alert("City is a required field!");
   document.Form2_cust_info_a.city.focus();
   return false
 }

 if (document.Form2_cust_info_a.state.value=="") {
   alert("Please Select State!");
   document.Form2_cust_info_a.state.focus();
   return false
 }

 if (document.Form2_cust_info_a.zip_a.value=="") {
   alert("Zip Code is a required field!");
   document.Form2_cust_info_a.zip_a.focus();
   return false
 }


 if (document.Form2_cust_info_a.phone.value=="") {
   alert("Phone No is a required field!");
   document.Form2_cust_info_a.phone.focus();
   return false
 }


 if (document.Form2_cust_info_a.phone.value.length < 10) {
   alert("Phone No is incorrect!");
   document.Form2_cust_info_a.phone.focus();
   return false
 }


if (document.Form2_cust_info_a.fname_ship.value !="") {


 if (document.Form2_cust_info_a.fname_ship.value=="") {
   alert("First Name is a required field!");
   document.Form2_cust_info_a.fname_ship.focus();
   return false
 }

 if (document.Form2_cust_info_a.lname_ship.value=="") {
   alert("Last Name is a required field!");
   document.Form2_cust_info_a.lname_ship.focus();
   return false
 }

 if (document.Form2_cust_info_a.addr1_ship.value=="") {
   alert("Address is a required field!");
   document.Form2_cust_info_a.addr1_ship.focus();
   return false
 }

 if (document.Form2_cust_info_a.city_ship.value=="") {
   alert("City is a required field!");
   document.Form2_cust_info_a.city_ship.focus();
   return false
 }

 if (document.Form2_cust_info_a.state_ship.value=="") {
   alert("Please Select State!");
   document.Form2_cust_info_a.state_ship.focus();
   return false
 }

 if (document.Form2_cust_info_a.zip_ship.value=="") {
   alert("Zip Code is a required field!");
   document.Form2_cust_info_a.zip_ship.focus();
   return false
 }

}

 if (document.Form2_cust_info_a.email_a.value=="") {
   alert("Email Address is a required field!");
   document.Form2_cust_info_a.email_a.focus();
   return false
 }

 if (document.Form2_cust_info_a.email_a.value!="") {

   if (document.Form2_cust_info_a.email_a.value.indexOf("@")==-1 ||
       document.Form2_cust_info_a.email_a.value.indexOf(".")==-1 ||
       document.Form2_cust_info_a.email_a.value.indexOf(" ")!=-1 ||
       document.Form2_cust_info_a.email_a.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form2_cust_info_a.email.focus();
       return false
   }
 }

 if (document.Form2_cust_info_a.passw1.value=="") {
   alert("Password is a required field!");
   document.Form2_cust_info_a.passw1.focus();
   return false
 }

 if (document.Form2_cust_info_a.passw1.value.length < 6) {
   alert("Password cannot be less than 6 characters!");
   document.Form2_cust_info_a.passw1.focus();
   return false
 }

 if (document.Form2_cust_info_a.passw2.value=="") {
   alert("Password is a required field!");
   document.Form2_cust_info_a.passw2.focus();
   return false
 }

 if (document.Form2_cust_info_a.passw1.value != document.Form2_cust_info_a.passw2.value) {
   alert("You entered two different passwords!");
   document.Form2_cust_info_a.passw2.focus();
   return false
 }


}


function chkForm_srch() {

if (document.Form_srch.srch.value=="" && document.Form_srch.partno.value=="" && document.Form_srch.manuf.value=="") {
   alert("Required Info is missing!");
   document.Form_srch.srch.focus();
   return false
}

}

var prev_id = "";

function chgColor1_srch(rno) {
  var tmp = document.getElementById(rno);
  tmp.className='td2';

}

function chgColor2_srch(rno) {
  var tmp = document.getElementById(rno);
  tmp.className='td1';

}

function chgColor1(rno) {
  var tmp = document.getElementById(rno); 
  tmp.className='td2';

}

function chgColor2(rno) {
  var tmp = document.getElementById(rno); 
  tmp.className='td1';

}


function chkForm_email_cart() {

 if (document.Form_email_cart.email_to.value=="") {
   alert("Friend Email Address is a required field!");
   document.Form_email_cart.email_to.focus();
   return false 
 }

 if (document.Form_email_cart.email_to.value!="") {

   if (document.Form_email_cart.email_to.value.indexOf("@")==-1 ||
       document.Form_email_cart.email_to.value.indexOf(".")==-1 ||
       document.Form_email_cart.email_to.value.indexOf(" ")!=-1 ||
       document.Form_email_cart.email_to.value.length<6) {
       alert("Sorry, your friend email address is not valid.");
       document.Form_email_cart.email_to.focus();
       return false
   }
 }

 if (document.Form_email_cart.email_from.value=="") {
   alert("Your Email Address is a required field!");
   document.Form_email_cart.email_from.focus();
   return false 
 }

 if (document.Form_email_cart.email_from.value!="") {

   if (document.Form_email_cart.email_from.value.indexOf("@")==-1 ||
       document.Form_email_cart.email_from.value.indexOf(".")==-1 ||
       document.Form_email_cart.email_from.value.indexOf(" ")!=-1 ||
       document.Form_email_cart.email_from.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_email_cart.email_from.focus();
       return false
   }
 }

 if (document.Form_email_cart.cust_name.value=="") {
    alert("Your Name is a required field!");
    document.Form_email_cart.cust_name.focus();
    return false
 }

}

function printpage() {
window.print();  
}


function chkForm_reg_ord() {

if (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].value=="000")
   {
     alert("Please Select Payment Method!");
     document.Form_reg_ord.cardtype.focus();
     return false
   }


if (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Visa"       ||
    document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="MasterCard" ||
    document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Discover") {

  if (document.Form_reg_ord.cardno.value=="") {
     alert("Card No is a required field!");
     document.Form_reg_ord.cardno.focus();
     return false
  }

  if (document.Form_reg_ord.cardno.value.length < 15) {
     alert("Card No is incorrect!");
     document.Form_reg_ord.cardno.focus();
     return false
  }

  if (document.Form_reg_ord.cardcode.value=="") {
     alert("Security Code is a required field!");
     document.Form_reg_ord.cardcode.focus();
     return false
  }

  if (document.Form_reg_ord.cardcode.value.length < 3) {
     alert("Security Code is incorrect!");
     document.Form_reg_ord.cardcode.focus();
     return false
  }

  if (document.Form_reg_ord.addr_ship.value=="Y" && document.Form_reg_ord.bank_name.value=="") {
     alert("Bank Name is a required field!");
     document.Form_reg_ord.bank_name.focus();
     return false
  }

  if (document.Form_reg_ord.addr_ship.value=="Y" && document.Form_reg_ord.bank_phone.value=="") {
     alert("Bank Phone is a required field!");
     document.Form_reg_ord.bank_phone.focus();
     return false
  }

if (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="eCheck") {

  if (document.Form_reg_ord.acctno.value=="") {
     alert("Account Number is a required field!");
     document.Form_reg_ord.acctno.focus();
     return false
  }

  if (document.Form_reg_ord.route.value=="") {
     alert("Route Number is a required field!");
     document.Form_reg_ord.route.focus();
     return false
  }

}

}


 if (document.Form_reg_ord.src.options[document.Form_reg_ord.src.selectedIndex].value == "000") {
    alert("Please Select a Source!");
    document.Form_reg_ord.src.focus();
    return false
  }


 if (document.Form_reg_ord.accept.options[document.Form_reg_ord.accept.selectedIndex].text != "Accept") {
    alert("Please review and accept Terms & Conditions!");
    document.Form_reg_ord.accept.focus();
    return false
  }

  if (document.Form_reg_ord.init.value=="") {
     alert("Please enter your initials!");
     document.Form_reg_ord.init.focus();
     return false
  }


}

function subForm_reg_ord() {

  document.forms.Form_reg_ord.target = "3";
  document.Form_reg_ord.action = "add_cart.cgi";
  document.forms.Form_reg_ord.submit();

}


function chkCust_reg_ord() {

if (document.Cust.email.value=="") {
   alert("Email Address is a required field!");
   document.Cust.email.focus();
   return false
}

if (document.Cust.email.value!="") {
   if (document.Cust.email.value.indexOf("@")==-1 ||
       document.Cust.email.value.indexOf(".")==-1 ||
       document.Cust.email.value.indexOf(" ")!=-1 ||
       document.Cust.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Cust.email.focus();
       return false
   }
}

if (document.Cust.passw1.value=="") {
   alert("Password is a required field!");
   document.Cust.passw1.focus();
   return false
}

}


function sf_show_reg_ord() {
  if  (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="eCheck")
      { id1 = "check"; id2 = "card"; id3 = "money"; }
  if (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Visa"       ||
      document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="MasterCard" ||
      document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Discover")
      { id1 = "card"; id2 = "check"; id3 = "money"; }
  if  (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Check/MoneyOrder")
      { id1 = "money"; id2 = "card"; id3 = "check"; }

  if (document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="PayPal" ||
      document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="AmericanExpress" ||
      document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].text=="Net 30 Terms" ||
      document.Form_reg_ord.cardtype.options[document.Form_reg_ord.cardtype.selectedIndex].value=="000")

      {
        id1 = "card"; id2 = "check"; id3 = "money";

        the_block = document.getElementById(id1+"-div");
        the_block.style.display = "none";

        the_block = document.getElementById(id2+"-div");
        the_block.style.display = "none";

        the_block = document.getElementById(id3+"-div");
        the_block.style.display = "none";

      }
  else
      {
 
       the_block = document.getElementById(id1+"-div");
       the_block.style.display = "block";

       the_block = document.getElementById(id2+"-div");
       the_block.style.display = "none";

       the_block = document.getElementById(id3+"-div");
       the_block.style.display = "none";

      }
}

function showBAR_reg_ord() {
   id = "ord";
   the_block = document.getElementById(id+"-div");
   the_block.style.display = "block";
}


function chkForm_forgot() {

if (document.Form_forgot.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_forgot.email.focus();
   return false
}

}


var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

function chkForm_reg_same() {

if (document.Form_reg.same.checked == true) {
   document.Form_reg.fname_ship.value = document.Form_reg.fname.value;
   document.Form_reg.lname_ship.value = document.Form_reg.lname.value;
   document.Form_reg.comp_ship.value  = document.Form_reg.comp.value;
   document.Form_reg.addr1_ship.value = document.Form_reg.addr1.value;
   document.Form_reg.addr2_ship.value = document.Form_reg.addr2.value;
   document.Form_reg.city_ship.value  = document.Form_reg.city.value;
   document.Form_reg.zip_ship.value   = document.Form_reg.zip.value;
   x = document.Form_reg.state.selectedIndex;
   document.Form_reg.state_ship.options[x].selected = true;
   x = document.Form_reg.country.selectedIndex;
   document.Form_reg.country_ship.options[x].selected = true;
   document.Form_reg.zip_ship.value    = document.Form_reg.zip.value;
   document.Form_reg.phone_ship.value = document.Form_reg.phone.value;
   document.Form_reg.fax_ship.value = document.Form_reg.fax.value;
}

}

function chkForm_reg() {


if (document.Form_reg.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_reg.email.focus();
   return false
}

if (document.Form_reg.email.value!="") {
   if (document.Form_reg.email.value.indexOf("@")==-1 ||
       document.Form_reg.email.value.indexOf(".")==-1 ||
       document.Form_reg.email.value.indexOf(" ")!=-1 ||
       document.Form_reg.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_reg.email.focus();
       return false
   }
}

if (document.Form_reg.passw1.value=="") {
   alert("Password is a required field!");
   document.Form_reg.passw1.focus();
   return false
}

if (document.Form_reg.passw1.value.length < 6) {
   alert("Password cannot be less than 6 characters!");
   document.Form_reg.passw1.focus();
   return false
}

if (document.Form_reg.passw2.value=="") {
   alert("Password is a required field!");
   document.Form_reg.passw2.focus();
   return false
}

if (document.Form_reg.passw1.value != document.Form_reg.passw2.value) {
   alert("You entered two different passwords!");
   document.Form_reg.passw2.focus();
   return false
}


if (document.Form_reg.fname.value=="") {
   alert("First Name is a required field!");
   document.Form_reg.fname.focus();
   return false
}


if (document.Form_reg.lname.value=="") {
   alert("Last Name is a required field!");
   document.Form_reg.lname.focus();
   return false
}

if (document.Form_reg.addr1.value=="") {
   alert("Address is a required field!");
   document.Form_reg.addr1.focus();
   return false
}

if (document.Form_reg.city.value=="") {
   alert("City is a required field!");
   document.Form_reg.city.focus();
   return false
}

if (document.Form_reg.state.options[document.Form_reg.state.selectedIndex].value=="X") {
   alert("Please Select State!");
   document.Form_reg.state.focus();
   return false
}

if (document.Form_reg.zip.value=="") {
   alert("Zip Code is a required field!");
   document.Form_reg.zip.focus();
   return false
}

if (document.Form_reg.zip.value.length < 5) {
   alert("Zip Code is incorrect!");
   document.Form_reg.zip.focus();
   return false
}

if (document.Form_reg.phone.value=="") {
   alert("Phone No is a required field!");
   document.Form_reg.phone.focus();
   return false
}

if (document.Form_reg.phone.value != "") {
   var Phone=document.Form_reg.phone;
   if (checkInternationalPhone(Phone.value)==false){
	alert("Please Enter a Valid Phone Number");
	Phone.value="";
	Phone.focus();
	return false;
   }
}

if (document.Form_reg.same.checked) {
   document.Form_reg.fname_ship.value = document.Form_reg.fname.value;
}

if (document.Form_reg.fname_ship.value=="") {
   alert("First Name is a required field!");
   document.Form_reg.fname_ship.focus();
   return false
}

if (document.Form_reg.lname_ship.value=="") {
   alert("Last Name is a required field!");
   document.Form_reg.lname_ship.focus();
   return false
}

if (document.Form_reg.addr1_ship.value=="") {
   alert("Address is a required field!");
   document.Form_reg.addr1_ship.focus();
   return false
}

if (document.Form_reg.city_ship.value=="") {
   alert("City is a required field!");
   document.Form_reg.city_ship.focus();
   return false
}

if (document.Form_reg.state_ship.options[document.Form_reg.state_ship.selectedIndex].value=="X") {
   alert("Please Select State!");
   document.Form_reg.state_ship.focus();
   return false
}

if (document.Form_reg.zip_ship.value=="") {
   alert("Zip Code is a required field!");
   document.Form_reg.zip_ship.focus();
   return false
}

if (document.Form_reg.phone_ship.value != "") {
   var Phone=document.Form_reg.phone_ship;
   if (checkInternationalPhone(Phone.value)==false){
	alert("Please Enter a Valid Phone Number");
	Phone.value="";
	Phone.focus();
	return false;
   }
}

}


function chkForm_reg_r() {


if (document.Form_reg.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_reg.email.focus();
   return false
}

if (document.Form_reg.email.value!="") {
   if (document.Form_reg.email.value.indexOf("@")==-1 ||
       document.Form_reg.email.value.indexOf(".")==-1 ||
       document.Form_reg.email.value.indexOf(" ")!=-1 ||
       document.Form_reg.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_reg.email.focus();
       return false
   }
}

if (document.Form_reg.passw1.value=="") {
   alert("Password is a required field!");
   document.Form_reg.passw1.focus();
   return false
}

if (document.Form_reg.passw1.value.length < 6) {
   alert("Password cannot be less than 6 characters!");
   document.Form_reg.passw1.focus();
   return false
}

if (document.Form_reg.passw2.value=="") {
   alert("Password is a required field!");
   document.Form_reg.passw2.focus();
   return false
}

if (document.Form_reg.passw1.value != document.Form_reg.passw2.value) {
   alert("You entered two different passwords!");
   document.Form_reg.passw2.focus();
   return false
}

if (document.Form_reg.license_no.value=="") {
   alert("License No is a required field!");
   document.Form_reg.license_no.focus();
   return false
}

if (document.Form_reg.license_date.value=="") {
   alert("License Issue Date is a required field!");
   document.Form_reg.license_date.focus();
   return false
}

if (document.Form_reg.fname.value=="") {
   alert("First Name is a required field!");
   document.Form_reg.fname.focus();
   return false
}


if (document.Form_reg.lname.value=="") {
   alert("Last Name is a required field!");
   document.Form_reg.lname.focus();
   return false
}

if (document.Form_reg.comp.value=="") {
   alert("Business Name is a required field!");
   document.Form_reg.comp.focus();
   return false
}

if (document.Form_reg.addr1.value=="") {
   alert("Address is a required field!");
   document.Form_reg.addr1.focus();
   return false
}

if (document.Form_reg.city.value=="") {
   alert("City is a required field!");
   document.Form_reg.city.focus();
   return false
}

if (document.Form_reg.state.options[document.Form_reg.state.selectedIndex].value=="X") {
   alert("Please Select State!");
   document.Form_reg.state.focus();
   return false
}

if (document.Form_reg.zip.value=="") {
   alert("Zip Code is a required field!");
   document.Form_reg.zip.focus();
   return false
}

if (document.Form_reg.zip.value.length < 5) {
   alert("Zip Code is incorrect!");
   document.Form_reg.zip.focus();
   return false
}

if (document.Form_reg.phone.value=="") {
   alert("Phone No is a required field!");
   document.Form_reg.phone.focus();
   return false
}

if (document.Form_reg.phone.value != "") {
   var Phone=document.Form_reg.phone;
   if (checkInternationalPhone(Phone.value)==false){
	alert("Please Enter a Valid Phone Number");
	Phone.value="";
	Phone.focus();
	return false;
   }
}

if (document.Form_reg.fax.value=="") {
   alert("Fax No is a required field!");
   document.Form_reg.fax.focus();
   return false
}

if (document.Form_reg.fax.value != "") {
   var Fax=document.Form_reg.fax;
   if (checkInternationalPhone(Fax.value)==false){
	alert("Please Enter a Valid Fax Number");
	Fax.value="";
	Fax.focus();
	return false;
   }
}
if (document.Form_reg.same.checked) {
   document.Form_reg.fname_ship.value = document.Form_reg.fname.value;
}

if (document.Form_reg.fname_ship.value=="") {
   alert("First Name is a required field!");
   document.Form_reg.fname_ship.focus();
   return false
}

if (document.Form_reg.lname_ship.value=="") {
   alert("Last Name is a required field!");
   document.Form_reg.lname_ship.focus();
   return false
}

if (document.Form_reg.comp_ship.value=="") {
   alert("Business Name is a required field!");
   document.Form_reg.comp_ship.focus();
   return false
}

if (document.Form_reg.addr1_ship.value=="") {
   alert("Address is a required field!");
   document.Form_reg.addr1_ship.focus();
   return false
}

if (document.Form_reg.city_ship.value=="") {
   alert("City is a required field!");
   document.Form_reg.city_ship.focus();
   return false
}

if (document.Form_reg.state_ship.options[document.Form_reg.state_ship.selectedIndex].value=="X") {
   alert("Please Select State!");
   document.Form_reg.state_ship.focus();
   return false
}

if (document.Form_reg.zip_ship.value=="") {
   alert("Zip Code is a required field!");
   document.Form_reg.zip_ship.focus();
   return false
}

if (document.Form_reg.phone_ship.value != "") {
   var Phone=document.Form_reg.phone_ship;
   if (checkInternationalPhone(Phone.value)==false){
	alert("Please Enter a Valid Phone Number");
	Phone.value="";
	Phone.focus();
	return false;
   }
}

}



function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function ValidateForm(){
	var Phone=document.frmSample.txtPhone
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("Please Enter your Phone Number")
		Phone.focus()
		return false
	}
	if (checkInternationalPhone(Phone.value)==false){
		alert("Please Enter a Valid Phone Number")
		Phone.value=""
		Phone.focus()
		return false
	}
	return true
 }


function chkForm_ship_addr() {



if (document.Form_ship_addr.fname_add.value=="") {
   alert("First Name is a required field!");
   document.Form_ship_addr.fname_add.focus();
   return false
}

if (document.Form_ship_addr.lname_add.value=="") {
   alert("Last Name is a required field!");
   document.Form_ship_addr.lname_add.focus();
   return false
}

if (document.Form_ship_addr.addr1_add.value=="") {
   alert("Address is a required field!");
   document.Form_ship_addr.addr1_add.focus();
   return false
}

if (document.Form_ship_addr.city_add.value=="") {
   alert("City is a required field!");
   document.Form_ship_addr.city_add.focus();
   return false
}

if (document.Form_ship_addr.state_add.options[document.Form_ship_addr.state_add.selectedIndex].value=="X") {
   alert("Please Select State!");
   document.Form_ship_addr.state_add.focus();
   return false
}

if (document.Form_ship_addr.zip_add.value=="") {
   alert("Zip Code is a required field!");
   document.Form_ship_addr.zip_add.focus();
   return false
}

if (document.Form_ship_addr.phone_add.value != "") {
   var Phone=document.Form_ship_addr.phone_add;
   if (checkInternationalPhone(Phone.value)==false){
	alert("Please Enter a Valid Phone Number");
	Phone.value="";
	Phone.focus();
	return false;
   }
}

}


function formSubmit_sysm(itemno) {
  var _frame=parent.document.getElementById('compframe');
  var _doc=_frame.contentDocument||parent.frames['compframe'].document;
  _doc.forms.config.target = "8";
  _doc.forms.config.action = "review_sysm_new.cgi?" + itemno;
  _doc.forms.config.submit();

}

function clrRow(cur,nm,cnt) {
   for (i=0; i<cnt; i++) {

      var clr  = nm + i;
      var clrr = clr  + "r";
      var tmp = document.getElementById(clr);
 
      if (tmp.className == 'td2') {  
         var tmp = document.getElementById(clr); 
         tmp.className='td1';
         var tmp = document.getElementById(clrr); 
         tmp.className='in1';
         break;
      } 
   }
    
   var curr  = cur  + "r";
   var tmp = document.getElementById(cur); 
   tmp.className='td2';
   var tmp = document.getElementById(curr); 
   tmp.className='in2';
}

function clrRow1(cur,nm) {

  var tmp = document.getElementById(nm); 
  if (tmp.checked == true)
     {
       var tmp = document.getElementById(cur); 
       tmp.className='td2';
     }
  if (tmp.checked == false)
     {
       var tmp = document.getElementById(cur); 
       tmp.className='td1';
     }
      
}

function sf_showhide(id) {
 
     the_block = document.getElementById(id+"-div");
     the_image = document.getElementById(id+"-img");

     if (the_block.style.display == "none") {
          the_block.style.display = "block";
          the_image.src = "../img/coll_2.gif";
          the_image.alt = "Hide";
     } else {
          the_block.style.display = "none";
          the_image.src = "../img/coll_d.gif";
          the_image.alt = "Show";
     }
}


function increase(cnt)
{

 var elem_arr; var intQty;
 elem = document.Cart.elements;
 for (i=0; i<elem.length; i++) {
   elem_arr = elem[i].name.split("_");
   if (elem_arr[0] == "intQty" && elem_arr[1] == cnt)
      {
        intQty = elem[i].value;
        intQty++;
        elem[i].value = intQty;
      }
 }

}

function decrease(cnt)
{
 var elem_arr; var intQty;
 elem = document.Cart.elements;
 for (i=0; i<elem.length; i++) {
   elem_arr = elem[i].name.split("_");
   if (elem_arr[0] == "intQty" && elem_arr[1] == cnt)
      {
        intQty = elem[i].value;
        if (intQty > 1)
           intQty = intQty - 1;
        elem[i].value = intQty;
      }
 }
}

function goSubmit_view_cart() {

  document.forms.Cart.target = "3";
  document.forms.Cart.action = "add_cart.cgi";
  document.forms.Cart.submit();

  document.forms.Cart.target = "4";
  document.forms.Cart.action = "view_cart.cgi";
  document.forms.Cart.submit();

}

function subForm_view_cart() {

  document.forms.Cart.target = "3";
  document.Cart.action = "add_cart.cgi";
  document.forms.Cart.submit();

}


function chkTest_view_cart() {
  if (document.Form1_view_cart.test.options[document.Form1_view_cart.test.selectedIndex].value=="000") {
     alert("Please Select Pre-test option!");
     document.Form1_view_cart.test.focus();
     return false
  }
}


function chkWrn_view_cart() {
  if (document.Form2_view_cart.wrn.options[document.Form2_view_cart.wrn.selectedIndex].value=="000") {
     alert("Please Select Warranty option!");
     document.Form2_view_cart.wrn.focus();
     return false
  }
}


function goBack1_specs (item) {
  var link = "add_cart.cgi?" + item;
  document.forms.Cart.target = "3";
  document.forms.Cart.action = link;
  document.forms.Cart.submit();

  document.forms.Cart.target = "4";
  document.Cart.action = "javascript:history.back()";
  document.forms.Cart.submit();
}


function chkSrch() {
  if (document.Form.srch.value=="") {
    alert("Please Enter Search Keyword!");
    document.Form.srch.focus();
    return false
  }
}

function chkSrch_srch_main() {
  if (document.Form_srch_main.srch.value=="") {
    alert("Please Enter Search Keyword!");
    document.Form_srch_main.srch.focus();
    return false
  }
}

function subForm_cart() {

  document.forms.Cart_cart.target = "4";
  document.Cart_cart.action = "view_cart.cgi";
  document.forms.Cart_cart.submit();

}

function subWish_cart() {

  document.forms.Cart_cart.target = "4";
  document.Cart_cart.action = "ord_cart.cgi";
  document.forms.Cart_cart.submit();

}


function showconfdiv(cur,def) {
  var cur_div;
  for (i=0; i<=10; i++) {
    var clr  = "confstructurebuttons" + i;
    var btn  = "confbutton" + i;
    var tmp = parent.document.getElementById(clr);
    if (tmp) {
      if (i==cur) {tmp.style.display="block";cur_div=tmp;}
      else {tmp.style.display="none";}
      tmp = parent.document.getElementById(btn);
      if (tmp) {
        if (i==cur) {tmp.className="confbuttondown";}
        else {tmp.className="confbutton";}
      }
    }
  }
  var tmp = parent.document.getElementById(def);
    if (tmp) {if (browser.isMSIE) {tmp.click();} else {tmp.onclick();}}

  return;
  var buttons=cur_div.getElementsByTagName('td');
  for ( var i=buttons.length-1;i>=0; i--) {
    if (buttons[i].id) {
      if (buttons[i].id.substr(0,13)=='categ_button_') {
        if (browser.isMSIE) {buttons[i].click();} else {buttons[i].onclick();}
      }
    }
  }
}

function cbover(obj){if (obj.className!="catb_select") {obj.className="catb_over";}}
function cbout(obj){if (obj.className!="catb_select") {obj.className="catb_out";}}

function getconfactivepagediv(){
  var cdiv;
  for (i=1; i<=10; i++) {
    var clr  = "confstructurebuttons" + i;
    var tmp = parent.document.getElementById(clr);
    if (tmp) {
      if (tmp.style.display=="block") {
        cdiv=tmp;
        break;
      }
    }
  }
  return cdiv;
}

var commonscrollvalue=-1;

function catmorescrollleft(side,scrollvalue,istimeout){
  if (scrollvalue || scrollvalue==0){if (istimeout){} else {commonscrollvalue=scrollvalue}} else {scrollvalue=-1;}
  if (scrollvalue>=0 && istimeout && commonscrollvalue!=scrollvalue) {
    return;
  }
  commonscrollvalue=scrollvalue;
  if (side>0) {var _sn="catmorer_down";} else {var _sn="catmorel_down";}
  if (side>0) {var obj=parent.document.getElementById("movecatright");} else {var obj=parent.document.getElementById("movecatleft");}
  b = obj.className==_sn;
  var cdiv=getconfactivepagediv();
  if (scrollvalue>=0) {if (side>0) {b = cdiv.scrollLeft<scrollvalue} else {b = cdiv.scrollLeft>scrollvalue}}
  if (b) {
    sl=cdiv.scrollLeft+side*2;
    if (cdiv) {cdiv.scrollLeft=sl;}
    if (cdiv.scrollLeft==sl) {setTimeout("catmorescrollleft("+side+","+scrollvalue+",1)",1);}
  }
  else {commonscrollvalue=-1;}
}

function catmoreover(obj,side){
  if (side>0) {var _sn="catmorer_down";} else {var _sn="catmorel_down";}
  obj.className=_sn;
  setTimeout("catmorescrollleft("+side+")",1);
}
function catmoreout(obj,side){
  if (side>0) {var _sn="catmorer_up";} else {var _sn="catmorel_up";}
  obj.className=_sn;
}

function getPosition(obj) {


// ���������� ��� �� �������
var lay_agt=navigator.userAgent.toLowerCase();
var ver=parseFloat(navigator.appVersion);

var is_ie=((lay_agt.indexOf("msie") != -1) && (lay_agt.indexOf("opera") == -1));
var is_nav=((lay_agt.indexOf('netscape')!=-1) || (lay_agt.indexOf('mozilla')!=-1) && (lay_agt.indexOf('spoofer')==-1) && (lay_agt.indexOf('compatible') == -1) && (lay_agt.indexOf('opera')==-1) && (lay_agt.indexOf('webtv')==-1));
var isMinNav4=(navigator.appName.indexOf("netscape")>= 0 && ver>=4 && ver<5);
var isOldOpera=(navigator.appName.indexOf("opera")>=0 && ver<7);
var is_opera7=(lay_agt.indexOf("opera") != -1 && ver>=7);
var is_webtv=(lay_agt.indexOf("webtv") != -1);


var iW=0, iH=0;
// ������� ������� ������� ����
// MSIE - document.body.clientWidth, clientHeight
// Netscape, Mozilla, Opera - innerWidth, innerHeight
iW = obj.clientWidth;
iH = obj.clientHeight;

var x=0, y=0, right=iW, bottom = iH;
while(obj) {
   x+=obj.offsetLeft;
   y+=obj.offsetTop;
   obj=obj.offsetParent;
}
return {x: x, y:y, right : x+right, bottom: y+bottom};
}

function select_categbutton(label){
  var label_obj = parent.document.getElementById('categ_button_'+label);
  var cdiv = getconfactivepagediv();
  var buttons=label_obj.parentNode.getElementsByTagName('td');
  for ( var i=buttons.length-1;i>=0; i--) {
    if (buttons[i].id) {if (buttons[i].id.substr(0,13)=='categ_button_' && buttons[i].className=='catb_select') {buttons[i].className = 'catb_out';}}
  }
  if (label_obj.innerWidth) {iw=label_obj.innerWidth} else {iw=label_obj.clientWidth}
  if (cdiv) {
    if (cdiv.innerWidth) {diw=cdiv.innerWidth} else {diw=cdiv.clientWidth}
    if (cdiv && cdiv.scrollLeft > label_obj.offsetLeft) {catmorescrollleft(-1,label_obj.offsetLeft);}
    if (cdiv && diw < label_obj.offsetLeft+iw-cdiv.scrollLeft) {catmorescrollleft(1,label_obj.offsetLeft+iw-diw+7);}
  }
  if (label_obj) {label_obj.className = "catb_select";}
}

function select_categ(label){
  var _last=0;
  var _object=parent.document.getElementById('printframe');
  if (_object) {
    if (_object.className=="system_view" && label=='prev') {_last=1;};
    _object.className="system_hide";
  };
  _object=parent.document.getElementById('compframe');
  if (_object) {_object.className="system_view";};

  var _curno=0,_cur='',_prev='',_next='';
  var _frame=parent.document.getElementById('compframe');
  var _doc=_frame.contentDocument||parent.frames['compframe'].document;

  if (_last){_cur='ViewSystem'}
  else {
    var _divs=_doc.getElementsByTagName('div');
    for ( var i = 0; i<_divs.length; i++) {
      if (_divs[i].id.substr(0,10)=='categ_div_') {
        if (_divs[i].style.display=='block') {_curno=1;_cur=_divs[i].id.substr(10,_divs[i].id.length-10);}
        _divs[i].style.display='none';
      }
    }
  }
  _curno=0,_prev='',_next='';
  _divs=parent.document.getElementsByTagName('td');
  for ( var i = 0; i<_divs.length; i++) {
    if (_divs[i].id.substr(0,13)=='categ_button_') {
      if (_curno==1 && _next=='') {_next=_divs[i].id.substr(13,_divs[i].id.length-13);}
      if (_divs[i].id=='categ_button_'+_cur) {_curno=1;}
      if (_curno==0) {_prev=_divs[i].id.substr(13,_divs[i].id.length-13);}
    }
  }

  if (label=='next' && (_next=='' || _next=='ViewSystem')) {
    showconfdiv(5,'categ_button_ViewSystem');
    label=_cur;
  }
  else {
    if (label=='next') { label=_next};
    if (label=='prev') {if (_prev==''){label=_cur} else{label=_prev}};
    if (label=='' && _cur!='') {label=_cur};

  var label_obj = parent.document.getElementById('categ_button_'+label);
  select_categbutton(label);

  var confno=0;
  if (label_obj) {
    while(label_obj.parentNode) {
      if (label_obj.parentNode.id && label_obj.parentNode.id.substr(0,20)=='confstructurebuttons') {
        confno=label_obj.parentNode.id.substr(20,1);
        label_obj=parent.document.getElementById('confbutton'+confno);
        if (label_obj && label_obj.className=='confbutton') {
          showconfdiv(confno,'categ_button_'+label);
        }
        break;
      }
      else {
        label_obj=label_obj.parentNode;
      }
    }
  }

  var label_obj = _doc.getElementById('categ_div_'+label);
  if (label_obj) {label_obj.style.display='block';}

  label_obj = _doc.getElementById(label+'-img');
  if (label_obj){if (browser.isMSIE) {label_obj.click();} else {label_obj.onclick();}}
  }
}

var printframe_firstload=true;

function printframe_loaded(){
  if (printframe_firstload) {printframe_firstload=false;return;};
}

function print_system(itemno){
  var starget=document.forms.System.target;
  var saction=document.forms.System.action;
  document.forms.System.target = "10";
  document.forms.System.action = "review_sysm_new.cgi?"+itemno+"&print";
  document.forms.System.submit();
  document.forms.System.target = starget;
  document.forms.System.action = saction;
  var _object=parent.document.getElementById('compframe');
  if (_object) {_object.className="system_hide";};
  _object=parent.document.getElementById('printframe');
  if (_object) {_object.className="system_view";};
  return(false);
}

function add_cart_system(){
  document.forms.System.submit();
  return(false);
}

function click_otherframe_element(frameid,elementid,buttonlabel){
  select_categbutton(buttonlabel);
  var _frame=document.getElementById(frameid);
  var _doc=_frame.contentDocument||window.frames[frameid].document;
  label_obj = _doc.getElementById(elementid);
  if (browser.isMSIE) {label_obj.click();} else {label_obj.onclick();}
}

function sf_showhide_expand(id,cur,last_id) {

     var the_block = document.getElementById(id+"-div");
     var the_image = document.getElementById(id+"-img");
     var load_src = '';
     var reload=false;

     if (the_block.style.display == "none") {
          if (id=='ViewSystem') {
            load_src="$review_modul_name?$itemno&print";
            reload=true;
          }
          else (load_src="$modul_name?$itemno&&&"+id+"&expand&"+cur+"&"+last_id);
          doPartialLoad(id+"-div",load_src,reload);
          the_block.style.display = "block";
          if (the_image) {
            the_image.src = "../img/coll_2.gif";
            the_image.alt = "Hide";
          }
     } else { return;
          the_block.style.display = "none";
          if (the_image) {
            the_image.src = "../img/coll_d.gif";
            the_image.alt = "Show";
          }
     }
}

function menubuttonmouseover(obj){obj.className="menubuttonlight";}
function menubuttonmouseout(obj){obj.className="menubutton";}

function configplatformbuttonmouseover(obj){obj.className="configplatformbuttonlight";}
function configplatformbuttonmouseout(obj){obj.className="configplatformbutton";}

function topmenumouseover(obj)
{
/*http://www.compudirect.com/img_new1/pas/X.jpg -- http://www.compudirect.com/img_new1/act/X.jpg --*/
obj.className="topmenu_over";
var s=obj.src;
obj.src=s.replace("/pas/","/act/");
}

function topmenumouseout(obj){

obj.className="topmenu_out";
var s=obj.src;
obj.src=s.replace("/act/","/pas/");
/*http://www.compudirect.com/img_new1/pas/Prebuilt_Brand_Systems.jpg*/
}

function chkForm_add_feedback() {

 if (document.Form_add_feedback.email.value=="") {
   alert("Email Address is a required field!");
   document.Form_add_feedback.email.focus();
   return false
 }

 if (document.Form_add_feedback.email.value!="") {

   if (document.Form_add_feedback.email.value.indexOf("@")==-1 ||
       document.Form_add_feedback.email.value.indexOf(".")==-1 ||
       document.Form_add_feedback.email.value.indexOf(" ")!=-1 ||
       document.Form_add_feedback.email.value.length<6) {
       alert("Sorry, your email address is not valid.");
       document.Form_add_feedback.email.focus();
       return false
   }
 }

 if (document.Form_add_feedback.comment_topic.value=="") {
   alert("Please choose a topic for your comments!");
   document.Form_add_feedback.comment_topic.focus();
   return false
 }

 if (document.Form_add_feedback.comment_text.value=="") {
   alert("Please add comments!");
   document.Form_add_feedback.comment_text.focus();
   return false
 }

}

function showlogout() {
  var tmp = parent.document.getElementById("span_logout");
  if (tmp) {tmp.className = "wh11";}
  tmp = parent.document.getElementById("link_logout");
  if (tmp) {tmp.className = "wh11";}
}

function select_manuf(manuf,prod_query)
{
  var _frame=parent.document.getElementById('framemain');
  var _doc=_frame.contentDocument||parent.frames['framemain'].document;
  _doc.location='prod_list.cgi?'+prod_query+'&onlymanuf='+manuf.value;
}

function select_priceC(priceC,prod_query)
{
  var _frame=parent.document.getElementById('framemain');
  var _doc=_frame.contentDocument||parent.frames['framemain'].document;
  if (priceC==""){
  _doc.location='prod_list.cgi?'+prod_query;
  }
  else
  {
   _doc.location='prod_list.cgi?'+prod_query+'&priceC='+priceC;            
  }
}

function loadimage(path)
{
 imageObj = new Image();
  imageObj.src="http://compudirect.my/"+path;
}




var iversion = -1;
var imgLoaded = 0;
var lav = 0;
var ipass = 0;
param="/img_new1/";

function version() {
	if (iversion != -1) return iversion;
	if(navigator.appName.indexOf("Netscape") != -1){
		if (navigator.userAgent.indexOf("Mozilla/2.0") != -1)
			iversion = 2;
			else
				if (navigator.userAgent.indexOf("Mozilla/3") != -1)
					iversion = 3;
					else
						if (navigator.userAgent.indexOf("Mozilla/4") != -1){
							iversion = 4;
							lav = 1;
						}
					else
						if (navigator.userAgent.indexOf("Mozilla/5.0") != -1){
							iversion = 5;
							lav = 1;
						}
						else
							iversion = 1;
	}
	else {
		if(navigator.appName.indexOf("Internet Explorer") != -1){
			if (navigator.userAgent.indexOf("Mozilla/4") != -1){
				iversion = 4;
				lav = 1;
			}
			else
				iversion = 1;
		}
		else
			iversion = 1;
	}
	return iversion;
}

function initIMG() {
	if (3<=version()) {
		if(document.images) {

I1On=new Image();
I1Off=new Image();
I1On.src=param+"Configurator_22.jpg";
I1Off.src=param+"Configurator_22.gif";
I2On=new Image();
I2Off=new Image();
I2On.src=param+"Configurator_23.jpg";
I2Off.src=param+"Configurator_23.gif";
I3On=new Image();
I3Off=new Image();
I3On.src=param+"Configurator_26.jpg";
I3Off.src=param+"Configurator_26.gif";
I4On=new Image();
I4Off=new Image();
I4On.src=param+"Configurator_27.jpg";
I4Off.src=param+"Configurator_27.gif" ;
imgLoaded=1;	

			}  
	}
}

function MouseOver(ImageName) {
	if (3<=version()) {
		if( imgLoaded== 0 ) return;
			document[ImageName].src=eval(ImageName + "On.src");
	}
}

function MouseOut(ImageName) {
	if (3<=version()) {
		if( imgLoaded== 0 ) return;
			document[ImageName].src=eval(ImageName + "Off.src");
	}
}