﻿    var myWindow = null;
         
     function openWindow(pageHtml, widthPage, heightPage) 
      {
          
        if(myWindow == null || myWindow.closed)
        {
        // open window centered 
         var width = widthPage;
         var height = heightPage;
         var left = parseInt((screen.availWidth/2) - (width/2));
         var top = parseInt((screen.availHeight/2) - (height/2));
         var windowFeatures = "width=" + width + ",height=" + height + ",menubar=no,scrollbars=no,toolbar=no,status=no,close=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
         myWindow = window.open(pageHtml, "newCenteredWindow", windowFeatures);
        }
        else
        {
          myWindow.focus();
        } 

         
      }


 // RollOver Images 
   function changeImage(imgName,imgObjName)
   {

    if (document.images)
	 {
       document.images[imgName].src = eval(imgObjName + ".src");	  
     }
   }
 
    
      
    // Change Cottage photo and info 
    function changeCottageInfo(imgName,imgObjName, CottageOptionInfo)
    {

    if (document.images)
	 {
	   document.images[imgName].src = eval(imgObjName + ".src");
       document.getElementById("CottagePlan").innerHTML = CottageOptionInfo;	
      }
    }
    
    function  maximizeBrowser() 
    {
        top.window.moveTo(0,0); 
        if (document.all) 
        {
            top.window.resizeTo(screen.availWidth,screen.availHeight);
        } 
        else if 
           (document.layers || document.getElementById) 
           { 
              if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
              { 
                  top.window.outerHeight = top.screen.availHeight; 
                  top.window.outerWidth = top.screen.availWidth;
               } 
           } 
     }
    