

//function MM_reloadPage(init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);//INITIALIZE THE PAGEfunction init() {	startList();	if ($('search_form')) {	//	$('search_form').reset();		$('search_form').enable();	}}//do the iframe thingfunction adjustIFrameSize (iframeWindow) {	if (iframeWindow.document.height) {		var iframeElement = $('listings');		var newheight = (iframeWindow.document.body.getHeight())+'px';		iframeElement.setStyle({height:newheight});	}}function swapimage(imgname, imgstring, w, h) {	//set it up as an a href thing -- dont worry about the reference, since we already	//know javascript is enabled	//set w and h to maxw and maxh	var newimgstring = '<a href="" onmouseover="Tip(\'Click for full-size image\')" onclick="popupimg('+w+', '+h+', \''+imgname+'\'); return false;" >'+imgstring+'</a>';	$('mainfileholder').update(newimgstring);	//set it to do the thing onclick}function popupimg(w, h, img) {	var w = w+20;	var h = h+50;	var imgwindow = window.open (img,"image popup", "menubar=0,resizable=0,scrollbars=0,width="+w+",height="+h);	imgwindow.resizeTo(w,h)	imgwindow.focus();}function changebkgd(el, color) {	el.setStyle({backgroundColor:color})}function settextarea(el, newtext) {	//set this bkgd to white and all others to gray...	var alltabas = $$('.texttaba')	alltabas.each(function(item) {		item.setStyle({backgroundColor:'#ddd'});	});	el.setStyle({backgroundColor:'#fff'});	//chagne the text	$('areatext').update(newtext);}function printpage(id) {	var printwindow = window.open("print.php?id="+id, "print", "menubar=0,resizable=yes,scrollbars=yes,width=700,height=600");	printwindow.focus();}function verifyform() {	var required = new Array('firstname', 'lastname', 'telephone');	var error = 'ERROR: Missing the following field(s):';	required.each(function(item) {		var checkval = $F(item);		if (!checkval) {			if (error.endsWith(':')) {				error += ' '+item;			} else {				error += ', '+item;			}		}	})	if (error.endsWith(':')) {		//then all is well so submit the form		submitcontact();	} else {		alert(error);		return false;	}}function submitcontact() {	var frame = window.frames['contact_frame'];	var form = $('contact_form');	////submit and disable the contact form	form.submit();	//	new PeriodicalExecuter(function(pe) {		//check to see if our hidden frame is empty		var contents = frame.document.body.innerHTML;		if (contents) {			pe.stop();			if (contents == "OK") {				//clear the frame and clear the form				frame.document.body.innerHTML = "";					alert("Thank you, your message has been sent.");				form.reset();			} else {				//clear the frame and alert the response				frame.document.body.innerHTML = "";					alert(contents)			}		}	}, 1);	}////////////SEARCH FORM STUFF//////////////////////function searching(tf) {	if (tf) {		$('searching').update("SEARCHING... <img style='float:right; margin-top:-21px;' src='assets/other/ajax-loader.gif' />");	} else {		$('searching').update("SEARCH RESULTS");	}}function mlssearch() {	var frame = window.frames['search_frame'];	var form = $('search_form');	////submit and DO NOT disable the search form	form.submit();	//	new PeriodicalExecuter(function(pe) {		//check to see if our hidden frame is empty		var contents = frame.document.body.innerHTML;		if (contents) {			pe.stop();			//update the rightcol with the search contents...			$('rightcol').update(contents);			//clear the frame			frame.document.body.innerHTML = "";		}	}, 1);	}function mlspagesearch(query, start, rowcount) {	//do it	var url = 'INCLUDES/mlssearch.php?todo=pagesearch&query='+query+'&start='+start+'&rowcount='+rowcount	searching(true)	new Ajax.Request(url, {		method: 'get',		onSuccess: function(transport) {			$('rightcol').update(transport.responseText);			searching(false)		}	});}function displaylisting(mlsid) {	//get the info for this thing and update the rightcol	var url = 'INCLUDES/mlssearch.php?todo=displaylisting&mlsid='+mlsid	new Ajax.Updater('rightcol', url)}function searchoptions(ml) {	var allmore = $$('.more');	if (ml == 'more') {		allmore.each(function(item) {			item.show();		})		//note that we are setting the hidden var to '1'		$('moreless').update('<input type="hidden" name="moreoptions" id="moreoptions" value="1" /><a id="moreoptionsbtn" style="text-align:right;" href="" onclick="searchoptions(\'less\'); return false;">fewer options</a>')	} else {		allmore.each(function(item) {			item.hide();		})		//note that we are setting the hidden var to '0'		$('moreless').update('<input type="hidden" name="moreoptions" id="moreoptions" value="0" /><a id="moreoptionsbtn" style="text-align:right;" href="" onclick="searchoptions(\'more\'); return false;">more options</a>');	}}function blowup(elid, w, x) {	//alert("file = "+file+" and w = "+w+" and h = "+h)	//make the thing bigger	$(elid).setStyle({width: w+'px', position:'absolute', zIndex:'1000', left:x+'px'});}function backdown(elid, w, x) {	$(elid).setStyle({width: w+'px', position:'relative', zIndex:'5', left:'0px'});}function showblog(blogid) {	alert('blogid = '+blogid)	//set the blog...}//get the cities... -- called from the county dropdown, which sends the county_idfunction getcities(county_id) {	var url = 'INCLUDES/mlssearch.php?todo=getcities&county_id='+county_id	new Ajax.Updater('cities', url)}//additional info -- show the additional info for the listingfunction additionalinfo() {	var el = $('addinfo')	var li = $('addinfolink')	if (el) {		el.show();		li.hide();	}}//set up the popupfunction popup(img, txt, w, h) {	pw = w + 30	ph = h + 60	var url='popup.php?img='+img+'&txt='+txt+'&w='+w;	pop = window.open(url,"Oconomowoc_Realty",	"menubar=no,width="+pw+",height="+ph+",toolbar=no,resizable=yes");	pop.focus()}//FIX THE DROPDOWNS FOR IEfunction startList() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("nav");		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}	}}