enabled = "no";
// detect browser version
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ((bName == "Netscape" && bVer >= 3)||(bName == "Microsoft Internet Explorer" && bVer >= 4)) ver = "good";
//if (bName == "Microsoft Internet Explorer" && bVer >= 4) ver = "good";
else ver = "xx";


// Make an array of on images buttons
function commencer() {
if (ver == "good") {
linkoff = new MakeArray(6);
linkoff[1].src = "images/gr_nav01_off.gif";
linkoff[2].src = "images/gr_nav02_off.gif";
linkoff[3].src = "images/gr_nav03_off.gif";
linkoff[4].src = "images/gr_nav04_off.gif";
linkoff[5].src = "images/gr_nav05_off.gif";
linkoff[6].src = "images/gr_nav06_off.gif";

linkon = new MakeArray(6);
linkon[1].src = "images/gr_nav01_on.gif";
linkon[2].src = "images/gr_nav02_on.gif";
linkon[3].src = "images/gr_nav03_on.gif";
linkon[4].src = "images/gr_nav04_on.gif";
linkon[5].src = "images/gr_nav05_on.gif";
linkon[6].src = "images/gr_nav06_on.gif";

nomen = new Array(6);
nomen[1] = "nav1";
nomen[2] = "nav2";
nomen[3] = "nav3";
nomen[4] = "nav4";
nomen[5] = "nav5";
nomen[6] = "nav6";

enabled = "yes";
}
}

function MakeArray(n) {
this.length = n;
for (var i = 1; i<=n; i++) {
this[i] = new Image()
}
return this;
}
// The rollover functions
function changeon(n,id) {
if ((ver == "good") && (enabled == "yes")){
if (document.layers && id)
	{
		document.layers[id].document.images[nomen[n]].src = linkon[n].src;	
	}
	else if (document.images)
	{
	document.images[nomen[n]].src = linkon[n].src;	
	}
}
}
function changeoff(n,id) {
if ((ver == "good") && (enabled == "yes")){
if (document.layers && id)
	{
		document.layers[id].document.images[nomen[n]].src = linkoff[n].src;	
	}
	else if (document.images)
	{
	document.images[nomen[n]].src = linkoff[n].src;
	}

}
}
// -->


// open new window

function NewWin () {
	newWindow = window.open('','NewWin','toolbar=no,status=no,width=765,height=350,location=yes,right=20,top=20,scrollbars=yes,resizable')
	newWindow.focus()
}	

//rollover 

function rollOver(which,state) {
    if (document.images) {
        document.images[which].src = document.images[which].src.substring(0,document.images[which].src.lastIndexOf('_')) + "_" + state + ".gif";
    }
}

//load alternates
function loadAlternates(suffix,lookFor) {
    if (document.images) {
        altImages = new Array(document.images.length);
        for (var k in altImages) {
            if (document.images[k].src.indexOf(lookFor) >= 0) {
                altImages[k] = new Image();
                altImages[k].src = (document.images[k].src.substring(0,document.images[k].src.lastIndexOf('_')) + "_" + suffix + ".gif");
            }
        }
    }
}


//launch new window for download pqa
	function newWindow() {
  			    newwin=window.open("contact_pda.html",'','left=0,top=0,width=480,height=430,resizable=0,status=0,scrollbars=0,toolbar=0,menubar=0,location=0,directories=0');
		} 

	function PopArticle(pagetoopen) {
		openCenteredOnOpenerWindow(pagetoopen, 'contact', 400, 400, '', true, '', 'opener');
	}
		
	function PopDirections() {
  			    newwin=window.open("http://www.mapquest.com/directions/main.adp?go=1&do=nw&ct=NA&1y=US&1a=&1p=&1c=&1s=&1z=&2y=US&2a=162+East+Park+Avenue&2p=&2c=Long+Beach&2s=NY&2z=11561&lr=2&x=61&y=10",'','left=100,top=100,width=700,height=400,resizable=0,status=0,scrollbars=1,toolbar=0,menubar=0,location=0,directories=0');
		}	
		
	function PopMortgage() {
  			    newwin=window.open("http://www.jericholoans.com",'','left=100,top=200,width=600,height=400,resizable=1,status=0,scrollbars=1,toolbar=0,menubar=0,location=0,directories=0');
		}	
		
	function PopMls() {
  			    newwin=window.open("http://3PV.mlsstratus.com/brokerreciprocity/brkrecip.asp?referer=http%3A%2F%2Fgullrealty.com%2FTemplates%2FIncludes%2F",'','left=100,top=200,width=600,height=400,resizable=1,status=0,scrollbars=1,toolbar=0,menubar=0,location=0,directories=0');
		}	
		
	function PopOpenhouse() {
  			    newwin=window.open("popup_open_house.html",'','left=400,top=350,width=320,height=350,resizable=1,status=0,scrollbars=1,toolbar=0,menubar=0,location=0,directories=0');
		}		
	
	
//window opener

// Window opener functions  v1.0.6
// http://www.dithered.com/javascript/window/index.html
// code by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)

/*******************************************************************************
	Popup Window openers
*******************************************************************************/

var winReference = null;


