//**********************************************************************************
//function open Window starts----------------------------------------------------------
function openWindowFull(ImageName)
{
    w = parseInt( screen.width  - 10 ) ;
    h = parseInt( screen.height - 65 ) ;
    
    wind = window.open("show_big_image.php?ImageName=" + ImageName , "" , 
                           "height=" + h + ", width=" + w + ", scrollbars=yes, " +
                           "resizable=yes" + ", left=0, top=0");


}//openWindowFull()

//**********************************************************************************

function openWindow(path,w,h)
{
  a = window.open(path,"","height=" + h + ",width=" + w + ",scrollbars=yes," +
       "resizable=yes" + ",left=" + (screen.width-w)/2 + ",top=" + (screen.height-h)/2);
}

//**********************************************************************************
function getBrowser(){
  var agtStr = navigator.userAgent;
  var browser = 0;
  var ver;
  var ind = agtStr.indexOf('Gecko');  
  if (ind != -1){
    ver = agtStr.substr(ind+6, 8);
    if (ver < 20020823){
      browser = 1;
    } else {
      browser = 2;    
    }
  } else {
    ind = agtStr.indexOf('Konqueror');
    if (ind != -1){
      ver = agtStr.substr(ind+10, 1);
      if (ver >= 2){
        browser = 1;
      }      
    } else {
      ind = agtStr.indexOf('Opera');
      if (ind != -1){
        ver = agtStr.substr(ind+6, 1);
        if (ver >= 6){
          browser = 1;
        }      
      } else {
        ind = agtStr.indexOf('MSIE');
        if (ind != -1){
          ver = agtStr.substr(ind+5, 3);
          if (ver >= 5.5){
            browser = 3;
          } else {
            browser = 1;
          }      
        }                
      }      
    }       
  }
  return browser;
}

//**********************************************************************************

function URLencode(sStr) {
    return escape(sStr).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
  }


//**********************************************************************************
function reDirect(pageLocation) {
   location.href = pageLocation;
}

//**********************************************************************************
function setOptions(selectedValue, frmObj, catOptionObj, subCatOptionObj)  {
   subCatOptionObj.options.length = 0;
   catArr    = catSubCatArr[0];
   subCatArr = catSubCatArr[1];
   subCatOptionObj.options[subCatOptionObj.options.length] = new Option( "" , "" ); // adds a blank one at the top
   for ( var x = 0 ; x < catArr.length  ; x++ ) {
      if ( catArr[x] == selectedValue ) {
         subCatOptionObj.options[subCatOptionObj.options.length] = new Option( subCatArr[x] , subCatArr[x] );
      }
   }
   
    subCatOptionObj.options.selectedIndex = 0;
}


