function resolveObject (object) {	switch (typeof (object)) {		case "string":			if (document.getElementById) return document.getElementById (object)			// Internet Explorer 4 or Opera with IE user agent			else if (document.all) return document.all[object]			// Navigator 4			else if (document.layers) return document.layers[object];			break;		default: return object;	}}//	onload event adder - Adds an onload event to any existing window.onload events.//	Usage://		addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);//		addLoadEvent(function() {//		  more code to run on page load //		});function addLoadEvent(func) {	var oldonload = window.onload;	if (typeof window.onload != 'function') {		window.onload = func;	} else {		window.onload = function() {			 if (oldonload) {oldonload();}			 func();		}	}}function setVisibility (object, flag) {//	object = resolveObject (object);	object = typeof (object) == "object" ? object : resolveObject (object);	flag = flag ? 'visible' : 'hidden';	if (object && (object.style.visibility !=flag)) {object.style.visibility = flag;} // DOM3 = IE5, NS6}//	Opacity Controls//	These functions operate on the following opacity CSS properties://	filter: alpha(opacity=X); -moz-opacity:Y;//	where 0 <= X <= 100 and 0.0 <= Y <= 1.0function getOpacityModel (object) {	if (object.filters) {return "IE"}	else return "Other"}function getOpacity (object) {	object = resolveObject (object);	if (!object.opacityModel) {object.opacityModel = getOpacityModel (object)}	if (object) {		switch (object.opacityModel) {			case "IE":				case "IE":	return object.filters.alpha.opacity; break;			default:			if (object.style) {				var style = object.style;				if (style.opacity) return style.opacity =="" ? 0 :Math.round (parseFloat (style.opacity) *100);				if (style.MozOpacity) return style.MozOpacity =="" ? 0 :Math.round (parseFloat (style.MozOpacity) *100);				if (style.KhtmlOpacity) return style.KhtmlOpacity =="" ? 0 :Math.round (parseFloat (style.KhtmlOpacity) *100);				return 0;			}		}	}	if (object.Interval) clearInterval (object.Interval)	alert ("Opacity not found");}function setOpacity (object, target, step, interval) {	object = resolveObject (object);//	object = typeof (object) == "object" ? object : resolveObject (object);	if (!step) {		if (!object.opacityModel) {object.opacityModel = getOpacityModel (object)}		setVisibility (object, target);		switch (object.opacityModel) {			case "IE":		object.filters.alpha.opacity = target; break;			default:			if (object.style) {				var style = object.style;				target = target/100;				style.KhtmlOpacity = target;				target = Math.min (target, .9999);				target = Math.max (target, .0001);				style.opacity = target;				style.MozOpacity = target;			}		}	} else if (!interval) {		var opacity = getOpacity (object);		if (opacity <target) {setOpacity (object, opacity +=step)}		else if (opacity >target) {setOpacity (object, opacity -=step)}		else if (object.Interval) {clearInterval (object.Interval)}	} else {		if (object.Interval) clearInterval (object.Interval)		if (!object.id) object.id = "rotation" +Math.random();		object.Interval=setInterval("setOpacity ('"+object.id +"'," +target +"," +step +")", interval);//		object.Interval=setInterval(setOpacity, interval, object.id, target, step);	}}function preloadImages (images) {	var preload = new Array();	var counter = images.length-1;	if (counter) {		do {			preload[counter] = new Image();			preload[counter].src = images[counter].getAttribute('src');		} while (--counter);	}}function isA(o,klass){ if(!o.className) return false; return new RegExp('\\b'+klass+'\\b').test(o.className) }function $c (c,object, tag) { object=object||document;	if (!object.length) object = [object];	var elements = [];	for(var i = 0, e; e = object[i]; i++) {		if(e.getElementsByTagName) {			var children = e.getElementsByTagName(tag || '*');			for (var j = 0, child; child = children[j]; j++) {				if(isA(child,c)) elements.push ? elements.push(child) : elements[elements.length] = child;			}		}	}	return elements}function initRotation (container, step, interval, delay) {	container = resolveObject (container);	if (!container) {alert ("Container not found")}	else {//		container.rotationArray = container.getElementsByTagName('img');		container.rotationArray = $c("ImageRotation", container, "img");		container.rotationCurrent = 0;		setVisibility (container.rotationArray[0], true);		setOpacity (container.rotationArray[0], 100);		preloadImages (container.rotationArray);		if (step && interval && delay) container.rotationInterval = setInterval ("doRotation ('" +container.id +"'," +step +"," +interval +")", delay);	}}function Nudge (object, pixels) {	object = resolveObject (object);	object.style.left = pixels +"px";}function Rattle (object, pixels) {	object = resolveObject (object);	var position = parseInt (object.style.left);alert(position);//	setTimeout (Nudge, 50, image, pixels);	image.nudger = window.setTimeout ("Nudge ('PunchMe', '5')", 50);//	setTimeout (Nudge, 50, image, "-" +pixels);	image.nudger = window.setTimeout ("Nudge ('PunchMe', '-5')", 50);}function PunchIt (container) {	container = resolveObject (container);	image = container.rotationArray [container.rotationCurrent];	image.id = "PunchMe";	for (var counter=0; counter <10; counter++) {//alert(counter);			image.rattler = window.setTimeout (Rattle, 50, image, "5");//			image.rattler = window.setTimeout ("Rattle ('PunchMe', '5')", 150);	}	//Nudge (image, "0");}function stopRotation (container) {	container = resolveObject (container);	if (container.rotationInterval) clearInterval (container.rotationInterval);}function doRotation (container, step, interval) {//	var Debug = document.getElementById ? document.getElementById ("Debug") :false;		container = resolveObject (container);	var thisIndex = container.rotationCurrent++;	var thisImage = container.rotationArray [thisIndex];	if (thisImage.Interval) clearInterval (thisImage.Interval);	if (!container.rotationArray [container.rotationCurrent]) container.rotationCurrent =0;	var nextIndex = container.rotationCurrent;	var nextImage = container.rotationArray [nextIndex];		if (nextIndex > thisIndex) {		setVisibility (nextImage, true);		setOpacity (nextImage, 100, step, interval);			} else if (nextIndex < thisIndex) {		var counter = thisIndex;		if (--counter) {			do {				setOpacity (container.rotationArray[counter], 0);			} while (--counter);		}		setOpacity (nextImage, 100);		setOpacity (thisImage, 0, step, interval);	}//	if (Debug) Debug.innerHTML = "<div>Background: " +container.style.backgroundImage+"</div>";/*	if (Debug) {		Debug.innerHTML = Debug.innerHTML+"<div>Foreground:"+container.rotationCurrent +": " +nextImage.src+"</div>";		for (counter=0; counter <container.rotationArray.length; counter++) {			var testOpacity = getOpacity (container.rotationArray [counter]);			Debug.innerHTML = Debug.innerHTML+"<div>Shown at " +testOpacity +":"+counter +": " +container.rotationArray [counter].src+"</div>"		}	}*/} function hideElementById (ID) {	if (document.getElementById) { // DOM3 = IE5, NS6		document.getElementById(ID).style.visibility = 'hidden';	} else {		if (document.layers) { // Netscape 4			document.hideshow.visibility = 'hidden';		} else { // IE 4			document.all.hideshow.style.visibility = 'hidden';		}	}}function showElementById (ID) {	if (document.getElementById) { // DOM3 = IE5, NS6		document.getElementById(ID).style.visibility = 'visible';	} else {		if (document.layers) { // Netscape 4			document.hideshow.visibility = 'visible';		} else { // IE 4			document.all.hideshow.style.visibility = 'visible';		}	}} function toggleCommunityDetails (ID) {	var Element;	Expand = document.getElementById ('Expand' +ID);	Collapse = document.getElementById ('Collapse' +ID);	Details = document.getElementById ('Details' +ID);	if ((Details.style.display == 'none') || (Details.style.display == '')){		Details.style.display = 'block';		Expand.style.display = 'none';		Collapse.style.display = 'inline';	} else {		Details.style.display = 'none'		Expand.style.display = 'inline';		Collapse.style.display = 'none';	}}function emailCheck (emailStr) {	/* The following variable tells the rest of the function whether or not	to verify that the address ends in a two-letter country or well-known	TLD.  1 means check it, 0 means don't. */	var checkTLD=1;	/* The following is the list of known TLDs that an e-mail address must end with. */	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;	/* Pattern to check user@domain format and separate the username from the domain. */	var emailPat=/^(.+)@(.+)$/;	/* String with special characters not allowed in an email address. 	These characters include ( ) < > @ , ; : \ " . [ ] */	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";	/* String with characters allowed in a username or domainname.  It really states which chars aren't allowed.*/	var validChars="\[^\\s" + specialChars + "\]";	/* Pattern which applies if the "user" is a quoted string ("jiminy cricket"@disney.com is a legal e-mail address). */	var quotedUser="(\"[^\"]*\")";	/* Pattern for domains that are IP addresses (joe@[123.124.233.4] is a legal e-mail address). */	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;	/* String represents an atom (basically a series of non-special characters.) */	var atom=validChars + '+';	/* String representing one word in the typical username.	For example, in john.doe@somewhere.com, john and doe are words.	Basically, a word is either an atom or quoted string. */	var word="(" + atom + "|" + quotedUser + ")";	// The following pattern describes the structure of the user	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");	/* The following pattern describes the structure of a normal symbolic	domain, as opposed to ipDomainPat, shown above. */	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");	/* Begin with the coarse pattern to simply break up user@domain into	different pieces that are easy to analyze. */	var matchArray=emailStr.match(emailPat);	// Too many/few @'s or something; basically, this address is invalid.	if (matchArray==null) {alert ("Your email address seems incorrect (check @ and .'s)"); return false;}	var user=matchArray[1];	var domain=matchArray[2];	// Start by checking that only basic ASCII characters are in the strings (0-127).	for (i=0; i<user.length; i++) {		if (user.charCodeAt(i)>127) {			alert("Your username contains invalid characters.");			return false;		}	}	for (i=0; i<domain.length; i++) {		if (domain.charCodeAt(i)>127) {			alert("Your domain name (ex. @whatever.com) contains invalid characters.");			return false;		}	}	// See if "user" is valid 	if (user.match(userPat)==null) {alert("The username doesn't seem to be valid."); return false;}	/* if the e-mail address is at an IP address (as opposed to a symbolic	host name) make sure the IP address is valid. */		var IPArray=domain.match(ipDomainPat);	if (IPArray!=null) {		// this is an IP address		for (var i=1;i<=4;i++) {			if (IPArray[i]>255) {				alert("Destination IP address is invalid!");				return false;			}		}		return true;	}	// Domain is symbolic name.  Check if it's valid.	var atomPat=new RegExp("^" + atom + "$");	var domArr=domain.split(".");	var len=domArr.length;	for (i=0;i<len;i++) {		if (domArr[i].search(atomPat)==-1) {			alert("Your domain name (ex. @whatever.com) does not seem to be valid.");			return false;		}	}	/* domain name seems valid, so make sure that it ends in a	known top-level domain (like com, edu, gov) or a two-letter word,	representing country (uk, nl), and that there's a hostname preceding 	the domain or country. */	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {		alert("The address must end in a well-known domain or two letter " + "country.");		return false;	}	// Make sure there's a host name preceding the domain.	if (len<2) {alert("This address is missing a hostname!"); return false;}	// If we've gotten this far, everything's valid!	return true;}// Search functionsfunction clearHomeSearch (Form) {	Form.Availability.selectedIndex = 0;	Form.Plan.value = "";	Form.City.selectedIndex = 0;	Form.Price.selectedIndex = 0;	Form.Bedrooms.selectedIndex = 0;	Form.Bathrooms.selectedIndex = 0;	Form.Garage.selectedIndex = 0;	Form.Stories.selectedIndex = 0;	Form.MasterStory.selectedIndex = 0;	for (Counter = 0; Counter < Form.LivingAreas.length; Counter++) 		Form.LivingAreas [Counter].checked = false;}function setHomeSearchHelp (Form) {	}function changeMarket (Form) {	Form.City.selectedIndex = 0;	newHomeSearch (Form);}function newHomeSearch (Form) {	var Location = window.location.href;		Location = clearQueryStringToken ("Help", Location, false);	var Availability = (-1 == Form.Availability.selectedIndex) ? "" : Form.Availability.options [Form.Availability.selectedIndex].value;	Location = toggleQueryStringItem ("Availability", Availability, Location, true, false);	var Market = Form.Market.value ? Form.Market.value : (-1 == Form.Market.selectedIndex) ? "" : Form.Market.options [Form.Market.selectedIndex].value;	Location = toggleQueryStringItem ("Market", Market, Location, true, false);	var City = (-1 == Form.City.selectedIndex) ? "" : Form.City.options [Form.City.selectedIndex].value;	Location = toggleQueryStringItem ("City", City, Location, true, false);	var Plan = Form.Plan.value;	Location = toggleQueryStringItem ("Plan", Plan, Location, true, false);	// Override if plan specified	var Price = (-1 == Form.Price.selectedIndex) || (0 == Form.Price.selectedIndex) ? "" : Form.Price.options [Form.Price.selectedIndex].value;	Location = toggleQueryStringItem ("Price", Price, Location, true, false);	var Bedrooms = (-1 == Form.Bedrooms.selectedIndex) || (0 == Form.Bedrooms.selectedIndex) || (0 != Plan.length) ? "" : Form.Bedrooms.options [Form.Bedrooms.selectedIndex].value.slice (0, 1);	Location = toggleQueryStringItem ("Bed", Bedrooms, Location, true, false);	var Bathrooms = (-1 == Form.Bathrooms.selectedIndex) || (0 == Form.Bathrooms.selectedIndex) || (0 != Plan.length) ? "" : Form.Bathrooms.options [Form.Bathrooms.selectedIndex].value.slice (0, 1);	Location = toggleQueryStringItem ("Bath", Bathrooms, Location, true, false);	var Garage = (-1 == Form.Garage.selectedIndex) || (0 == Form.Garage.selectedIndex) || (0 != Plan.length) ? "" : Form.Garage.options [Form.Garage.selectedIndex].value.slice (0, 1);	Location = toggleQueryStringItem ("Garage", Garage, Location, true, false);	var Stories = (-1 == Form.Stories.selectedIndex) || (0 != Plan.length) ? "" : Form.Stories.options [Form.Stories.selectedIndex].value.slice (0, 1);	Location = toggleQueryStringItem ("Stories", Stories, Location, true, false);	var MasterStory = (-1 == Form.MasterStory.selectedIndex) || (0 != Plan.length) ? "" : Form.MasterStory.options [Form.MasterStory.selectedIndex].value;	Location = toggleQueryStringItem ("Master", MasterStory, Location, true, false);	var LivingAreas = new Array ();	for (Counter = 0; Counter < Form.LivingAreas.length; Counter++) {		if (Form.LivingAreas [Counter].checked) {			LivingAreas.push (Form.LivingAreas [Counter].value);		}	}	Location = toggleQueryStringItem ("Areas", (0 == LivingAreas.length) || (0 != Plan.length) ? "" : LivingAreas.join ("|"), Location, true, false)	// End Override		window.location = Location;	return Location;}function getQueryStringToken (Token) {	var query = window.location.search.substring(1);	var Tokens = query.split("&");	for (var i=0; i<Tokens.length; i++) {		var pair = Tokens[i].split("=");		if (pair[0] == Token) {return pair[1];}	}	return false;}function setQueryStringToken (Token, OldLocation, Debug) {	//Token - The name of the URL QS Token to modify	//OldLocation - Location to modify.  If False/Null, will use current location.	if (!OldLocation) {Location = window.location.href} else {Location = OldLocation}	var TokenPattern = new RegExp ("&" +Token);	var NewSearchPattern = new RegExp (".*html$")	var NewToken = (NewSearchPattern.test (Location) ? "?OpenDocument" : "") +"&" +Token;	if (!TokenPattern.test (Location)) {		Location += (NewToken);		if (Debug) alert ("Add " +Token +": \n" +Location)	}	if (!OldLocation) {window.location = Location} else return Location;}function clearQueryStringToken (Token, OldLocation, Debug) {	//Token - The name of the URL QS Token to modify	//OldLocation - Location to modify.  If False/Null, will use current location.	if (!OldLocation) {Location = window.location.href} else {Location = OldLocation}	var TokenPattern = new RegExp ("&" +Token);	var NewSearchPattern = new RegExp (".*html$")	var NewToken = (NewSearchPattern.test (Location) ? "?OpenDocument" : "") +"&" +Token;	if (TokenPattern.test (Location)) {		Location = Location.replace (TokenPattern, "");		if (Debug) alert ("Remove Any " +Token +": \n" +Location);	}	if (!OldLocation) {window.location = Location} else return Location;}function toggleQueryStringItem (Token, Value, OldLocation, NoToggle, Debug) {	//Token - The name of the URL QS Token to modify	//Value - The value associated with the Token	//OldLocation - Location to modify.  If False/Null, will use current location.	//NoToggle - If True then Token=Value is set if absent or removed if present.  If False then Token=Value will only be set if absent.	//Determine if there is currently a scheme or not	if (!OldLocation) {Location = window.location.href} else {Location = OldLocation}	var TokenPattern = new RegExp ("&" +Token +"=[\.a-zA-Z0-9\|%]*");	var TokenValuePattern = new RegExp ("&" +Token +"=" +Value);	var NewSearchPattern = new RegExp (".*html$")	var NewTokenValue = (NewSearchPattern.test (Location) ? "?OpenDocument" : "") +"&" +Token +"=" +Value;	// Look for "Scheme=<Scheme>"	if ("" == Value) {		Location = Location.replace (TokenPattern, "");		if (Debug) alert ("Remove Any " +Token +": \n" +Location);	}	else if (!NoToggle && TokenValuePattern.test (Location)) {		Location = Location.replace (TokenValuePattern, "");		if (Debug) alert ("Remove " +Token +"=" +Value +": \n" +Location)	}	else if (TokenPattern.test (Location)) {		if (Debug) alert (Location.match (TokenPattern)[0]);		Location = Location.replace (TokenPattern, NewTokenValue);		if (Debug) alert ("Replace: \n" +Location);	}	else {		Location += (NewTokenValue);		if (Debug) alert ("Add " +Token +"=" +Value +": \n" +Location)	}	if (!OldLocation) {window.location = Location} else return Location;}// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.htmlrnd.today=new Date();rnd.seed=rnd.today.getTime();//Returns a random floating point number.function rnd() {	rnd.seed = (rnd.seed*9301+49297) % 233280;	return rnd.seed/(233280.0);};//Returns a random integer between 1 and number.function rand(number) {return Math.ceil(rnd()*number)};// end randomizervar remote;function popup(url) {	var height = this.screen.availHeight;	if (!height) {height = 400}	else {height = height -100}	self.name = "parent";	remote = open(url, "popup_default", "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=1,width=550,height="+height+",left=50,top=20");	if (remote) remote.focus ();}function resizeOuterTo(w,h) {	if (parseInt(navigator.appVersion)>3) {		if (navigator.appName=="Netscape") {			this.outerWidth=w;			this.outerHeight=h;		}	else this.resizeTo(w,h);	}}function searchQueryString (variable) {	var query = window.location.search.substring(1);	var vars = query.split("&");	for (var i=0;i<vars.length;i++) {		var pair = vars[i].split("=");		if (pair[0] == variable) {			return pair[1];		}	}	return "";}////	Popup handlers////	Resizes the image (Hopefully) to better fit on the printed page.  Designed to be called from the onload event.function fitImage () {	var factor = .75;	var image = document.getElementById ("image");	if (image.height >700) {		image.height = 700;//		image.width = image.weight *factor;	}}//	Resizes the window to fit better the image dimensions.  Designed to be called from the onload event.function fitToImage () {	var image = document.getElementById ("image");	var height = image.height +300;	if (height > (window.screen.availHeight -20)) {height = window.screen.availHeight -20};	var width = image.width +75;	if (width > (window.screen.availWidth -20)) {width = window.screen.availWidth -20}	if (width < 550) {width = 550};	resizeOuterTo (width, height);}function showListingImage (Listing, Filename, Source) {	self.name = "parent";	var width = 600;	var height = 600;	PageURL = DatabaseRoot +'/' +PageView +'/Image.html?Open&LID=' +Listing +'&FID=' +Filename +(Source?"&SRC="+Source:"");	remote = open (PageURL, "Image", "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (remote) remote.focus ();}function showPlanImage (Plan, Filename) {	self.name = "parent";	var width = 600;	var height = 600;	PageURL = DatabaseRoot +'/' +PageView +'/Image.html?Open&PID=' +Plan +'&FID=' +Filename;	remote = open (PageURL, "Image", "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (remote) remote.focus ();}function imagePopup (ImageURL, Name, Description, Title) {	self.name = "parent";	var width = 600;	var height = 600;	if (!Title)			{Title = Description};	if (!Name)			{Name = "popup_image"};	if (!Description)	{Description = ""} else {Description = "description=" +escape (Description)};	if (!Title)			{Title = Description} else {Title = "title=" +escape (Title)};	var pattern = /\//g;	PageURL = DatabaseRoot +'/' +PageView +'/Image.html?Open&image='+ImageURL.replace (/\//g, "%2f") +'&' +Description;	remote = open (PageURL, Name, "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (remote) remote.focus ();}function eBrochurePopup (ListingID, PlanID, Description, Title) {	self.name = "parent";	var width = 790;	var height = 700;	var argument = ListingID ? 'Listing=' +ListingID : 'Plan=' +PlanID;	var Name = null;	if (!Title)			{Title = Description};	if (!Name)			{Name = "popup_image"};	if (!Description)	{Description = ""} else {Description = "description=" +escape (Description)};	if (!Title)			{Title = Description} else {Title = "title=" +escape (Title)};	var pattern = /\//g;	PageURL = DatabaseRoot +'/' +PageView +'/Utility-EBrochure.html?Open&'+argument.replace (/\//g, "%2f") +'&' +Description;	remote = open (PageURL, Name, "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (remote) remote.focus ();}function redirect (url, width, noView, noDatabase) {	if (!noView)		{url = PageView +"/" +url}	if (!noDatabase)	{url = DatabaseRoot +"/" +url}	self.name = "parent";	if (!width)			{width = 550}	var height = window.screen.availHeight;	if (!height)		{height = 750}	else {height = height -100}	remote = open(url, "popup_onsite", "directories=0,location=0,menubar=1,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (remote) remote.focus ();}function utility (url, width, height) {	self.name = "parent";	if (!height) {height = this.screen.availHeight};	if (!height) {height = 400}	else {height = height -100}	if (!width) {width = 550}	window.remote = open(url, "popup_utility", "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=no,width="+width+",height="+height+",left=50,top=20");	if (window.remote) window.remote.focus ();}function offsite (url) {	var height = this.screen.availHeight;	if (!height) {height = 500}	else {height = height -100}	self.name = "parent";	remote = open(url, "popup_offsite", "directories=0,location=0,menubar=0,resizable=yes,scrollbars=1,status=0,toolbar=1,width=700,height="+height+",left=50,top=20");	if (remote) remote.focus ();}function printablemap (url) {	url = DatabaseRoot +"/" +PageView +"/" +url;	var height = this.screen.availHeight;	if (!height) {height = 400}	else {height = height -100}	self.name = "parent";	remote = open(url, "popup_printablemap", "directories=0,location=0,menubar=1,resizable=yes,scrollbars=1,status=0,toolbar=no,width=615,height="+height+",left=50,top=20");	if (remote) remote.focus ();}function frames(url) {	self.name = "parent";	remote = open(url, "popup_frames", "directories=0,location=0,menubar=1,resizable=yes,scrollbars=1,status=0,toolbar=1,width=615,height=400,left=50,top=20");	if (remote) remote.focus ();}// Closes the popup when sending the user to the parent windowfunction closePopup(url) {	parentWin = self.opener;	if (parentWin != null && ! parentWin.closed) {		parentWin.location = url;	}    self.close();}// name - name of the cookie// value - value of the cookie// [expires] - expiration date of the cookie (defaults to end of current session)// [path] - path for which the cookie is valid (defaults to path of calling document)// [domain] - domain for which the cookie is valid (defaults to domain of calling document)// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission// * an argument defaults when it is assigned null as a placeholder// * a null placeholder is not required for trailing omitted argumentsfunction setCookie(name, value, expires, path, domain, secure) {	var curCookie = name + "=" + escape(value) +		((expires) ? "; expires=" + expires.toGMTString() : "") +		((path) ? "; path=" + path : "") +		((domain) ? "; domain=" + domain : "") +		((secure) ? "; secure" : "");	document.cookie = curCookie;}// name - name of the desired cookie// * return string containing value of specified cookie or null if cookie does not existfunction getCookie(name) {	var dc = document.cookie;	var prefix = name + "=";	var begin = dc.indexOf("; " + prefix);	if (begin == -1) {		begin = dc.indexOf(prefix);		if (begin != 0) return null;	} else		begin += 2;	var end = document.cookie.indexOf(";", begin);	if (end == -1)		end = dc.length;	return unescape(dc.substring(begin + prefix.length, end));}// name - name of the cookie// [path] - path of the cookie (must be same as path used to create cookie)// [domain] - domain of the cookie (must be same as domain used to create cookie)// * path and domain default if assigned null or omitted if no explicit argument proceedsfunction deleteCookie(name, path, domain) {	if (getCookie(name)) {		document.cookie = name + "=" + 			((path) ? "; path=" + path : "") +			((domain) ? "; domain=" + domain : "") +			"; expires=Thu, 01-Jan-70 00:00:01 GMT";	}}// date - any instance of the Date object// * hand all instances of the Date object to this function for "repairs"function fixDate(date) {	var base = new Date(0);	var skew = base.getTime();	if (skew > 0)		date.setTime(date.getTime() - skew);}function toggleListing (CheckBox, Debug) {	// Cookie is a mootools object	var ListingID = CheckBox.value.split("/")[0];				// The value to add or delete	var Name = "Listings";							// The name of the cookie	var cookie = Cookie.get (Name);				// The current value of the cookie	var SelectCountHTML = document.getElementById("SelectCount");	var SelectCount = !SelectCountHTML ? -1 : SelectCountHTML.innerHTML;//	alert (SelectCount);	if ((null == cookie) || ("" == cookie)) {		// If the cookie is empty		if (CheckBox.checked) {cookie = ListingID; SelectCount++}		else {alert ('Error: Attempting to remove an unselected listing value')}	} else {											// If the cookie is not empty		var CookieArray = cookie.split ("|");		// The current value of the cookie as an array		var Location = null;							// The current position of the ListingID in question, or null if not present		for (Counter = 0; Counter <= CookieArray.length; Counter++) {			Location = CookieArray[Counter] == ListingID ? Counter : Location;		}		if (CheckBox.checked) {					// Add the ListingID to the coookie			if (null != Location) {alert ('Error: Attempting to add a previously added ListingID')}			else {CookieArray = CookieArray.concat (ListingID); SelectCount++;}		} else {										// Delete the ListingID from the cookie			if (null == Location) {alert ('Error: Attempting to remove an unlisted ListingID')}			else {CookieArray.splice (Location, 1); SelectCount--;}		}		cookie = CookieArray.join ("|");	}	if (SelectCountHTML) {SelectCountHTML.innerHTML = SelectCount}	if (Debug) {alert (cookie);}	// At some point, check to see if the new cookie is an empty string, and delete it if so.	Cookie.set (Name, cookie, {path:"/"});}/*function surveyLinkQuery (pageCount, countOnly) {	var commentOnly = false;	var triggerCount = 1;	var imageURL = "/Horizon/surveys.nsf/Survey.gif";	var linkURL = "/Horizon/surveys.nsf/survey0001?OpenForm";	var linkScript = "javascript:imagePopup ('"+linkURL+"', 750, 600)";	if (!countOnly && (pageCount >= (triggerCount -1))) {		if (commentOnly) {document.write ("<!--")}		document.write ('<p><center><a href="' +linkScript +'"><img src="' +imageURL +'" border="0"></a></center>');		if (commentOnly) {document.write ("-->")}	}}function surveyPopupQuery (pageCount, countOnly) {	var commentOnly = false;	var daysUntilReset = 100;	var triggerCount = 3;	var linkURL = "/Horizon/surveys.nsf/survey0001?OpenForm";	var linkScript = "imagePopup ('"+linkURL+"', 750, 600)";	var exp = new Date(); 	exp.setTime(exp.getTime() + (daysUntilReset*24*60*60*1000));	var popupFlag = parseInt (getCookie ("PopupFlag"));	popupFlag = isNaN (popupFlag) ? 0: popupFlag;		//if the popupFlag cookie is not initialized, set it to 0	if (!countOnly && (popupFlag==0) &&(pageCount >= (triggerCount))) {		if (commentOnly) {document.write ("<!--")}		imagePopup (linkURL, 750, 600);		if (commentOnly) {document.write ("-->")}		setCookie ("PopupFlag", 1, exp, "/");	} }// surveyQuery - Determines whether or not a survey icon should be displayed, and if so writes the HTML code.function surveyQuery (countOnly) {	return true;	var pageCount = parseInt (getCookie ("PageCount"));	pageCount = isNaN (pageCount) ? 1: pageCount;		//if the pageCount cookie is not initialized, set it to 0	surveyLinkQuery (pageCount, countOnly);	surveyPopupQuery (pageCount, countOnly);	setCookie ("PageCount", ++pageCount, false, "/")}*/