function windowOpen(newLoc, width, height, resizable, scrollbars)  {
  if (!width)  
    width = 750;
  if (!height)  
    height = 500;
  if (!resizable)  
    resizable = 'no';
  if (!scrollbars)  
    scrollbars = 'no';
  if (!newLoc)
    newLoc = "about:blank";

  var params = 'toolbar=no, location=no, directories=no, menubar=no, scrollbars=' + scrollbars + ', resizable=' + resizable + ', status=no, top=20, left=60, height=' + height + ', width='+ width;
  
  newWin = window.open(newLoc, 'newWin', params);
  newWin.window.focus();
}

function checkUncheckCheckbox(formObj, status)  {
  for (i = 0; i < formObj.length; i++)  {
    if (formObj[i].type == 'checkbox')  {
      formObj[i].checked = status;
    }
  }
}

function Go(url)  {
  if (url)  {
    window.location.href = url;
  }
}

function showSquareTitle(sTitle, positionIndex)  {
  if (document.getElementById('squareTitle') && sTitle)  {
  	sText = sTitle;
  	if (positionIndex)  {
  		sText = '<img src="img/1.gif" alt="" width="'+ (positionIndex * 26 - 1) +'" height="10" border="0">'+ sTitle;
  	}
    document.getElementById('squareTitle').innerHTML = sText;
  }
}

function highlightHeaderIcon(oImage)  {
  sImagePath = oImage.src.substr(0, oImage.src.lastIndexOf('/')) +'/';
  sImageName = oImage.src.substr(oImage.src.lastIndexOf('/') + 1).replace(/\.gif/, '');
//  oImage.src = sImagePath + sImageName +'-a.gif';
  if (document.getElementById('headerIconDescriptionImage'))  {
    document.getElementById('headerIconDescriptionImage').src = sImagePath + sImageName +'-text.gif';
  }
}

function lowlightHeaderIcon(oImage, sDefaultDescriptionImagePath)  {
  sImagePath = oImage.src.substr(0, oImage.src.lastIndexOf('/')) +'/';
  sImageName = oImage.src.substr(oImage.src.lastIndexOf('/') + 1).replace(/-a\.gif/, '');
//  oImage.src = sImagePath + sImageName +'.gif';
  if (!sDefaultDescriptionImagePath)  {
    sDefaultDescriptionImagePath = sImagePath +'default-text.gif';
  }
  if (document.getElementById('headerIconDescriptionImage'))  {
    document.getElementById('headerIconDescriptionImage').src = sDefaultDescriptionImagePath;
  }
}

gImageCounter = 0;
function preloadImage(sSrc)  {
  eval('var img_'+ gImageCounter +' = new Image();');
  eval('img_'+ gImageCounter +'.src = "'+ sSrc +'";');
  gImageCounter++;
}

function masterPreloadImage(sName, sSrc, sHoverSrc)  {
  if (document.images) {
    if (sHoverSrc)  {
      shname = sName +'_hover';
      oImage = new Image();
      oImage.name = shname;
      oImage.src = sHoverSrc;
      document.images[shname] = oImage;
    }
    if (sSrc)  {
      oImage = new Image();
      oImage.name = sName;
      oImage.src = sSrc;
      document.images[sName] = oImage;
    }
  }
}
