/*Popup Window Functions*/
var popUpWin;
var popDefWidth = 570;
var popDefHeight = 400;
var lastWidth;
var lastHeight;
 
//Open URL in new window with fixed dimensions
function openWin(url, pixWidth, pixHeight, canScroll){
 var winFeatures = "width=" + pixWidth + ",height=" + pixHeight + "," + getCentered(pixWidth,pixHeight) + ",resizable=no,scrollbars=";
 if (canScroll){
  winFeatures += "yes";
 } else {
  winFeatures += "no";
 }
 if (popUpWin != null){
  if (popUpWin.closed){
   popUpWin = window.open(url, "popwin", winFeatures);
   popUpWin.focus();
  } else if ((lastWidth == pixWidth) && (lastHeight == pixHeight)){
   popUpWin.location.href = url;
   popUpWin.focus();
  } else {
   popUpWin.close();
   var timeDelay = 0;
   if (navigator.userAgent.indexOf("Safari") != -1){
    timeDelay = 1000;
   }
   var winWait = window.setTimeout('popUpWin = window.open("' + url + '", "popwin", "' + winFeatures + '");popUpWin.focus();', timeDelay);
  } 
 } else {
  popUpWin = window.open(url, "popwin", winFeatures);
  popUpWin.focus();
 }
 lastWidth = pixWidth;
 lastHeight = pixHeight;
}
 
//Get coordinates for centering window
function getCentered(popupWidth, popupHeight){
 var indentNetscapeWidth = 'screenX=' + getIndent(popupWidth, false);
 var indentNetscapeHeight = 'screenY=' + getIndent(popupHeight, true);
 var indentMSIEWidth = 'left=' + getIndent(popupWidth, false);
 var indentMSIEHeight = 'top=' + getIndent(popupHeight, true);
 var centerCoordinates = indentNetscapeWidth + ',' + indentNetscapeHeight + ',' + indentMSIEWidth + ',' + indentMSIEHeight;
 return centerCoordinates;
}
 
//Determine top and left margins for window
function getIndent (popupDimension, isHeight){
 if (isHeight){
  return ((screen.availHeight - popupDimension) / 2);
 } else {
  return ((screen.availWidth - popupDimension) / 2);
 }
}
 
function popImage(imgURL, imgWidth, imgHeight){
 var imgURL = "/popimage.aspx?img=" + imgURL + "&w=" + imgWidth + "&h=" + imgHeight;
 openWin(imgURL, imgWidth, imgHeight);
}

/*for dropdown function */
function findCategory() {	
var whereto= document.categoryDrop.category[document.categoryDrop.category.selectedIndex].value;	
var whereNow="./../residential/"+whereto;
window.location=whereNow;
	return false;
	}

/*for rollover function */
function rollMeIn (letter){
document.getElementById(letter).src="./../images/glossary_assets/"+letter+"_over.gif"
}
function rollMeOut (letter){

document.getElementById(letter).src="./../images/glossary_assets/"+letter+"_off.gif"
}
