ï»¿	function MM_changeProp(objName,x,theProp,theValue) { //v6.0
	  var obj = MM_findObj(objName);
	  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false)
		  eval("obj."+theProp+"="+theValue);
		else eval("obj."+theProp+"='"+theValue+"'");
	  }
	}
	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_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}
	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 resize_img(ih, iw) {
		document.big.width = iw;
		document.big.height = ih;
	}		
	// this function has issues with the way the mouse overs are changing the h/w params. 
	// therefore, it's not currently used. 
	function show_full_img(ww, wh, photos) {
		var curimg = document.getElementById(photos).src;
		var wwidth = document.getElementById(photos).width;
		var wheight = document.getElementById(photos).height;
		window.open(curimg,"Photo","titlebar=no,toolbar=no,status=no,resizable,width="+wwidth+",height="+wheight);
	}
	
	function enlarge_images() {
		var photos = document.getElementsByName("small");
		for (var i=0;i< photos.length; i++) {
		photos[i].style.width = "290px";
		photos[i].style.height = "auto";
		}
	}
	
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}
	
	function MM_goToURL() { //v3.0
	  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	}
	
	/***********************************************
	* Fixed ToolTip script- ? Dynamic Drive (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit http://www.dynamicdrive.com/ for full source code
	***********************************************/
			
	var tipwidth='150px' //default tooltip width
	var tipbgcolor='#ffffff'  //tooltip bgcolor
	var disappeardelay=100  //tooltip disappear speed onMouseout (in miliseconds)
	var vertical_offset="10px" //horizontal offset of tooltip from anchor link
	var horizontal_offset="-3px" //horizontal offset of tooltip from anchor link
	
	/////No further editting needed
	
	var ie4=document.all
	var ns6=document.getElementById&&!document.all
	
	if (ie4||ns6)
	document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')
	
	function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
	totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
	parentEl=parentEl.offsetParent;
	}
	return totaloffset;
	}
	function showhide(obj, e, visible, hidden, tipwidth){
	if (ie4||ns6)
	dropmenuobj.style.left=dropmenuobj.style.top=-500
	if (tipwidth!=""){
	dropmenuobj.widthobj=dropmenuobj.style
	dropmenuobj.widthobj.width=tipwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
	obj.visibility=visible
	else if (e.type=="click")
	obj.visibility=hidden
	}
	
	function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}
	
	function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
	if (whichedge=="rightedge"){
	var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
	dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
	if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
	edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else{
	var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
	dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
	if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
	edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
	}
	return edgeoffset
	}
	
	function fixedtooltip(menucontents, obj, e, tipwidth){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidetip()
	dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
	dropmenuobj.innerHTML=menucontents
	
	if (ie4||ns6){
	showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
	dropmenuobj.x=getposOffset(obj, "left")
	dropmenuobj.y=getposOffset(obj, "top")
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
	}
	
	function hidetip(e){
	if (typeof dropmenuobj!="undefined"){
	if (ie4||ns6)
	dropmenuobj.style.visibility="hidden"
	}
	}
	
	function delayhidetip(){
	if (ie4||ns6)
	delayhide=setTimeout("hidetip()",disappeardelay)
	}
	
	function clearhidetip(){
	if (typeof delayhide!="undefined")
	clearTimeout(delayhide)
	}
	function OnSubmitForm(desturl)
	{
	if(document.pressed == 'Features Search')
	  {
	   document.searchfrm.action = desturl + "?Type=feature#features";
	   document.searchfrm.submit();
	   return true;
	  }
	  else
	  if(document.pressed == 'Price & Features Search')
	  {
	    document.searchfrm.action = desturl + "Type=basic";
	    return true;
	  }
	  else
	  if(document.pressed == 'Street Address Search')
	  {
	    document.searchfrm.action = desturl + "?Type=address";
	    return true;
	  }
	  else
	  if(document.pressed == 'MLS Number Search')
	  {
	    document.searchfrm.action =desturl + "?Type=mls";
	    return true;
	  } 
	  else
	  if(document.pressed == 'Search')
	  {
	    document.searchfrm.action =desturl;
	    return true;
	  }	  
	  else
	  if(document.pressed == 'Add Saved Search')
	  {
	    document.searchfrm.action =desturl;
	    return true;
	  }
	  return true;
	}
	function ChangeTab(tab, desturl)
	{
	   if(tab == 'Features Search')
	  {
	   document.searchfrm.action = desturl + "?Type=feature#features";
	  }
	  else
	  if(tab == 'Price &amp; Features Search')
	  {
	    document.searchfrm.action = desturl + "?Type=basic";
	  }
	  else
	  if(tab == 'Price & Features Search')
	  {
	    document.searchfrm.action = desturl + "?Type=basic";
	  }
	  else
	  if(tab == 'Street Address Search')
	  {
	    document.searchfrm.action =desturl + "?Type=address";
	  }
	  else
	  if(tab == 'MLS Number Search')
	  {
	    document.searchfrm.action = desturl + "?Type=mls";
	  } 
	  document.searchfrm.submit();
	}
	
	function ShowZip() 
	{
		document.searchfrm.geotype.value = "zip";
		var zipcd = document.getElementById("zipcode");
		var ctylist = document.getElementById("citylist");
		if (zipcd) { zipcd.style.display = "inline"; }
		if (ctylist) { ctylist.style.display = "none"; }
		
	}
	function ShowArea() 
	{
		document.searchfrm.geotype.value = "area";
		var zipcd = document.getElementById("zipcode");
		var ctylist = document.getElementById("citylist");
		var citydt = document.getElementById("citydt");
		var areadt = document.getElementById("areadt");
		var areatxt = document.getElementById("areatxtdt");
		var isdlist = document.getElementById("isd");
		var areabtn = document.getElementById("showarea");
		var isdbtn = document.getElementById("showisd");
		var iarea = document.getElementById("infoarea");
		var isch = document.getElementById("infosch");
		if (zipcd) { zipcd.style.display = "none"; }
		if (ctylist) { ctylist.style.display = "inline"; }
		if (citydt) { citydt.style.display = "inline"; }
		if (areadt) { areadt.style.display = "inline"; }
		if (areatxt) { areatxt.style.display = "inline"; }
		if (isdlist) { isdlist.style.display = "none"; }
		if (areabtn) { areabtn.style.display = "none"; }
		if (isdbtn) { isdbtn.style.display = "block"; }
		if (iarea) { iarea.style.display = "inline"; }
		if (isch) { isch.style.display = "none"; }

		
	}
	function ShowISD() 
	{
		document.searchfrm.geotype.value = "isd";
		var zipcd = document.getElementById("zipcode");
		var ctylist = document.getElementById("citylist");
		var citydt = document.getElementById("citydt");
		var areadt = document.getElementById("areadt");
		var areatxt = document.getElementById("areatxtdt");
		var isdlist = document.getElementById("isd");
		var areabtn = document.getElementById("showarea");
		var isdbtn = document.getElementById("showisd");
		var iarea = document.getElementById("infoarea");
		var isch = document.getElementById("infosch");
		if (zipcd) { zipcd.style.display = "none"; }
		if (ctylist) { ctylist.style.display = "inline"; }
		if (citydt) { citydt.style.display = "none"; }
		if (areadt) { areadt.style.display = "none"; }
		if (areatxt) { areatxt.style.display = "none"; }
		if (isdlist) { isdlist.style.display = "block"; }
		if (areabtn) { areabtn.style.display = "block"; }
		if (isdbtn) { isdbtn.style.display = "none"; }
		if (iarea) { iarea.style.display = "none"; }
		if (isch) { isch.style.display = "inline"; }
		var chkcounty = document.getElementsByName('COUNTY[]');
		var chkcounties = chkcounty[0];
		
		for (var i = 0; i<chkcounties.length; i++) {
			if (chkcounties.options[i].selected) {
				if(chkcounties.options[i].value == "All") {
					chkcounties.options[0].selected = false;
					chkcounties.options[2].selected = true;
					SetISD();
					break;
				}
			}
		}
	}
	
	function PropSwitch(ptype) {
		document.searchfrm.proptype.value = ptype;
		hidecontrols();
	}

	function ShowOptions(state) 
	{
		var moreopt = document.getElementById("srch_moreopt");
		var morebttn = document.getElementById("morebtn");
		var moreotxt = document.getElementById("moreopttxt");
		if(state == 1) {
			if (moreopt) { moreopt.style.display = "block"; }
			if (morebttn) { morebttn.style.display = "none"; }
			if (moreotxt) { moreotxt.style.display = "none"; }
			document.searchfrm.moreopts.value = 1;
		} else  {
			if (moreopt) { moreopt.style.display = "none"; }
			if (morebttn) { morebttn.style.display = "inline"; }
			if (moreotxt) { moreotxt.style.display = "inline"; }
			document.searchfrm.moreopts.value = 0;
		} 
	}
	
	function FeatChg(featnum) {
		var featlist = document.getElementsByName("features[]");
		if(!featnum.checked) {
			for (var f=0; f<featlist.length; f++) {
				if(featlist[f].value == featnum.value) {
				featlist[f].checked = false;
				}
			}
		} else {
			for (var f=0; f<featlist.length; f++) {
				if(featlist[f].value == featnum.value) {
				featlist[f].checked = true;
				}
			}
		}
	}
	
	function ShowFeatures(state) 
	{
		var full = document.getElementById("srch_features");
		var pop = document.getElementById("srch_popfeatures");
		if(state == 1) {
			if (full) { full.style.display = "inline";}
			if (pop) { pop.style.display = "none";}
			document.searchfrm.fullfeatures.value = 1;
		} else  {
			if (full) { full.style.display = "none";}
			if (pop) { pop.style.display = "inline";}
			document.searchfrm.fullfeatures.value = 0;
		} 
	}
	
	function SetFormOpts()
	{
		if(document.searchfrm.geotype.value == "area") {
			ShowArea();
		}
		if(document.searchfrm.geotype.value == "zip") {
			ShowZip();
		}
		if(document.searchfrm.geotype.value == "isd") {
			ShowISD();
			SetISD();
		}
		
		if(document.searchfrm.moreopts.value == 1) {
			ShowOptions(1);
		} else {
			ShowOptions(0);
		}
		if(document.searchfrm.fullfeatures.value == 1) {
			ShowFeatures(1);
		} else {
			ShowFeatures(0);
		}
		hidecontrols();
	}
	
	function ShowAcre(shownum) {
		var acre = document.searchfrm.minacre;
		var acrefr = document.searchfrm.minacrefr;
		if(shownum==1) {
			acre.options.length = 4;
			acre.style.display="inline";
			acrefr.style.display="none";
		} else {
			acre.style.display="none";
			acrefr.style.display="inline";
		}
		
	}
	
	function ShowREtip(dname,state) {
		var showname = document.getElementById(dname);
		if(state == 1) {
			if (showname) { showname.style.display = "block"; }
		} else {
			if (showname) { showname.style.display = "none"; }
		}
	}
	
	function ClearAllCk(ckbox) {
		ckbox_count = document.getElementsByName(ckbox).length;
		for (var i = 0; i < ckbox_count; i++) {
			document.searchfrm.elements[ckbox][i].checked=false;
		}
		
	}
	
	function hidecontrols(form) 
	{
		var formtype = document.searchfrm.proptype.value;
		var bb = document.getElementById("bbdiv");
		var sqft = document.getElementById("sqftdiv");
		var acre = document.getElementById("acrediv");
		var units = document.getElementById("unitsdiv");
		var gar = document.getElementById("gardiv");
		var lotsz = document.getElementById("lotsize");
		var lottx = document.getElementById("ltsztxt");
		var inclnd = document.getElementById("incland");
		var div522 = document.getElementById("div522");
		var div523 = document.getElementById("div523");
		var div524 = document.getElementById("div524");
		var div525 = document.getElementById("div525");
		var div526 = document.getElementById("div526");
		var div527 = document.getElementById("div527");
		var div528 = document.getElementById("div528");
		var div529 = document.getElementById("div529");
		var full = document.getElementById("srch_features");
		var popdiv = document.getElementById("srch_popfeatures");
		var pop = document.getElementById("popfeat");
		var poptxt = document.getElementById("poptext");
		var popclr = document.getElementById("popclear");
		var moreopt = document.getElementById("srch_moreopt");
		var morebttn = document.getElementById("morebtn");
		var moreotxt = document.getElementById("moreopttxt");		
		var propsp = document.getElementById("propswp");
		var propsl = document.getElementById("propswl");
		var onestoryck = document.getElementById("onestorychk");
		var hideopt = document.getElementById("hideopt");

		


		if (formtype == "L") 
		{
		if (bb) { bb.style.display = "none"; }
		if (sqft) {sqft.style.display = "none"; }
		if (units) { units.style.display = "none"; }
		if (acre) { acre.style.display = "none"; }	
		if (lotsz) { lotsz.style.display = "block"; }	
		if (div522) { div522.style.display = "none"; }		
		if (div523) { div523.style.display = "none"; }
		if (div524) { div524.style.display = "none"; }		
		if (div525) { div525.style.display = "none"; }
		if (div526) { div526.style.display = "none"; }		
		if (div527) { div527.style.display = "none"; }
		if (div528) { div528.style.display = "none"; }		
		if (div529) { div529.style.display = "block"; }		
		if (pop) { pop.style.display = "none"; }
		if (poptxt) { poptxt.style.display = "none"; }
		if (popclr) { popclr.style.display = "none"; }
		if (moreopt) { moreopt.style.display = "block"; }
		if (morebttn) {morebttn.style.display = "none"; }
		if (moreotxt) {moreotxt.style.display = "none"; }
		if (propsp) {propsp.style.display = "inline"; }
		if (propsl) {propsl.style.display = "none"; }
		if (inclnd) {inclnd.style.display = "none"; }
		if (hideopt) {hideopt.style.display = "none"; }
		if (full) { full.style.display = "inline"; }

		}

		if(formtype == "R")
		{
		if (bb) { bb.style.display = "block"; }
		if (sqft) {sqft.style.display = "block"; }
		if (units) { units.style.display = "none"; }
		if (acre) { acre.style.display = "none"; }
		if (gar) { gar.style.display = "inline";}		
		if (lotsz) { lotsz.style.display = "block"; }	
		if (lottx) { lottx.style.display = "inline"; }
		if (inclnd) { inclnd.style.display = "none"; }	
		if (div522) { div522.style.display = "block"; }		
		if (div523) { div523.style.display = "block"; }
		if (div524) { div524.style.display = "block"; }		
		if (div525) { div525.style.display = "block"; }
		if (div526) { div526.style.display = "block"; }		
		if (div527) { div527.style.display = "block"; }
		if (div528) { div528.style.display = "block"; }		
		if (div529) { div529.style.display = "none"; }		
		if (pop) { pop.style.display = "block"; }
		if (poptxt) { poptxt.style.display = "inline"; }
		if (popclr) { popclr.style.display = "inline"; }
		if (onestoryck) { onestoryck.style.display = "inline"; }
		if (hideopt) {hideopt.style.display = "block"; }
		if(document.searchfrm.fullfeatures.value == 1) {
			ShowFeatures(1);
		} else {
			ShowFeatures(0);
		}
		if(document.searchfrm.moreopts.value == 1) {
			ShowOptions(1);
		} else {
			ShowOptions(0);
		}
		}

		if(formtype == "RS")
		{
		if (bb) { bb.style.display = "block"; }
		if (sqft) {sqft.style.display = "block"; }
		if (units) { units.style.display = "none"; }
		if (acre) { acre.style.display = "none"; }
		if (gar) { gar.style.display = "inline";}		
		if (lotsz) { lotsz.style.display = "block"; }	
		if (lottx) { lottx.style.display = "inline"; }
		if (inclnd) { inclnd.style.display = "none"; }	
		if (div522) { div522.style.display = "block"; }		
		if (div523) { div523.style.display = "block"; }
		if (div524) { div524.style.display = "block"; }		
		if (div525) { div525.style.display = "block"; }
		if (div526) { div526.style.display = "block"; }		
		if (div527) { div527.style.display = "block"; }
		if (div528) { div528.style.display = "block"; }		
		if (div529) { div529.style.display = "none"; }		
		if (pop) { pop.style.display = "block"; }
		if (poptxt) { poptxt.style.display = "inline"; }
		if (popclr) { popclr.style.display = "inline"; }
		if (onestoryck) { onestoryck.style.display = "inline"; }
		if (hideopt) {hideopt.style.display = "block"; }
		if(document.searchfrm.fullfeatures.value == 1) {
			ShowFeatures(1);
		} else {
			ShowFeatures(0);
		}
		if(document.searchfrm.moreopts.value == 1) {
			ShowOptions(1);
		} else {
			ShowOptions(0);
		}
		}
		if(formtype == "RC")
		{
		if (bb) { bb.style.display = "block"; }
		if (sqft) {sqft.style.display = "block"; }
		if (units) { units.style.display = "none"; }
		if (acre) { acre.style.display = "none"; }
		if (gar) { gar.style.display = "inline";}		
		if (lotsz) { lotsz.style.display = "none"; }	
		if (lottx) { lottx.style.display = "none"; }
		if (inclnd) { inclnd.style.display = "none"; }	
		if (div522) { div522.style.display = "block"; }		
		if (div523) { div523.style.display = "block"; }
		if (div524) { div524.style.display = "block"; }		
		if (div525) { div525.style.display = "block"; }
		if (div526) { div526.style.display = "block"; }		
		if (div527) { div527.style.display = "block"; }
		if (div528) { div528.style.display = "block"; }		
		if (div529) { div529.style.display = "none"; }		
		if (pop) { pop.style.display = "block"; }
		if (poptxt) { poptxt.style.display = "inline"; }
		if (popclr) { popclr.style.display = "inline"; }
		if (onestoryck) { onestoryck.style.display = "inline"; }
		if (hideopt) {hideopt.style.display = "block"; }

		if(document.searchfrm.fullfeatures.value == 1) {
			ShowFeatures(1);
		} else {
			ShowFeatures(0);
		}
		if(document.searchfrm.moreopts.value == 1) {
			ShowOptions(1);
		} else {
			ShowOptions(0);
		}
		}

		if(formtype == "C")
		{
		if (bb) { bb.style.display = "none"; }
		if (sqft) {sqft.style.display = "none"; }
		if (units) { units.style.display = "block"; }
		if (acre) { acre.style.display = "none"; }	
		if (lotsz) { lotsz.style.display = "none"; }	
		if (inclnd) { inclnd.style.display = "none"; }	
		if (div522) { div522.style.display = "none"; }		
		if (div523) { div523.style.display = "none"; }
		if (div524) { div524.style.display = "none"; }		
		if (div525) { div525.style.display = "none"; }
		if (div526) { div526.style.display = "none"; }		
		if (div527) { div527.style.display = "none"; }
		if (div528) { div528.style.display = "none"; }		
		if (div529) { div529.style.display = "none"; }		
		if (pop) { pop.style.display = "none"; }
		if (poptxt) { poptxt.style.display = "none"; }
		if (popclr) { popclr.style.display = "none"; }
		if (moreopt) { moreopt.style.display = "none"; }
		if (morebttn) {morebttn.style.display = "none"; }
		if (moreotxt) {moreotxt.style.display = "none"; }
		if (hideopt) {hideopt.style.display = "block";}
		ShowFeatures(0)
		if (popdiv) { popdiv.style.display = "none"; }
		}
	}
	
//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=0")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left="5px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+75+"px" : iecompattest().scrollTop*1+75+"px"
document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}

function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature.");
}

/***********************************************
* Textarea Maxlength script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

