

	//<![CDATA[
	function JSONscriptRequest(fullUrl) {
		// REST request path
		this.fullUrl = fullUrl; 
		// Keep IE from caching requests
		this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
		// Get the DOM location to put the script tag
		this.headLoc = document.getElementsByTagName("head").item(0);
		// Generate a unique script tag id
		this.scriptId = 'YJscriptId' + JSONscriptRequest.scriptCounter++;
	}

	// Static script ID counter
	JSONscriptRequest.scriptCounter = 1;

	// buildScriptTag method
	JSONscriptRequest.prototype.buildScriptTag = function () {
		// Create the script tag
		this.scriptObj = document.createElement("script");

		// Add script object attributes
		this.scriptObj.setAttribute("type", "text/javascript");
		this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
		this.scriptObj.setAttribute("id", this.scriptId);
	}

	// removeScriptTag method
	JSONscriptRequest.prototype.removeScriptTag = function () {
		// Destroy the script tag
		this.headLoc.removeChild(this.scriptObj);  
	}
	
	// addScriptTag method
	JSONscriptRequest.prototype.addScriptTag = function () {
		// Create the script tag
		this.headLoc.appendChild(this.scriptObj);
	}

	var tried = new Array();

	function do_get() {
		var address, csz, key, z, st, width;
		try {
			address = document.getElementById('address').value;
			csz = document.getElementById('citystatezip').value;
		} catch (e) {
			// do nothing
		}
		
				
		width = "160";

		try {
			document.getElementById('info').style.display = 'block';
			document.getElementById('zillow_content').innerHTML = '<hr size="1" /><div align="center" style="background: #ffffff; border: #999999 1px solid; padding: 7px;">Searching 67,000,000+ homes... <a href="http://www.zillow.com/"><img src="http://www.thegalleryofhomes.net/images/loader.gif" border="no" /></a><br />This may take a few seconds</div>';
		} catch (e) {
			// do nothing
		}
		
				request = 'http://www.forsalewiz.com/widget/zillow.js?do=get&width=' + escape(width) + '&form=' + escape(form) + '&address=' + escape(address) + '&citystatezip=' + escape(csz);

		// Create a new script object
		aObj = new JSONscriptRequest(request);
		// Build the script tag
		aObj.buildScriptTag();
		// Execute (add) the script tag
		aObj.addScriptTag();

		tried['zcontent'] = true;
		return false;
	}

	function do_get_cb(data) {
		data = eval(data);

		document.getElementById('zillow_content').innerHTML = data.html;
		document.getElementById('info').style.display = 'block';
	}

	function dispSwap(id, disp) {
		if (document.getElementById(id).style.display != 'none') {
			document.getElementById(id).style.display = 'none';
			document.getElementById('expcol').style.background = 'url(http://www.thegalleryofhomes.net/images/expander.png) no-repeat scroll center';
		} else {
			document.getElementById(id).style.display = disp;
			document.getElementById('expcol').style.background = 'url(http://www.thegalleryofhomes.net/images/collapser.png) no-repeat scroll center';
		}
	}

	var form = false;
	var gmapkey = null;

	function doZillowLite() {
		
		if (form == false) {
			document.write('<div id="zillow" style="background: #E5EEFF; border: #999999 1px solid; width: 160px; padding: 7px;"><div id="zillow_form"><img src="http://www.thegalleryofhomes.net/images/logo.png" alt="Provided by Zillow.com" title="Zillow.com" /> <br /><hr size="1" noshade="noshade" style="color: #CED4DD;" /><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; color: #E47725; background: #E5EEFF; line-height: 16px; margin-bottom: 0px; padding-bottom: 0px">Value Any Home</h2><form name="z"action="#" onSubmit="do_get(); return false;"><label for="address"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px"><b>Address</b> OR <b>Street</b> OR <b>Neighborhood</b></span><br /><input type="text" name="address" id="address" size="15" style="border: 1px #999999 solid;"></label><br /><label for="citystatezip"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px"><b>City, State</b> OR <b>ZIP</b></span><br /><input type="text" name="citystatezip" id="citystatezip" size="15" style="border: 1px #999999 solid;"></label><input type="image" onclick="do_get(); return false;" value="GO" alt="GO" src="http://www.thegalleryofhomes.net/images/btn_go.PNG"><input type="hidden" name="do" id="do" value="get" /></form></div><div id="info" style="display: none;"><div id="zillow_content">&nbsp;</div><a href="javascript:dispSwap(\'zillow_content\', \'block\');"><div class="hr" id="expcol" style="height: 13px; background: url(http://www.thegalleryofhomes.net/images/collapser.png) no-repeat scroll center;"><hr style="display: none;" noshade="noshade" size="1"></div></a></div></div>');
		} else {
			document.write('<div id="zillow">&nbsp;</div>');
		}

			}

	function doTinyerZillow() {} // Here for backwards compatibility

	doZillowLite();
//]]>
