  function getObject(name){
    if (document.getElementById)
      return document.getElementById(name);
    else if (document.all)
      return document.all[name];
  }
  // Textbox will only allow numbers (and Enter)
  function numeric_textbox(event) {
    if ((event.keyCode < 45 || event.keyCode > 57) && (event.keyCode != 13)) {
      event.returnValue = false;
      return false;
    } else {
      return true;
    }
  }



// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//

//this function goes in functions.js
function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}




function EmptyDiv(d)
{

  while (d.firstChild)
  {
    d.removeChild(d.firstChild);
  }
}

function EmptyCombo(oSel)
{
  if(window.ActiveXObject)//IE
  {
    EmptyDiv(oSel)
  }
  else // All others
  {
    EmptyDiv(oSel)
  }
}


function GetCookie(cookieId)
{

  var retval = '';
  var strCookArr = document.cookie.split(";");
  for(i=0, imax=strCookArr.length ; i<imax; i++)
  {
    tempCook = strCookArr[i].split("=");
    if(tempCook[0]==cookieId)
    { retval = tempCook[1] }
  }
  return retval;
}

function SetCookie(cookieName,cookieValue,nDays)
{
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}

function DeleteCookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}


function cloneObject(what) {
    for (i in what) {
        this[i] = what[i];
    }
}

//-------------------------------------------------------------------------------------------------

function shrinkImage(theImg, Proportion) {

  var strCommand;

  if (theImg.width != 0) {
    theImg.width = Proportion * theImg.width;
  } else {
    strCommand = "document.getElementById('" + theImg.id + "').width = " + Proportion + " * document.getElementById('" + theImg.id + "').width;";
    if (isSafari()) {
      strCommand += "ReRender();";
    }
    setTimeout(strCommand, 100);
  }
}

//-------------------------------------------------------------------------------------------------
//Detect Safari
function isSafari() {
  if (self.screenTop && self.screenX){
    return true;
  } else {
    return false;
  }
}

//-------------------------------------------------------------------------------------------------
// Hack Rerender (for safari)
function ReRender() {
  if (isSafari()) {
    if  (navigator.platform.toLowerCase().indexOf('mac') != -1) {
	    window.resizeTo(self.outerWidth + 1, self.outerHeight);
	    window.resizeTo(self.outerWidth - 1, self.outerHeight);
    }
  }
}

function ReRenderFireFox() {
  if (self.outerWidth > 0) {
    window.resizeTo(self.outerWidth + 1, self.outerHeight);
    window.resizeTo(self.outerWidth - 1, self.outerHeight);
  }
}

//-------------------------------------------------------------------------------------------------
//dsInfo object
//scTempImg.dsID, scTempImg.dsType, scTempImg.title, scTempImg.src, scTempImg.dsPicFileName, scTempImg.dsShortDesc, scTempImg.dsLongDesc);
function dsInfoClass(dsID, dsType, dsTitle, dsThumbFileName, dsPicFileName, dsShortDesc, dsLongDesc)
{
  this.dsID = dsID;
  this.dsType = dsType;
  this.dsTitle = dsTitle;
  this.title = dsTitle;
  this.src = dsThumbFileName;
  this.dsThumbFileName= dsThumbFileName;
  this.dsPicFileName = dsPicFileName;
  this.dsShortDesc = dsShortDesc;
  this.dsLongDesc = dsLongDesc;
}

//-------------------------------------------------------------------------------------------------
//dsSearchInfo object class
function dsSearchInfo(dsID, dsType, dsTitle, dsThumbFileName)
{
  this.dsID = dsID;
  this.dsType = dsType;
  this.dsTitle = dsTitle;
  this.dsThumbFileName= dsThumbFileName;
}






