//closeChild and linkWindow are interdependent
var child = null;
function closeChild()
{
   if ( child != null)
   {
      if ( ! child.closed)
         child.close();
   }
}
function linkWindow(contentsURL, winName, winProps, width, height) {
     if (!winName) var winName = "midsize";
     if (!winProps) var winProps = "menubar=0,toolbar=1,resizable=1,location=0,status=0,scrollbars=1";
     var x ; 
     var y ; 
     
     if (!width) var w = 700; 
     else w = width;
     
     if (!height) var h = 440;
     else h = height;
     
     x= (window.screen.width/2) - (w/2 + 10);
     y= (window.screen.height/2) - (h/2 + 10);
     
     if (x<0) x=0;
     if (y<0) y=0;
     
     var args = "width=" + w + ",height=" + h
      + "," + winProps
      + ",screenx=" + x + ",screeny=" + y
      + ",left=" + x + ",top=" + y;
	closeChild();
			 child=window.open(contentsURL, winName, args);
	child.focus();
     
}
var newwindow = null;
function opennewwindow(url,windowname,winattributes)
{
var newwin = false;
if (newwindow!=null)
	{
		if (!newwindow.closed)
			newwindow.close();
	}

if (newwindow == null)
	newwin = true;
else
{
	if(newwindow.closed)
		newwin = true;
}

if (newwin)
	newwindow = window.open( url, windowname,winattributes);
else
{
	newwindow.document.location = url;
}
newwindow.focus();
}
// image MouseOver Function
function swapImg(imgLocation, imgName) {
  if(document.images) {
    document.images[imgLocation].src = eval(imgName + ".src");
  }
 }
 // image MouseOver Function all lowercase for staged site!!
function swapimg(imgLocation, imgName) {
  if(document.images) {
    document.images[imgLocation].src = eval(imgName + ".src");
  }
 }
  