browserName              = navigator.appName;
browserVer               = parseInt ( navigator.appVersion );
version                  = "n2";

if ( browserName        == "Netscape" && browserVer >= 3 ) version = "n3";
if ( browserName        == "Microsoft Internet Explorer" && browserVer >= 4 ) version = "e4";

if ( version == "n3" || version == "e4" ) {
   Apply_Off             = new Image ( 112 , 23 );
   Apply_On              = new Image ( 112, 23 );
   Apply_Off.src         = "../images/Buttons/Hover/Apply-Off.gif";
   Apply_On.src          = "../images/Buttons/Hover/Apply-On.gif";

   Board_Off             = new Image ( 112 , 23 );
   Board_On              = new Image ( 112, 23 );
   Board_Off.src         = "../images/Buttons/Hover/Board-Off.gif";
   Board_On.src          = "../images/Buttons/Hover/Board-On.gif";

   Contact_Off           = new Image ( 112 , 23 );
   Contact_On            = new Image ( 112, 23 );
   Contact_Off.src       = "../images/Buttons/Hover/Contact-Off.gif";
   Contact_On.src        = "../images/Buttons/Hover/Contact-On.gif";

   Database_Off          = new Image ( 112 , 23 );
   Database_On           = new Image ( 112, 23 );
   Database_Off.src      = "../images/Buttons/Hover/Database-Off.gif";
   Database_On.src       = "../images/Buttons/Hover/Database-On.gif";

   FAQs_Off              = new Image ( 112 , 23 );
   FAQs_On               = new Image ( 112, 23 );
   FAQs_Off.src          = "../images/Buttons/Hover/FAQs-Off.gif";
   FAQs_On.src           = "../images/Buttons/Hover/FAQs-On.gif";

   Home_Off              = new Image ( 112 , 23 );
   Home_On               = new Image ( 112, 23 );
   Home_Off.src          = "../images/Buttons/Hover/Home-Off.gif";
   Home_On.src           = "../images/Buttons/Hover/Home-On.gif";

   IARO_Events_Off       = new Image ( 112 , 23 );
   IARO_Events_On        = new Image ( 112, 23 );
   IARO_Events_Off.src   = "../images/Buttons/Hover/IARO-Events-Off.gif";
   IARO_Events_On.src    = "../images/Buttons/Hover/IARO-Events-On.gif";

   IARO_News_Off         = new Image ( 112 , 23 );
   IARO_News_On          = new Image ( 112, 23 );
   IARO_News_Off.src     = "../images/Buttons/Hover/IARO-News-Off.gif";
   IARO_News_On.src      = "../images/Buttons/Hover/IARO-News-On.gif";

   Industry_News_Off     = new Image ( 112 , 23 );
   Industry_News_On      = new Image ( 112, 23 );
   Industry_News_Off.src = "../images/Buttons/Hover/Industry-News-Off.gif";
   Industry_News_On.src  = "../images/Buttons/Hover/Industry-News-On.gif";

   Links_Off             = new Image ( 112 , 23 );
   Links_On              = new Image ( 112, 23 );
   Links_Off.src         = "../images/Buttons/Hover/Links-Off.gif";
   Links_On.src          = "../images/Buttons/Hover/Links-On.gif";

   Members_Off           = new Image ( 112 , 23 );
   Members_On            = new Image ( 112, 23 );
   Members_Off.src       = "../images/Buttons/Hover/Members-Off.gif";
   Members_On.src        = "../images/Buttons/Hover/Members-On.gif";

   Membership_Off        = new Image ( 112 , 23 );
   Membership_On         = new Image ( 112, 23 );
   Membership_Off.src    = "../images/Buttons/Hover/Membership-Off.gif";
   Membership_On.src     = "../images/Buttons/Hover/Membership-On.gif";

   Other_Events_Off      = new Image ( 112 , 23 );
   Other_Events_On       = new Image ( 112, 23 );
   Other_Events_Off.src  = "../images/Buttons/Hover/Other-Events-Off.gif";
   Other_Events_On.src   = "../images/Buttons/Hover/Other-Events-On.gif";

   Our_People_Off        = new Image ( 112 , 23 );
   Our_People_On         = new Image ( 112, 23 );
   Our_People_Off.src    = "../images/Buttons/Hover/IARO-People-Off.gif";
   Our_People_On.src     = "../images/Buttons/Hover/IARO-People-On.gif";

   Publications_Off      = new Image ( 112 , 23 );
   Publications_On       = new Image ( 112, 23 );
   Publications_Off.src  = "../images/Buttons/Hover/Publications-Off.gif";
   Publications_On.src   = "../images/Buttons/Hover/Publications-On.gif";

   Sitemap_Off           = new Image ( 112 , 23 );
   Sitemap_On            = new Image ( 112, 23 );
   Sitemap_Off.src       = "../images/Buttons/Hover/Sitemap-Off.gif";
   Sitemap_On.src        = "../images/Buttons/Hover/Sitemap-On.gif";

   Terms_Off             = new Image ( 112 , 23 );
   Terms_On              = new Image ( 112, 23 );
   Terms_Off.src         = "../images/Buttons/Hover/Terms-Off.gif";
   Terms_On.src          = "../images/Buttons/Hover/Terms-On.gif";
}

