function SilverRidgeMap()
{
	LeftPosition = (window.screen.width) ? (window.screen.width-550)/2 : 0;
	TopPosition = (window.screen.height) ? (window.screen.height-471)/2 : 0;

	page = "Comm_SilverRidge_map.asp"
	window.open(page,"floorplans","width=550,height=471,top="+TopPosition+",left="+LeftPosition+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}

function Calculator()
{
	LeftPosition = (window.screen.width) ? (window.screen.width-500)/2 : 0;
	TopPosition = (window.screen.height) ? (window.screen.height-450)/2 : 0;

	page = "mortgage_calculator.asp"
	window.open(page,"floorplans","width=500,height=450,top="+TopPosition+",left="+LeftPosition+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function floorplans()
{
	LeftPosition = (window.screen.width) ? (window.screen.width-750)/2 : 0;
	TopPosition = (window.screen.height) ? (window.screen.height-520)/2 : 0;

	window.open("http://www.portraithomes.ca/floorplans.html","floorplans","width=750,height=520,top="+TopPosition+",left="+LeftPosition+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}

function siteplan()
{
	LeftPosition = (window.screen.width) ? (window.screen.width-980)/2 : 0;
	TopPosition = (window.screen.height) ? (window.screen.height-550)/2 : 0;

	window.open("Comm_SilverRidge_sitemapPH6.asp","floorplans","width=980,height=550,top="+TopPosition+",left="+LeftPosition+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}



function ChangeSize(theheight,thewidth)
{


}


function GetWidth()
{

        var x = 0;
        if (self.innerWidth)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientWidth)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
        }
        return x;



}





function ResetWidth()

{
document.getElementById("ODG").style.width = "100%";
}

function Resize()
               {
                                       if (parseInt(navigator.appVersion)>3) {
                                               if (navigator.appName=="Netscape") {
                                                winW = window.innerWidth;
                
                                               }
                                               if (navigator.appName.indexOf("Microsoft")!=-1) {
                                                winW = document.body.offsetWidth;
                                      
                                               }
                                              }
                                      
                                      
									
                                      if (winW < 980)
                                      {
                                              thediv = document.getElementById('ODG');
                                              thediv.style.width="980px";
                                      }
                                      else
                                      {
                                              thediv = document.getElementById('ODG');
                                              thediv.style.width="100%";
                                      }
					

        }
		
		
		
		
		
function PhotoGallery(PhotoID, TotalPhotos, COMM){
	LeftPosition = (window.screen.width) ? (window.screen.width-790)/2 : 0;
	TopPosition = (window.screen.height) ? (window.screen.height-595)/2 : 0;

	page = "photoGallery.asp?PhotoID="+PhotoID+"&TotalPhotos="+TotalPhotos+"&COMM="+COMM;
	window.open(page,"floorplans","width=790,height=635,top="+TopPosition+",left="+LeftPosition+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}


function openDiv(element){
      document.getElementById(element).style.display = 'block';
	  document.getElementById("btMore").style.display = 'none';
	  document.getElementById("btLess").style.display = 'block';
 	
}

function closeDiv(element){
      document.getElementById(element).style.display = 'none';
	  document.getElementById("btMore").style.display = 'block';
      document.getElementById("btLess").style.display = 'none';	
}