// Open a window at a given position on the screen
function openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {
	
	// ie 4.5 and 5.0 mac - windows are 2 pixels too short; if a statusbar is used, the window will be an additional 15 pixels short
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("mac") != -1 && agent.indexOf("msie") != -1 && (agent.indexOf("msie 4") != -1 || agent.indexOf("msie 5.0") != -1) ) {
		height += (status) ? 17 : 2;
	}

	// Adjust width if scrollbars are used (pc places scrollbars inside the content area; mac outside) 
	width += (scrollbars != '' && scrollbars != null && agent.indexOf("mac") == -1) ? 16 : 0;

	var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');
	var reference = openWindow(url, name, properties, openerName);
	
	// resize window in ie if we can resize in ns; very messy
	// commented out because openPositionedWindow() doesn't set the resizable attribute
	// left in for reference
	/*if (resizable && agent.indexOf("msie") != -1) {
		if (agent.indexOf("mac") != -1) {
			height += (status) ? 15 : 2;
			if (parseFloat(navigator.appVersion) > 5) width -= 11;
		}
		else {
			height += (status) ? 49 : 31;
			width += 13;
		}
		setTimeout('if (reference != null && !reference.closed) reference.resizeTo(' + width + ',' + height + ');', 150);
	}*/

	return reference;
}


// Open a window at the center of the screen
function openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName) {
	var x, y = 0;
	if (screen) {
      x = (screen.availWidth - width) / 2;
	   y = (screen.availHeight - height) / 2;
   }
	if (!status) status = '';
	if (!openerName) openerName = '';
	var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);
	return reference;
}	


// Open a window at the center of the parent window
function openCenteredOnOpenerWindow(url, name, width, height, status, scrollbars, moreProperties, openerName) {
	var centerX = 0;
   var centerY = 0;
   if (window.screenX != null && window.outerWidth) {
      centerX = window.screenX + (window.outerWidth / 2);
      centerY = window.screenY + (window.outerHeight / 2);
   }
   else if (window.screenLeft) {
      if (document.documentElement) {
         centerX = window.screenLeft + (document.documentElement.offsetWidth / 2);
         centerY = window.screenTop + (document.documentElement.offsetHeight / 2);
      }
      else if (document.body && document.body.offsetWidth) {
         centerX = window.screenLeft + (document.body.offsetWidth / 2);
         centerY = window.screenTop + (document.body.offsetHeight / 2);
      }
   }
   
   if (centerX == 0) {
      openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName);
   }
   var x = parseInt(centerX - (width / 2));
   var y = parseInt(centerY - (height / 2));
	if (!status) status = '';
	if (!openerName) openerName = '';
	var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);
	return reference;
}	


// Open a full-screen window (different from IE's fullscreen option)
function openMaxedWindow(url, name, scrollbars, openerName) {
	var x, y = 0;
	var width  = 600;
	var height = 800;
	if (screen) {
      if (screen.availLeft) {
         x = screen.availLeft;
         y = screen.availTop;
      }
      width  = screen.availWidth - 6;
	   height = screen.availHeight - 29;
   }
	var reference = openPositionedWindow(url, name, width, height, x, y, false, scrollbars, openerName);
	return reference;
}


// Open a full-chrome (all GUI elements) window
// This is like using a target="_blank" in a normal link but allows focussing the window
function openFullChromeWindow(url, name, openerName) {
	return openWindow(url, name, 'directories,location,menubar,resizable,scrollbars,status,toolbar');
}


// Open a sized full-chrome (all GUI elements) window 
function openSizedFullChromeWindow(url, name, width, height, openerName) {
	return openCenteredWindow(url, name, width, height, true, true, 'directories,location,menubar,resizable,toolbar', openerName)
}


// Core utility function that actually creates the window and gives focus to it
function openWindow(url, name, properties, openerName) {

	// ie4.x pc can't give focus to windows containing documents from a different domain
	// in this case, initially load a local interstisial page to allow focussing before loading final url
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) == 4 && agent.indexOf("msie 5") == -1 && agent.indexOf("msie5") == -1 && agent.indexOf("win") != -1 && url.indexOf('http://') == 0) {
		winReference = window.open('about:blank', name, properties);
		
		setTimeout('if (winReference && !winReference.closed) winReference.location.replace("' + url + '")', 300);
	}
	else {
		winReference = window.open(url, name, properties);
	}

	// ie doesn't like giving focus immediately (to new window in 4.5 on mac; to existing ones in 5 on pc)
	setTimeout('if (winReference && !winReference.closed) winReference.focus()', 200);
	
	if (openerName) self.name = openerName;
	return winReference;
}


/*******************************************************************************
	Modal Dialog controls
*******************************************************************************/

// Close a dialog
// Call from onunload event handler of any page that can create a dialog
function closeDialog(dialog) {
	if (dialog && dialog.closed != true) dialog.close();
}


// Close parent popup
// Call from onload event handler of any page that could be created from a dialog
function closeParentDialog() {
	if (top.opener && isWindowPopup(top.opener)) {
		root = top.opener.top.opener;
		top.opener.close();
		top.opener = root;
	}
}


// Check if a window is a popup
function isWindowPopup(win) {
	return ((win.opener) ? true : false);
}
		

// -->