function button_on ( imgName ) {
   if (version == "n3" || version == "e4") {
      butOn = eval(imgName + "_On.src");
      document [imgName].src = butOn;
   }
}

function button_off ( imgName ) {
   if (version == "n3" || version == "e4") {
      butOff = eval(imgName + "_Off.src");
      document [imgName].src = butOff;
   }
}

function openwindow(url,win_nam,scr_x,scr_y) {
   //var scrnw=scr_x;
   //var scrnh=scr_y;
   var scrnw=(screen.width/10)*9;
   var scrnh=(screen.height/10)*8;
   var scrnx=(screen.width-scrnw)/2;
   var scrny=(screen.height-scrnh)/2;
   if (scrny > 25) {
       scrny = scrny - 25;
   }
   var winam=win_nam;
   if (scrnh > 480) {
      if (screen.height > 480) {
         var setng="resizable=yes,scrollbars=no,toolbar=no,width="+scrnw+",height="+scrnh+",screenX="+scrnx+",screenY="+scrny+",left="+scrnx+",top=5";
     } else {
         scrnh = 400;
         var setng="resizable=yes,scrollbars=yes,toolbar=no,width="+scrnw+",height="+scrnh+",screenX="+scrnx+",screenY="+scrny+",left="+scrnx+",top="+scrny;
      }
   } else {
      var setng="resizable=yes,scrollbars=yes,toolbar=no,width="+scrnw+",height="+scrnh+",screenX="+scrnx+",screenY="+scrny+",left="+scrnx+",top="+scrny;
   }
   var childwindow=window.open(url,winam,setng);
   childwindow.focus();
}
//
// Description Field Text Counter Routines
//
function TrackCount(fieldObj,countFieldName,maxChars) {
  var countField = eval("fieldObj.form."+countFieldName);
  var diff = maxChars - fieldObj.value.length;
  //
  // Need to check & enforce limit here also in case user pastes data
  //
  if (diff < 0) {
    fieldObj.value = fieldObj.value.substring(0,maxChars);
    diff = maxChars - fieldObj.value.length;
  }
  countField.value = diff;
}
function LimitText(fieldObj,maxChars) {
  var result = true;
  if (fieldObj.value.length >= maxChars) {
     result = false;
  }
  if (window.event) {
     window.event.returnValue = result;
     return result;
  }
}
//
// Subscription Form Validation Routines
//
function all_lists_selected (total_cats) {
   var tc=total_cats;
   for (i = 1; i <= tc; i++) {
      var cat_id = eval("document.IndustryNews.category_" + i);
      cat_id.checked  = true;
      cat_id.disabled = true;
   }
}

