function subCatSelect(catId)
     {
     if(catId)
          {
          window.location = 'prodCat_'+catId+'.html';
          }
     }
function resizeText(id,direction)
     {

     el = document.getElementById(id);
     
     if(!el.style.fontSize)
          {
          el.style.fontSize = 11+'px';
          }

     if(el.style.fontSize)
          {
          fontsize = parseInt(el.style.fontSize);
          
          if(direction == 'up' && fontsize < 18)
               {
               fontsize = fontsize + 2;
               }
          
          if(direction == 'down' && fontsize > 11)
               {
               fontsize = fontsize - 2;
               }
          
         el.style.fontSize = fontsize+'px';
          }

     }

function clickSearchOff(el,defaultValue)
     {
     if(el.value == '')
          {
          el.className = "searchBoxBlur";
          el.value = defaultValue;
          }
     }
     
function clickSearchOn(el,defaultValue)
     {
     el.className = "searchBoxFocus";
     if(el.value == defaultValue)
          {
          el.value = '';
          }
     }

//other onload scripts
function highlightConsRow()
     {
     //check page name
     var pageFileCheck = new RegExp('prodCat_');
     var pageFileCheckMatches = pageFileCheck.exec(location.href);
     if(pageFileCheckMatches)
          {
          //check for page bookmark link in url
          var bookmarkCheck = new RegExp('#');
          var bookmarkCheckMatches = bookmarkCheck.exec(location.href);
          if(bookmarkCheckMatches)
               {
               //get the bookmark link name and highlight the whole row it is in
               var bookmarks = location.href.split('#');
               bookmarks = bookmarks[1];
               document.getElementById(bookmarks+'_cellRow').className = 'highlightRow';
               }
          }
     }
function checkRequiredFields(fieldString)
     {
     //string e.g. "Field label1~Field InputId1#Field label2~Field InputId2"   
     fieldArray = fieldString.split('#');
     fieldcount = fieldArray.length;
     returnValue = true;
     for(i=0;i<fieldcount;i++)
          {
          fieldEls = fieldArray[i].split('~');
          fieldLabel = fieldEls[0];
          fieldId = fieldEls[1];
          fieldValue = document.getElementById(fieldId).value;
          if(!fieldValue || fieldValue == 'address@domain.com')
               {
               document.getElementById(fieldId).style.border = '2px solid #9e1b34';

               returnValue = false;
               }
          else
               {
               document.getElementById(fieldId).style.border = '';
               }
          }
     if(returnValue == false)
          {
          alert('You must fill in every required (*) field!');
          }
     return returnValue;
     }
window.onload = function(){highlightConsRow()};

