var checkOperation="None";
var checkReplace=0;
var checkSelect=0;
var checkPic=0;
var smallWin=null;

function AddBlock() {
//ADDED 2/23/2005
//   parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=0;
//     parent.parent.frames.mainFrame.frames.Lmain.location.reload();

//REMOVED 2/23/2005
//     parent.parent.frames.topFrame.location.reload();
//     return true
}
function AddRecommend() {
     parent.parent.frames.topFrame.location.reload();
     return true
}
function AddTodo() {
//ADDED 2/23/2005
//   parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=5;
//     parent.parent.frames.mainFrame.frames.Lmain.location.reload();


//REMOVED 2/23/2005
//     parent.parent.frames.topFrame.location.reload();
//     return true
}
function BlogEdit() {
     if (document.EditBlog.BCode.value==0) {
          alert("Please enter a Blog Title.");
          document.EditBlog.BCode.focus();
          return false
     }
     if (document.EditBlog.BDesc.value==0) {
          alert("Please enter a Blog Description.");
          document.EditBlog.BDesc.focus();
          return false
     }
     return true
}
function BlogPreview() {
     return true
}
function CardEntryCheck() {
     if (document.CheckCard.DID.value==0) {
          alert("Please select a Dependent.");
          document.CheckCard.DID.focus();
          return false
     }
     return true
}
function CategorySearchCheck() {
//     if (checkOperation=="None" || checkOperation==0) {
//         alert("Please Click a Button!");
//         return false
//     }

     return true
}
function CheckAge(stuff) {
     if (stuff.checked==true) {
         document.CheckJoin.Over.value="Yes";
     } 
     if (stuff.checked==false) {
         document.CheckJoin.Over.value="No";
     }
}
function CheckBlog(stuff) {
     if (stuff.checked==true) {
         document.PreviewBlog.ChkBlogTerms.value="Yes";
     } 
     if (stuff.checked==false) {
         document.PreviewBlog.ChkBlogTerms.value="No";
         alert("If you do not agree to these Terms,\nthis Blog entry will not be published.");
     }
     return true
}
function CheckFeature() {
   alert("This feature is not currently available.");
   return false
}
function CheckLogin(stuff) {
     if (stuff.checked==true) {
         document.CheckMember.ChkLogin.value="2";
     } 
     if (stuff.checked==false) {
         document.CheckMember.ChkLogin.value="1";
     }
}
function CheckPage() {
   alert("HTML page needed.");
   return false
}
function CheckSee(stuff) {
     if (stuff.checked==true) {
         document.CheckJoin2.ChkSee.value="Yes";
     } 
     if (stuff.checked==false) {
         document.CheckJoin2.ChkSee.value="No";
     }
}
function CheckSelectRecords(stuff) {
   if (stuff.checked==true) {
       checkSelect++;
       checkPic=stuff.value;
   }
   if (stuff.checked==false) {
       checkSelect--;
   }
}
function CheckSub(stuff) {
     if (stuff.checked==true) {
         document.CheckJoin.ChkSubscribe.value="Yes";
     } 
     if (stuff.checked==false) {
         document.CheckJoin.ChkSubscribe.value="No";
     }
}
function CheckSubscribe() {
     if (checkOperation=="None" || checkOperation==0) {
         alert("Please Click a Button!");
         return false
     }
     var valEM1=document.CheckMain.SubEmail.value;
     var theLenEM1=StripEmpty(" ",valEM1).length

     if (theLenEM1==0) {
         alert("Email is required.");
         document.CheckMain.SubEmail.focus();
         return false
     }
     if (valEM1.indexOf("@",0) < 0 || valEM1.indexOf(".")<0) {
         alert("Invalid Email Address!");
         document.CheckMain.SubEmail.focus();
         return false
     }

     return true
}
function CheckTerms(stuff) {
     if (stuff.checked==true) {
         document.CheckCustomer.ChkTerms.value="Yes";
     } 
     if (stuff.checked==false) {
         document.CheckCustomer.ChkTerms.value="No";
     }
}
function CustomerEntryCheck() {
     var valEM1=document.CheckCustomer.EM1.value;
     var theLenEM1=StripEmpty(" ",valEM1).length

     if (theLenEM1==0) {
         alert("Email is required.");
         document.CheckCustomer.EM1.focus();
         return false
     }
     if (valEM1.indexOf("@",0) < 0 || valEM1.indexOf(".")<0) {
         alert("Invalid Email Address!");
         document.CheckCustomer.EM1.focus();
         return false
     }

     if (document.CheckCustomer.A1.value==0) {
          alert("Address is required.");
          document.CheckCustomer.A1.focus();
          return false
     }
     if (document.CheckCustomer.C1.value==0) {
          alert("City is required.");
          document.CheckCustomer.C1.focus();
          return false
     }
     if (document.CheckCustomer.CN.value==0) {
          alert("Organization / Company Name is required.");
          document.CheckCustomer.CN.focus();
          return false
     }
     if (document.CheckCustomer.CountryID.value==0) {
          alert("Country is required.");
          document.CheckCustomer.CountryID.focus();
          return false
     }
     if (document.CheckCustomer.EM1.value==0) {
          alert("Email is required.");
          document.CheckCustomer.EM1.focus();
          return false
     }
     if (document.CheckCustomer.FN.value==0) {
          alert("First Name is required.");
          document.CheckCustomer.FN.focus();
          return false
     }
     if (document.CheckCustomer.LN.value==0) {
          alert("Last Name is required.");
          document.CheckCustomer.LN.focus();
          return false
     }
     if (document.CheckCustomer.P1.value==0) {
          alert("Phone Area is required.");
          document.CheckCustomer.P1.focus();
          return false
     }
     if (document.CheckCustomer.P2.value==0) {
          alert("Phone Number is incomplete.");
          document.CheckCustomer.P2.focus();
          return false
     }
     if (document.CheckCustomer.P3.value==0) {
          alert("Phone Number is incomplete.");
          document.CheckCustomer.P3.focus();
          return false
     }
     if (document.CheckCustomer.Pas1.value==0) {
          alert("Password is required.");
          document.CheckCustomer.Pas1.focus();
          return false
     }
     if (document.CheckCustomer.PhoneTypeID.value==0) {
          alert("Phone Type is required.");
          document.CheckCustomer.PhoneTypeID.focus();
          return false
     }
     if (document.CheckCustomer.StateID.value==0) {
          alert("State is required.");
          document.CheckCustomer.StateID.focus();
          return false
     }
     if (document.CheckCustomer.UN.value==0) {
          alert("Username is required.");
          document.CheckCustomer.UN.focus();
          return false
     }
     if (document.CheckCustomer.Zip.value==0) {
          alert("Zip code is required.");
          document.CheckCustomer.Zip.focus();
          return false
     }
}
function DashEntry() {

}
function DashEntryCheck() {
     if (document.CheckDash.DMiles.value==0) {
          alert("Please enter a value for Miles.");
          document.CheckDash.DMiles.focus();
          return false
     }
     if (document.CheckDash.DZip.value==0) {
          alert("Please enter a Zip Code.");
          document.CheckDash.DZip.focus();
          return false
     }
     if (document.CheckDash.Fld1.value==1) {
          alert("This field is required.");
          document.CheckDash.Fld1.focus();
          return false
     }
     if (document.CheckDash.Fld2.value==1) {
          alert("This field is required.");
          document.CheckDash.Fld2.focus();
          return false
     }

     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=3;
     parent.parent.frames.topFrame.location.reload();
     return true
}
function DashEntryCheck2() {
     if (document.CheckDash.DMiles.value==0) {
          alert("Please enter a value for Miles.");
          document.CheckDash.DMiles.focus();
          return false
     }
     if (document.CheckDash.DZip.value==0) {
          alert("Please enter a Zip Code.");
          document.CheckDash.DZip.focus();
          return false
     }
     if (document.CheckDash.Fld1.value==1) {
          alert("This field is required.");
          document.CheckDash.Fld1.focus();
          return false
     }
     if (document.CheckDash.Fld2.value==1) {
          alert("This field is required.");
          document.CheckDash.Fld2.focus();
          return false
     }
     if (document.CheckDash.Fld3.value==1) {
          alert("This field is required.");
          document.CheckDash.Fld3.focus();
          return false
     }

     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=3;
     parent.parent.frames.topFrame.location.reload();
     return true
}
function DependentCheck() {
     if (document.CheckDependent.MemberID.value==0) {
          alert("To add a Dependent, you must enter your Member ID.");
          document.CheckDependent.MemberID.focus();
          return false
     }
     return true
}
function findOperation(form) {
   checkOperation=form.value;
}
function findPWord() {
   openSmallWin('forgot_pwd.asp', 'smallWin', 625, 350);
}
function findRCode(form) {
   document.ProductSelect.RCode.value=form.value;
}
function findSearchType(form) {
   document.CheckSearch.SearchType.value=form.value;
}
function IndexEntry() {

}
function InterestCheck() {
     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=3;
     parent.parent.frames.mainFrame.frames.Lmain.location='lists.asp?numSort=0&numList=10';
     return true
}
function JoinEntryCheck() {
     var valEM1=document.CheckCustomer.EM1.value;
     var theLenEM1=StripEmpty(" ",valEM1).length

     if (theLenEM1==0) {
         alert("Email is required.");
         document.CheckCustomer.EM1.focus();
         return false
     }
     if (valEM1.indexOf("@",0) < 0 || valEM1.indexOf(".")<0) {
         alert("Invalid Email Address!");
         document.CheckCustomer.EM1.focus();
         return false
     }

//     if (document.CheckCustomer.dcode.value==1) {
//          alert("This field is required.");
//          document.CheckCustomer.dcode.focus();
//          return false
//     }
     if (document.CheckCustomer.FN.value==0) {
          alert("This field is required.");
          document.CheckCustomer.FN.focus();
          return false
     }
     if (document.CheckCustomer.LN.value==0) {
          alert("This field is required.");
          document.CheckCustomer.LN.focus();
          return false
     }
     if (document.CheckCustomer.A1.value==0) {
          alert("This field is required.");
          document.CheckCustomer.A1.focus();
          return false
     }
     if (document.CheckCustomer.C1.value==0) {
          alert("This field is required.");
          document.CheckCustomer.C1.focus();
          return false
     }
     if (document.CheckCustomer.StateID.value==1) {
          alert("This field is required.");
          document.CheckCustomer.StateID.focus();
          return false
     }
     if (document.CheckCustomer.Zip.value==0) {
          alert("Zip code is required.");
          document.CheckCustomer.Zip.focus();
          return false
     }
     if (document.CheckCustomer.CountryID.value==1) {
          alert("This field is required.");
          document.CheckCustomer.CountryID.focus();
          return false
     }
     if (document.CheckCustomer.PhoneTypeID.value==1) {
          alert("This field is required.");
          document.CheckCustomer.PhoneTypeID.focus();
          return false
     }
//     if (document.CheckCustomer.bmonth.value==1) {
//          alert("This field is required.");
//          document.CheckCustomer.bmonth.focus();
//          return false
//     }
//     if (document.CheckCustomer.bday.value==1) {
//          alert("This field is required.");
//          document.CheckCustomer.bday.focus();
//          return false
//     }
//     if (document.CheckCustomer.byear.value==1) {
//          alert("This field is required.");
//          document.CheckCustomer.byear.focus();
//          return false
//     }
     if (document.CheckCustomer.P1.value==0) {
          alert("This field is required.");
          document.CheckCustomer.P1.focus();
          return false
     }
     if (document.CheckCustomer.P2.value==0) {
          alert("This field is required.");
          document.CheckCustomer.P2.focus();
          return false
     }
     if (document.CheckCustomer.P3.value==0) {
          alert("This field is required.");
          document.CheckCustomer.P3.focus();
          return false
     }
     if (document.CheckCustomer.CN.value==0) {
          alert("Employer Name is required.\n\nIf you are unemployed, please enter 'None'.");
          document.CheckCustomer.CN.focus();
          return false
     }
//     if (document.CheckCustomer.NN.value==0) {
//          alert("This field is required.");
//          document.CheckCustomer.NN.focus();
//          return false
//     }
//     if (document.CheckCustomer.TID.value==0) {
//          alert("This field is required.");
//          document.CheckCustomer.TID.focus();
//          return false
//     }
     if (document.CheckCustomer.UN.value==0) {
          alert("Username is required.");
          document.CheckCustomer.UN.focus();
          return false
     }
     if (document.CheckCustomer.Pas1.value==0) {
          alert("Password is required.");
          document.CheckCustomer.Pas1.focus();
          return false
     }

     if (document.CheckCustomer.ChkTerms.value=="No" || document.CheckCustomer.ChkTerms.value==0) {
          alert("To become a member, you must agree to our Terms and Conditions.");
          document.CheckCustomer.ChkTerms.focus();
          return false
     }
}
function Join2EntryCheck() {
//     if (document.CheckJoin2.ChkTerms.value==0 || document.CheckJoin2.ChkTerms.value=="No") {
//          alert("You must be agree to our terms to join our site.");
//          document.CheckJoin2.ChkTerms.focus();
//          return false
//     }
     if (document.CheckJoin2.ICode.value==0) {
          alert("Headline is required.");
          document.CheckJoin2.ICode.focus();
          return false
     }
     if (document.CheckJoin2.IDesc.value==0) {
          alert("Description is required.");
          document.CheckJoin2.IDesc.focus();
          return false
     }
     if (document.CheckJoin2.Fld12.value==1) {
          alert("This field is required.");
          document.CheckJoin2.Fld12.focus();
          return false
     }
     if (document.CheckJoin2.Fld18.value==1) {
          alert("This field is required.");
          document.CheckJoin2.Fld18.focus();
          return false
     }
     if (document.CheckJoin2.Process.value==0 || document.CheckJoin2.Process.value!="Join2") {
          return false
     }
}
function Join3EntryCheck() {
     CheckPage();
     alert("The following items are required to complete the pay process:\n1-Merchant Account login data (i.e. login, password, trx key, payment URL, etc)\n2-Receipt Page.");
     alert("Cannot test Zummin.Net for members with status=Pay!");
     return false
     if (document.CheckJoin3.Process.value==0 || document.CheckJoin3.Process.value!="Join3") {
          return false
     }
}
function Join5EntryCheck() {
     if (document.CheckJoin5.Process.value==0 || document.CheckJoin5.Process.value!="Join5") {
          return false
     }
}
function MailEntry() {
//     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=1;
//     parent.parent.frames.topFrame.location.reload();
}
function MailEntryCheck() {
   return true
}
function MailReadCheck() {
     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=1;
     return true
}
function MainEntryCheck() {
     if (document.CheckMain.City.value==0) {
          alert("Please enter a City.");
          document.CheckMain.City.focus();
          return false
     }
//     parent.parent.frames.Top.document.CheckTitle.ListID.selectedIndex=1;
     return true
}
function MainEntryCheck2() {
     if (document.CheckMain.City.value==0) {
          alert("Please enter a Part Number.");
          document.CheckMain.City.focus();
          return false
     }

//     parent.parent.frames.Top.document.CheckTitle.ListID.selectedIndex=1;
     return true
}
function MemberEntryCheck() {
     if (document.CheckMember.ChkUser.value==0) {
          alert("Username is required.");
          document.CheckMember.ChkUser.focus();
          return false
     }
     if (document.CheckMember.ChkPass.value==0) {
          alert("Password is required.");
          document.CheckMember.ChkPass.focus();
          return false
     }
     if (document.CheckMember.Process.value==0 || document.CheckMember.Process.value!="Entry") {
          return false
     }
}
function MemberEntryCheck2() {
     if (document.CheckMember.ChkUser.value==0) {
          alert("Username is required.");
          document.CheckMember.ChkUser.focus();
          return false
     }
     if (document.CheckMember.ChkPass.value==0) {
          alert("Password is required.");
          document.CheckMember.ChkPass.focus();
          return false
     }
     if (document.CheckMember.Process.value==0 || document.CheckMember.Process.value!="Entry2") {
          return false
     }
     return true
}
function MgmtPartCheck() {
     if (checkOperation=="") {
         alert("Please Click a Button!");
         return false
     }
     if (checkOperation=="|<" || checkOperation=="<<" || checkOperation==">>" || checkOperation==">|" || checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO NEW BASKET" || checkOperation=="ADD TO P/N LIST" || checkOperation=="DELETE FROM P/N LIST" || checkOperation=="GO" || checkOperation=="G0" || checkOperation=="SAVE NEW BASKET" || checkOperation=="SAVE P/N LIST") {
         if (document.CheckMain.City.value==0) {
             document.CheckMain.City.focus();
             return false
         } 
         if (document.ProductSelect.Page.value==0) {
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO NEW BASKET") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To add, please select one or more Part Numbers.");
             checkOperation="None";
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="ADD TO P/N LIST") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To add to a P/N List, please select one or more Part Numbers.");
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="DELETE FROM NEW BASKET") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To delete, please select one or more Part Numbers.");
             checkOperation="None";
             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Delete Part Number(s) from new Basket?")) {

         } else {
              return false
         }
     }
     if (checkOperation=="DELETE FROM P/N LIST") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To delete from a P/N List, please select one or more Part Numbers.");
             checkOperation="None";
             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Delete Part Number(s) from P/N List?")) {

         } else {
              return false
         }
     }
     if (checkOperation=="LOAD BASKET") {
         if (document.CheckMain.SearchID.value<0 || document.CheckMain.SearchID.value==null) {
//             alert("Your new Basket is currently unsaved.");
             checkOperation="None";
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="LOAD P/N LIST") {
         if (document.CheckMain.SearchID.value<=1 || document.CheckMain.SearchID.value==null) {
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SAVE NEW BASKET") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To Save a new Basket, please search and select one or more Part Numbers.");
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SAVE P/N LIST") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To save a P/N List, please select one or more Part Numbers.");
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SEARCH") {
         if (document.CheckMain.City.value==0) {
             alert("Please enter a Part Number.");
             document.CheckMain.City.focus();
             return false
         }
//       parent.parent.frames.Top.document.CheckTitle.ListID.selectedIndex=1;

//       MM_jumpMenuTop('parent.frames.Main.frames[\'Left\']',this,false," & FlagList & ",3)

//       parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=3;

         parent.parent.frames.Main.frames.Left.location='site_lists.asp?numList=10&numSort=0&DisplayProduct=1&ListProduct='+document.CheckMain.ListProduct.value+'&City='+document.CheckMain.City.value+'';


     }
     if (checkOperation=="SUBMIT RFQ") {
         if (document.CheckMain.SearchID.value<=1 || document.CheckMain.SearchID.value==null) {
             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Submit RFQ from Loaded Basket #"+document.CheckMain.SearchID.value+"?")) {

         } else {
             return false
         }
     }
   return true
}
function MgmtPartCheck2() {
     if (checkOperation=="") {
         alert("Please Click a Button!");
         return false
     }
     if (checkOperation=="|<" || checkOperation=="<<" || checkOperation==">>" || checkOperation==">|" || checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO NEW BASKET" || checkOperation=="ADD TO P/N LIST" || checkOperation=="DELETE FROM P/N LIST" || checkOperation=="GO" || checkOperation=="G0" || checkOperation=="SAVE NEW BASKET" || checkOperation=="SAVE P/N LIST") {
//         if (document.CheckMain.City.value==0) {
//             document.CheckMain.City.focus();
//             return false
//         } 
         if (document.ProductSelect.Page.value==0) {
//             document.CheckMain.City.focus();
             checkOperation="None";
             return false
         }
     }
     if (checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO NEW BASKET") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To add, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="ADD TO P/N LIST") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To add to a P/N List, please select one or more Part Numbers.");
//             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="DELETE FROM BASKET" || checkOperation=="DELETE FROM NEW BASKET") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To delete, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Delete Part Number(s) from new Basket?")) {

         } else {
              return false
         }
     }
     if (checkOperation=="DELETE FROM P/N LIST") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To delete from a P/N List, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Delete Part Number(s) from P/N List?")) {

         } else {
              return false
         }
     }
     if (checkOperation=="LOAD BASKET") {
         if (document.CheckMain.SearchID.value<0 || document.CheckMain.SearchID.value==null) {
//             alert("Your new Basket is currently unsaved.");
             checkOperation="None";
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="LOAD P/N LIST") {
         if (document.CheckMain.SearchID.value<=1 || document.CheckMain.SearchID.value==null) {
             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SAVE NEW BASKET") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To Save a new Basket, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SAVE P/N LIST") {
         if (checkSelect<=0 || checkSelect==null) {
             alert("To save a P/N List, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
     }
     if (checkOperation=="SEARCH") {
         if (document.CheckMain.City.value==0) {
             alert("Please enter a Part Number.");
             document.CheckMain.City.focus();
             return false
         }
//       parent.parent.frames.Top.document.CheckTitle.ListID.selectedIndex=1;
     }
//     if (checkOperation=="SUBMIT RFQ") {
//         if (document.CheckMain.SearchID.value<=1 || document.CheckMain.SearchID.value==null) {
//             document.CheckMain.City.focus();
//             return false
//         }
//         if (confirm("Submit RFQ from Loaded P/N List #"+document.CheckMain.SearchID.value+"?")) {
//             return CheckFeature();
//         } else {
//             return false
//         }
//     }
     if (checkOperation=="SUBMIT RFQ") {
         if (document.ProductSelect.SearchID.value<=1 || document.ProductSelect.SearchID.value==null) {
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Submit RFQ from Loaded Basket #"+document.ProductSelect.SearchID.value+"?")) {

         } else {
             return false
         }
     }
   return true
}
function MgmtRFQCheck() {
     if (checkOperation=="" || checkOperation=="None") {
         alert("Please Click a Button!");
         return false
     }
     if (checkOperation=="|<" || checkOperation=="<<" || checkOperation==">>" || checkOperation==">|" || checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO NEW BASKET" || checkOperation=="ADD TO P/N LIST" || checkOperation=="DELETE FROM P/N LIST" || checkOperation=="GO" || checkOperation=="G0" || checkOperation=="SAVE NEW BASKET" || checkOperation=="SAVE P/N LIST" || checkOperation=="SUBMIT RFQ") {
//         if (document.ProductSelect.SelectID.value==0) {
//             document.CheckMain.City.focus();
//             checkOperation="None";
//             return false
//         }
     }
     if (checkOperation=="DELETE FROM RFQ") {
         if ((checkSelect<=0 || checkSelect==null) && (document.ProductSelect.CheckRecord.value==0 || document.ProductSelect.CheckRecord.value==null)) {
             alert("To delete from RFQ, please select one or more Part Numbers.");
             checkOperation="None";
//             document.CheckMain.City.focus();
             return false
         }
         if (confirm("Delete Part Number(s) from RFQ?")) {

         } else {
              return false
         }
     }
     if (checkOperation=="SUBMIT RFQ") {
//         if (document.ProductSelect.SearchID.value<=1 || document.ProductSelect.SearchID.value==null) {
//             checkOperation="None";
//             document.CheckMain.City.focus();
//             return false
//         }
//         return CheckFeature();

//         parent.parent.frames.Top.document.CheckTitle.ListID.selectedIndex=1;

     }
     return true
}
function MM_jumpMenu(targ,selObj,restore) {
   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
}
function MM_jumpMenuTop(targ,selObj,restore,chklist,intList) {
       if (chklist) {

       } else {
           if (intList==2 || intList==4) {
              parent.frames.Right.location='cjoin1.asp';
           }
           if (intList==5) {
              parent.frames.Right.location='index.asp';
           }
       }
}
function NoteEdit() {
//     if (document.EditNote.NDesc.value==0) {
//          alert("To submit, a Testimonial is required.");
//          document.EditTest.TDesc.focus();
//          return false
//     }
//     return true
}
function PaymentEntryCheck() {
   if (checkOperation=="None" || checkOperation=="") {
       alert("Please Click a Button!");
       return false
   }
   if (checkOperation=="PURCHASE") {
       if (CheckPayment.PMID.value==1) {
           alert('Please enter your Payment Method.');
           CheckPayment.PMID.focus();
           return false; 
       }
       if (CheckPayment.CardNumber.value=='') {
           alert('Please enter your Credit Card number.');
           CheckPayment.CardNumber.focus();
           return false; 
       }
       if (CheckPayment.CardFirstName.value=='') {
           alert('Please enter your First Name as it appears on your credit card.');
           CheckPayment.CardFirstName.focus();
           return false; 
       }
       if (CheckPayment.CardLastName.value=='') {
           alert('Please enter your Last Name as it appears on your credit card.');
           CheckPayment.CardLastName.focus();
           return false; 
       }
       if (CheckPayment.CardID.value=='') {
           alert('Please enter your Card ID.');
           CheckPayment.CardID.focus();
           return false; 
       }
       return true
   } else {
       return false
   }
}
function PicEntry() {
   document.CheckPics.CheckRecord[0].checked=false;
   document.CheckPics.CheckRecord[1].checked=false;
   document.CheckPics.CheckRecord[2].checked=false;
   document.CheckPics.CheckRecord[3].checked=false;
   document.CheckPics.CheckRecord[4].checked=false;
   document.CheckPics.CheckRecord[5].checked=false;
   document.CheckPics.CheckRecord[6].checked=false;
   document.CheckPics.CheckRecord[7].checked=false;
   document.CheckPics.CheckRecord[8].checked=false;
   document.CheckPics.CheckRecord[9].checked=false;
}
function PicEntryCheck() {
   if (checkOperation=="None") {
       alert("Please Click a Button!");
       return false
   }
   if (checkOperation=="Add/Replace") {
//       if (checkType=="0" && checkPic!="1") {
//           upgradenow();
//           return false
//       }
       if (checkSelect > 1) {
           alert("To Replace, Select One Image at a time.");
	   return false
       }
//       if (checkSelect < 1) {
//           alert("Please select an Image to Replace.");
//	   return false
//       }
   }
   if (checkOperation=="Delete") {
//       if (checkType=="0" && checkPic!="1") {
//           upgradenow();
//           return false
//       }
       if (checkSelect < 1) {
           alert("Please select an Image to Delete.");
	   return false
       }
   }
   if (checkOperation=="Make Public") {
//       if (checkType=="0") {
//           upgradenow();
//           return false
//       }
       if (checkSelect > 1) {
           alert("To Make Public, Select One Image at a time.");
	   return false
       }
       if (checkSelect==1) {
//           if (checkPic=="1") {checkFile="imagefile1";}
//           if (checkPic=="2") {checkFile="imagefile2";}
//           if (checkPic=="3") {checkFile="imagefile3";}
//           if (checkPic=="4") {checkFile="imagefile4";}
//           if (checkPic=="5") {checkFile="imagefile5";}
//           if (checkPic=="6") {checkFile="imagefile6";}
//           if (checkPic=="7") {checkFile="imagefile7";}
//           if (checkPic=="8") {checkFile="imagefile8";}
//           if (checkFile=="") {
//               alert("There is no image to Make Public.");
//               return false
//           }
           if (checkPic==1) {
               alert("There is no image to Make Public.");
               return false
           }
       }
       if (checkSelect < 1) {
           alert("Please select an Image to Make Public.");
	   return false
       }
   }
   if (checkOperation=="Send") {
//       if (checkType=="0") {
//           upgradenow();
//           return false
//       }
       if (checkSelect > 1) {
           alert("To Send, Select One Image at a time.");
	   return false
       }
       if (checkSelect==1) {
	   var val=document.CheckPics.imagemail.value;
           var theLen=StripEmpty(" ",val).length
           if (theLen==0) {
               alert("Email Address is Required!");
               CheckPics.imagemail.focus();
               return false
           }
           if (val.indexOf("@",0) < 0 || val.indexOf(".")<0) {
               alert("Invalid Email Address!");
               CheckPics.imagemail.focus();
               return false
           }
       }
       if (checkSelect < 1) {
           alert("Please Select an Image to Send.");
	   return false
       }
   }
}
function ProductPageCheck() {
     if (checkOperation=="") {
         alert("Please Click a Button!");
         return false
     }
     if (checkOperation=="ADD TO NEW BASKET" || checkOperation=="ADD TO BASKET" || checkOperation=="ADD TO CART") {    
         var valQTY=document.ProductPage.QTY.value;
         var theQTY=StripEmpty(" ",valQTY).length
         if (theQTY==0 || valQTY==0) {
             alert("QTY is empty.");
             document.ProductPage.QTY.focus();
             return false
         }
     }
     if (checkOperation=="SEND") {
         var val=document.ProductPage.EMailTo.value;
         var theLen=StripEmpty(" ",val).length
         if (theLen==0) {
             alert("Please enter an EMail Address!");
             document.ProductPage.EMailTo.focus();
             return false
         }
         if (val.indexOf("@",0) < 0 || val.indexOf(".")<0) {
             alert("Invalid Email Address!");
             document.ProductPage.EMailTo.focus();
             return false
         }
     }
     return true
}
function ProfileEntry() {
//   parent.parent.frames.topFrame.location.reload();
}

function ProfileUpdate() {
     var valEM1=document.UpdateProfile.MEmail.value;
     var theLenEM1=StripEmpty(" ",valEM1).length

     if (document.UpdateProfile.MPass.value==0) {
          alert("Password is required.");
          document.UpdateProfile.MPass.focus();
          return false
     }
     if (theLenEM1==0) {
         alert("Email is required.");
         document.UpdateProfile.MEmail.focus();
         return false
     }
     if (valEM1.indexOf("@",0) < 0 || valEM1.indexOf(".")<0) {
         alert("Invalid Email Address!");
         document.UpdateProfile.MEmail.focus();
         return false
     }
     if (document.UpdateProfile.MConfirm.value==0) {
          alert("Email needs to be confirmed.");
          document.UpdateProfile.MConfirm.focus();
          return false
     }
     if (document.UpdateProfile.MConfirm.value!=document.UpdateProfile.MEmail.value) {
          alert("Email was not confirmed.");
          document.UpdateProfile.MConfirm.focus();
          return false
     }
     if (document.UpdateProfile.MZip.value==0) {
          alert("Zip code is required.");
          document.UpdateProfile.MZip.focus();
          return false
     }
     if (document.UpdateProfile.Fld1.value==1) {
          alert("This field is required.");
          document.UpdateProfile.Fld1.focus();
          return false
     }
     if (document.UpdateProfile.Fld2.value==1) {
          alert("This field is required.");
          document.UpdateProfile.Fld2.focus();
          return false
     }
     if (document.UpdateProfile.Fld3.value==1) {
          alert("This field is required.");
          document.UpdateProfile.Fld3.focus();
          return false
     }
     if (document.UpdateProfile.Fld12.value==1) {
          alert("This field is required.");
          document.UpdateProfile.Fld12.focus();
          return false
     }
     if (document.UpdateProfile.ICode.value==0) {
          alert("Headline is required.");
          document.UpdateProfile.ICode.focus();
          return false
     }
     if (document.UpdateProfile.IDesc.value==0) {
          alert("Description is required.");
          document.UpdateProfile.IDesc.focus();
          return false
     }
     return true
}
function PWordCheck() {
     if (document.CheckPWord.pword.value==0) {
         alert("Username or email address is required.");
         document.CheckPWord.pword.focus();
         return false
     }

     var valEM1=document.CheckPWord.pword.value;
     var theLenEM1=StripEmpty(" ",valEM1).length

     if (theLenEM1==0) {
         alert("Username or email address is required.");
         document.CheckPWord.pword.focus();
         return false
     }
     return true
}
function openSmallWin(URL, windowName, windowWidth, windowHeight, scrollbars) {
   var xposition = 325; 
   var yposition = 210;

   if (!scrollbars) var scrollbars = 0;
   var args="width=" + windowWidth + "," + "height=" + windowHeight + "," + "location=0," + "menubar=0," + "scrollbars=" + scrollbars + "," + "status=0," + "titlebar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition;
   if (smallWin != null && !smallWin.closed) {
       smallWin.close();
   }
   smallWin = window.open(URL, windowName, args);
   smallWin.focus();
}
function SearchPartCheck() {
   if (checkOperation=="" || checkOperation=="None") {
       return false
   }

   var valCity="";
   var valCode="";
   var valName="";
   var valList=1;
   var valSearch=document.CheckSearch.SearchType.value;
   var valSort=1;

   if (valSearch==null) {
      valSearch="0";
   }

   if (valSearch=="0") {
       valCity=document.CheckSearch.QUser.value;
       valList=2;
       valSort=1;
   } 
   if (valSearch=="1") {
//       valCity=document.CheckSearch.QMake.value+''+document.CheckSearch.QCode.value+'';
       valCity=document.CheckSearch.QMake.value;
       valCode=document.CheckSearch.QCode.value;
       valName=document.CheckSearch.QMake.value;
       valList=6;
       valSort=0;
   } 
   if (valSearch=="2") {
       valCity=document.CheckSearch.QMake.value+''+document.CheckSearch.QCode.value;
       valCode=document.CheckSearch.QCode.value;
       valList=0;
       valSort=2;
   }
   if (checkOperation=="GO") {
       if (document.CheckSearch.SearchType.value==0 && document.CheckSearch.QUser.value==0) {
           document.CheckSearch.QUser.focus();
           return false
       }
//       parent.frames.Main.frames.Left.location='site_lists.asp?numList=10&numSort='+valSort+'&DisplayProduct=0&ListProduct=2&City='+document.CheckSearch.QMake.value+''+document.CheckSearch.QUser.value+'&QUser='+document.CheckSearch.QMake.value+''+document.CheckSearch.QUser.value+'&SearchType='+document.CheckSearch.SearchType.value+'';

       parent.frames.Main.frames.Right.location='c1.asp?DisplayPage=0&ListProduct='+valList+'&SortProduct='+valSort+'&DisplayProduct=0&City='+valCity+'&QCode='+valCode+'&QName='+valName+'&QUser='+document.CheckSearch.QUser.value+'&SearchType='+document.CheckSearch.SearchType.value+'';

   }
   return true
}
function StoreCartCheck() {
     if (checkOperation=="" || checkOperation=="None") {
         return false
     }
     if (checkOperation=="DOWNLOAD") {
         if (checkSelect > 1) {
             alert("Multiple Downloads Not Allowed Yet.  To Download, Select One Graphic at a time.");
             return false
         }
         if (checkSelect==1) {
             if (confirm("Download Record?")) {
             }
             else {
                 alert("Download Cancelled!");
                 return false
             }
         }
         if (checkSelect < 1) {
             alert("Please Select a Record.");
             return false
         }
     }
     return true
}
function StripEmpty(theFilter,theString) {
   var strOut,i,curChar
   strOut=""
   for (i=0;i < theString.length; i++) {		
        curChar=theString.charAt(i)
        if (theFilter.indexOf(curChar) < 0)
            strOut += curChar		
   }	
   return strOut
}
function TestEdit() {
     if (document.EditTest.TDesc.value==0) {
          alert("To submit, a Testimonial is required.");
          document.EditTest.TDesc.focus();
          return false
     }
     return true
}
function Test1ReadCheck() {
//     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=1;
     return true
}
function Test2ReadCheck() {
//     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=1;
     return true
}
function Test3ReadCheck() {
//     parent.parent.frames.topFrame.document.CheckTitle.ListID.selectedIndex=1;
     return true
}




hideElements = new Array();

// hides selectors when user rolls over horizontal dropdown
function findForm() {
	//alert('this is ie');
	//hideElements = new Array();
	for (var f=0; f<window.document.forms.length; f++) {
		var theForm = window.document.forms[f];
		for (var e=0; e<theForm.elements.length; e++) {
			var theElem = theForm.elements[e];
			if (theElem.type.substr(0,6) == "select") {
				hideElements.push(theElem);
			}
		}
	}
}


// set up month rollover scripts
function setNav() {

	// decide if dropdown should hide any flash objects on the page
	var av = navigator.appVersion.toLowerCase();
	var ua = navigator.userAgent.toLowerCase();
	var platform;
	var browser;
	var hideFlash = false;
	var hideAd = false;
	if (av.indexOf("mac") != -1) {
		platform = "mac";
	} else if (av.indexOf("windows") != -1) {
		platform = "win";
	}
	if (ua.indexOf("firefox") != -1) {
		browser = "firefox";
	}

	// if firefox...
	if (browser == "firefox") {
		//alert('user has firefox');
		hideFlash = true;
	}
	
	if (browser == "firefox" || ua.indexOf("safari") != -1) {
		hideAd = true;
	}



	// swfPresent will be defined if hiding swfs
	if (window.swfList) {
		swfPresent = true;
		//alert('hiding: '+swfsToHide);
		//alert(swfList.length);
	} else {
		swfPresent = false;
		//alert('nothing to hide');
	}
	


	// drop down
	if (document.getElementById && document.getElementById("topNav")) {
		navRoot = document.getElementById("topNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "collapsed") {
			
				node.onmouseover = function() {
					this.className = 'expanded';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'hidden';
							}
						}
					}
				}
				
				node.onmouseout = function() {
				this.className = 'collapsed';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'visible';
							}
						}
					}
				}
				
				for (j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].className == "dropContainer") {
						elem = node.childNodes[j];
						for (k=0; k<elem.childNodes.length; k++) {
							if (elem.childNodes[k].className == "dropMenu") {
								menuElem = elem.childNodes[k];
						
								for (q=0; q<menuElem.childNodes.length; q++) {
									if (menuElem.childNodes[q].className == "dropItem") {
										dropElem = menuElem.childNodes[q];
										dropElem.onmouseover = function() {
											//
											this.className = 'dropItem';
										}
										dropElem.onmouseout = function() {
											//
											this.className = 'dropItem';
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	if (navigator.appName == "Microsoft Internet Explorer" && platform != "mac") {
		isIE = true;
		window.attachEvent("onload", findForm);
		//window.onload = findForm;
	}	
}
function goTo(where) {
	window.location = where;
}
function goToNew(where,winName,features) {
	window.open(where,winName,features);
}
// do it
window.onload = setNav;

// unrelated for html dropdowns
function gotosite(site) {
    if (site != "") {
        window.location=site;
    }
}