function some_lists_selected (total_cats) {
   var tc=total_cats;
   for (i = 1; i <= tc; i++) {
      var cat_id = eval("document.IndustryNews.category_" + i);
      cat_id.disabled = false;
   }
}
function valform () {
   var ml_email = IndustryNews.email.value;
   ml_email     = ml_email.replace(/^\s*(.*)/, "$1");
   if (ml_email == "") {
      alert("Please specify a valid e-mail address");
      IndustryNews.email.focus();
      return false;
   } else {
      var emailStr = new String(ml_email);
      var emindex  = emailStr.indexOf("@");
      if (emindex > 0) {
         var pindex = emailStr.indexOf(".",emindex);
         if ((pindex > emindex+1) && (emailStr.length > pindex+1)) {
         } else {
            alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
            IndustryNews.email.focus();
            return false;
         }
      } else {
         alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
         IndustryNews.email.focus();
         return false;
      }
   }
   //
   var chk_count = 0;
   //
   var chk_1 = IndustryNews.category_1.checked;
   if (chk_1 != "") {
      chk_count++;
   }
   var chk_2 = IndustryNews.category_2.checked;
   if (chk_2 != "") {
      chk_count++;
   }
   var chk_3 = IndustryNews.category_3.checked;
   if (chk_3 != "") {
      chk_count++;
   }
   var chk_4 = IndustryNews.category_4.checked;
   if (chk_4 != "") {
      chk_count++;
   }
   var chk_5 = IndustryNews.category_5.checked;
   if (chk_5 != "") {
      chk_count++;
   }
   var chk_6 = IndustryNews.category_6.checked;
   if (chk_6 != "") {
      chk_count++;
   }
   var chk_7 = IndustryNews.category_7.checked;
   if (chk_7 != "") {
      chk_count++;
   }
   var chk_8 = IndustryNews.category_8.checked;
   if (chk_8 != "") {
      chk_count++;
   }
   var chk_9 = IndustryNews.category_9.checked;
   if (chk_9 != "") {
      chk_count++;
   }
   var chk_10 = IndustryNews.category_10.checked;
   if (chk_10 != "") {
      chk_count++;
   }
   if (chk_count < 1) {
      alert("Please select at least one Industry News category to subscribe to");
      return false;
   }
   //
   // IARO Member Info
   //
   var FirstName  = IndustryNews.firstname.value;
   FirstName      = FirstName.replace(/^\s*(.*)/, "$1");
   if (FirstName == "") {
      alert("Please enter your first name.");
      IndustryNews.firstname.focus();
      return false;
   }
   var Surname    = IndustryNews.surname.value;
   Surname        = Surname.replace(/^\s*(.*)/, "$1");
   if (Surname   == "") {
      alert("Please enter your surname.");
      IndustryNews.surname.focus();
      return false;
   }
   var Company    = IndustryNews.company.value;
   Company        = Company.replace(/^\s*(.*)/, "$1");
   if (Company   == "") {
      alert("Please enter your company name.");
      IndustryNews.company.focus();
      return false;
   }
   //
   var ml_email_conf    = prompt("Please re-enter your e-mail address to verify it.",""); 
   //
   // Is the prompt result a NULL string or ""?
   //
   if (ml_email_conf   == null || ml_email_conf == ""){ // Cancel pressed 
      //
      // YES - So issue an error!
      //
      alert("You must verify your e-mail address before you can complete your IARO Industry News subscription"); 
      return false;
   } else {
      //
      // NO - Is the trimmed prompt result a ""?
      //
      ml_email_conf      = ml_email_conf.replace(/^\s*(.*)/, "$1");
      if (ml_email_conf == "") { // no entry text 
         //
         // YES - So issue an error!
         //
         alert("You must re-enter your e-mail address before you can complete your IARO Industry News subscription"); 
         return false;
      } else {
         //
         // NO - Does the trimmed prompt result match the e-mail address fiel value?
         //
         if (ml_email_conf != ml_email) { // no match 
            //
            // NO - So issue an error!
            //
            alert("E-mail verification failed. Please check your e-mail address and re-verify before completing your IARO Industry News subscription"); 
            return false;
         }
      }
      return true;
   }
}
function valform_nonmem () {
   var ml_email = IndustryNews.email.value;
   ml_email     = ml_email.replace(/^\s*(.*)/, "$1");
   if (ml_email == "") {
      //alert("Please specify a valid e-mail address");
      //IndustryNews.email.focus();
      //return false;
   } else {
      var emailStr = new String(ml_email);
      var emindex  = emailStr.indexOf("@");
      if (emindex > 0) {
         var pindex = emailStr.indexOf(".",emindex);
         if ((pindex > emindex+1) && (emailStr.length > pindex+1)) {
         } else {
            alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
            IndustryNews.email.focus();
            return false;
         }
      } else {
         alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
         IndustryNews.email.focus();
         return false;
      }
   }
   var FirstName  = IndustryNews.firstname.value;
   FirstName      = FirstName.replace(/^\s*(.*)/, "$1");
   if (FirstName == "") {
      alert("Please enter your first name.");
      IndustryNews.firstname.focus();
      return false;
   }
   var Surname    = IndustryNews.surname.value;
   Surname        = Surname.replace(/^\s*(.*)/, "$1");
   if (Surname   == "") {
      alert("Please enter your surname.");
      IndustryNews.surname.focus();
      return false;
   }
   var Company    = IndustryNews.company.value;
   Company        = Company.replace(/^\s*(.*)/, "$1");
   if (Company   == "") {
      alert("Please enter your company name.");
      IndustryNews.company.focus();
      return false;
   }
   //
   // Field validations complete - is password field defined?
   //
   if (ml_email != "") {
      //
      // YES - So prompt user to verify e-mail address
      //
      var ml_email_conf    = prompt("Please re-enter your e-mail address to verify it",""); 
      //
      // Is the prompt result a NULL string or ""?
      //
      if (ml_email_conf   == null || ml_email_conf == ""){ // Cancel pressed 
         //
         // YES - So issue an error!
         //
         alert("You must verify your e-mail address before you can access current Industry News flashes"); 
         return false;
      } else {
         //
         // NO - Is the trimmed prompt result a ""?
         //
         ml_email_conf      = ml_email_conf.replace(/^\s*(.*)/, "$1");
         if (ml_email_conf == "") { // no entry text 
            //
            // YES - So issue an error!
            //
            alert("You must verify your e-mail address before you can access current Industry News flashes"); 
            return false;
         } else {
            //
            // NO - Does the trimmed prompt result match the e-mail address fiel value?
            //
            if (ml_email_conf != ml_email) { // no match 
               //
               // NO - So issue an error!
               //
               alert("The e-mail address values you have entered differ. Please re-enter your e-mail address"); 
               return false;
            }
         } 
      }
   }
}
function valform_suggest () {
   //
   var news_title = IndustryNews.news_title.value;
   news_title     = news_title.replace(/^\s*(.*)/, "$1");
   if (news_title == "") {
      alert("Please enter a news title");
      IndustryNews.news_title.focus();
      return false;
   }
   var news_text  = IndustryNews.news_text.value;
   news_text      = news_text.replace(/^\s*(.*)/, "$1");
   if (news_text == "") {
      alert("Please enter the text of the news item you are suggesting");
      IndustryNews.news_text.focus();
      return false;
   }
   //
   var news_category   = 0;
   var ButtonCount     = IndustryNews.newscategory.length;
   var i               = 0;
   for (i = 0; i <= IndustryNews.newscategory.length-1; i++) {
      if (IndustryNews.newscategory[i].checked === true) {
         news_category = IndustryNews.newscategory[i].value;
      }
   }
   if (news_category < 1) {
      alert("Please select at least one Industry News category");
      return false;
   }
   //
   // IARO Member Info
   //
   var FirstName  = IndustryNews.firstname.value;
   FirstName      = FirstName.replace(/^\s*(.*)/, "$1");
   if (FirstName == "") {
      alert("Please enter your first name.");
      IndustryNews.firstname.focus();
      return false;
   }
   var Surname    = IndustryNews.surname.value;
   Surname        = Surname.replace(/^\s*(.*)/, "$1");
   if (Surname   == "") {
      alert("Please enter your surname.");
      IndustryNews.surname.focus();
      return false;
   }
   var Company    = IndustryNews.company.value;
   Company        = Company.replace(/^\s*(.*)/, "$1");
   if (Company   == "") {
      alert("Please enter your company name.");
      IndustryNews.company.focus();
      return false;
   }
   //
   // IARO Member e-mail
   //
   var ml_email = IndustryNews.email.value;
   ml_email     = ml_email.replace(/^\s*(.*)/, "$1");
   if (ml_email == "") {
      alert("Please specify a valid e-mail address");
      IndustryNews.email.focus();
      return false;
   } else {
      var emailStr = new String(ml_email);
      var emindex  = emailStr.indexOf("@");
      if (emindex > 0) {
         var pindex = emailStr.indexOf(".",emindex);
         if ((pindex > emindex+1) && (emailStr.length > pindex+1)) {
         } else {
            alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
            IndustryNews.email.focus();
            return false;
         }
      } else {
         alert("Please specify a valid e-mail address (yourname@yourdomain.com)");
         IndustryNews.email.focus();
         return false;
      }
   }
   //
}



