//start of print div id
function iefix() {
document.getElementById('stex').value="schools by county";

document.getElementById('stext2').click();
document.getElementById('frmain').src="/other.html#sbc";
}
function setfocus() {
	var ifr =document.getElementById("frmain");
	if (document.all) //IE
	ifr.document.body.focus();
	else //Firefox
	ifr.contentDocument.body.focus();
}
function printContent(id){

if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { ie=true;}
else { ie= false; }


var sz=document.getElementById('frmain');
if (ie == true)
{
var str=window.frames('frmain').document.body.innerHTML;
}
//document.write(sz.contentWindow.document.body.innerHTML);
// var frmm1 = document.getElementById('frmain').document.body.innerHTML;
// var frmm2 = frmm1.document.body.innerHTML;
//document.write(tt);
else {
var sz=document.getElementById('frmain');
var str= (sz.contentWindow.document.body.innerHTML);
}
newwin=window.open('','printwin','left=100,top=100,width=460,height=400,scrollbars=yes,resizable=yes')
newwin.document.write('<HTML>\n<HEAD>\n')
newwin.document.write('<TITLE>Print Page</TITLE>\n')
newwin.document.write('<script>\n')
newwin.document.write('function chkstate(){\n')
newwin.document.write('if(document.readyState=="complete"){\n')
newwin.document.write('window.close()\n')
newwin.document.write('}\n')
newwin.document.write('else{\n')
newwin.document.write('setTimeout("chkstate()",2000)\n')
newwin.document.write('}\n')
newwin.document.write('}\n')
newwin.document.write('function print_win(){\n')
newwin.document.write('window.print();\n')
newwin.document.write('chkstate();\n')
newwin.document.write('}\n')
newwin.document.write('<\/script>\n')
newwin.document.write('</HEAD>\n')
newwin.document.write('<BODY onload="print_win()">\n')
newwin.document.write(str)
newwin.document.write('</BODY>\n')
newwin.document.write('</HTML>\n')
newwin.document.close()
}

//end of print div id
//start of print iframe
function CheckIsIE()
{
if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;}
else { return false; }
}


function PrintThisPage()
{

if (CheckIsIE() == true)
{
document.frmain.focus();
document.frmain.print();
}
else
{
window.frames['frmain'].focus();
window.frames['frmain'].print();
}

} 
//end of print iframe
//start of search script
//<!-- Hide from old browsers


/******************************************
* Find In Page Script -- Submitted/revised by Alan Koontz (alankoontz@REMOVETHISyahoo.com)
* Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
* This notice must stay intact for use
******************************************/

// revised by Alan Koontz -- May 2003
//start of test
//var scrl=document.getElementById('frmain');
//scrl.overflow='hidden';
//document.getElementById('frmain').style.overflow='hidden';
//end of test
var TRange = null;
var dupeRange = null;
var TestRange = null;
var win = null;


// SELECTED BROWSER SNIFFER COMPONENTS DOCUMENTED AT
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html

var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie = (agt.indexOf("msie") != -1);
var is_ie4up = (is_ie && (is_major >= 4));
var is_not_moz = (agt.indexOf('netscape')!=-1)
var is_nav = (nom.indexOf('netscape')!=-1);
var is_nav4 = (is_nav && (is_major == 4));
var is_mac = (agt.indexOf("mac")!=-1);
var is_gecko = (agt.indexOf('gecko') != -1);
var is_opera = (agt.indexOf("opera") != -1);


// GECKO REVISION

var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}


// USE THE FOLLOWING VARIABLE TO CONFIGURE FRAMES TO SEARCH
// (SELF OR CHILD FRAME)

// If you want to search another frame, change from "self" to
// the name of the target frame:
// e.g., var frametosearch = 'main'

//var frametosearch = 'main';
var frametosearch = "mainfr";

function gotoAnchor(aname,pix)
{
var yScroll = document.body.scrollTop;
var xScroll = document.body.scrollLeft;
var tframe=parent.document.getElementById('frmain');
//alert (tframe.src);
tframe.src=aname;
//scrlto(pix);
//parent.scrollTo(0, 0);

}
function liframe(url) {
	//if mozilla
	if (is_gecko) {
		document.getElementById('frmain').src=url;
	}
	else {
	
	}
}
function scrlto(pix) {
//var ss=window.document.getElementById('frmain');
//ss.contentDocument.body.scrollTop=pix;


			if (is_gecko) {
				// var fram = document.getElementById('frmain');
				// if (fram.contentWindow.document.body.innerHTML.length > 96000){
					// fram.src="/other.html";
					// }
				var check = window.document.getElementById('frmain').contentDocument.body.innerHTML;
				if (!(check.indexOf("tmp")==-1)) {
					document.getElementById('frmain').src=document.getElementById('frmain').src;
				}
				window.document.getElementById('frmain').contentDocument.body.scrollTop=pix;
				}
			else {
				var check = document.frames['frmain'].document.body.innerHTML;
				if (!(check.indexOf("tmp")==-1)) {
					//document.frames['frmain'].src=document.frames['frmain'].src;
					var currnt=document.getElementById('frmain').src
					document.getElementById('frmain').src=currnt;
						if (parent.iframeLoaded=false) {
						setTimeout("scrlto()", 1000);
				}
				}

			document.frames['frmain'].document.body.scrollTop=pix;
			}
			return true;
}
function search(whichform, whichframe) {

// TEST FOR IE5 FOR MAC (NO DOCUMENTATION)
/* var scrl=document.getElementById('frmain');
scrl.scrolling='auto'; */
if (is_ie4up && is_mac) return;

// TEST FOR NAV 6 (NO DOCUMENTATION)

if (is_gecko && (is_rev <1)) return;

// TEST FOR Opera (NO DOCUMENTATION)

if (is_opera) return;

// INITIALIZATIONS FOR FIND-IN-PAGE SEARCHES

if(whichform.findthis.value!=null && whichform.findthis.value!='') {

str = whichform.findthis.value;
win = whichframe;
var frameval=false;
if(win!=self)
{

frameval=true; // this will enable Nav7 to search child frame
win = parent.frames[whichframe];

}


}

else return; // i.e., no search string was entered

var strFound;

// NAVIGATOR 4 SPECIFIC CODE

if(is_nav4 && (is_minor < 5)) {

strFound=win.find(str); // case insensitive, forward search by default

// There are 3 arguments available:
// searchString: type string and it's the item to be searched
// caseSensitive: boolean -- is search case sensitive?
// backwards: boolean --should we also search backwards?
// strFound=win.find(str, false, false) is the explicit
// version of the above
// The Mac version of Nav4 has wrapAround, but
// cannot be specified in JS


}

// NAVIGATOR 7 and Mozilla rev 1+ SPECIFIC CODE (WILL NOT WORK WITH NAVIGATOR 6)

if (is_gecko && (is_rev >= 1)) {
var scrl=document.getElementById('frmain');
scrl.style.overflow='visible';
if(frameval!=false) win.focus(); // force search in specified child frame
strFound=win.find(str, false, false, true, false, frameval, false);

// The following statement enables reversion of focus 
// back to the search box after each search event 
// allowing the user to press the ENTER key instead
// of clicking the search button to continue search.
// Note: tends to be buggy in Mozilla as of 1.3.1
// (see www.mozilla.org) so is excluded from users 
// of that browser.

if (is_not_moz) whichform.findthis.focus();

// There are 7 arguments available:
// searchString: type string and it's the item to be searched
// caseSensitive: boolean -- is search case sensitive?
// backwards: boolean --should we also search backwards?
// wrapAround: boolean -- should we wrap the search?
// wholeWord: boolean: should we search only for whole words
// searchInFrames: boolean -- should we search in frames?
// showDialog: boolean -- should we show the Find Dialog?


}

if (is_ie4up) {

// EXPLORER-SPECIFIC CODE revised 5/21/03
/* var scrl=document.getElementById('frmain');
scrl.style.overflow='scroll'; */
document.frames['frmain'].document.body.style.overflow='auto';
if (TRange!=null) {

TestRange=win.document.body.createTextRange();



if (dupeRange.inRange(TestRange)) {

TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = win.document.body.scrollTop + TRange.offsetTop;
TRange.select();
}


}

else {

TRange=win.document.body.createTextRange();
TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = TRange.offsetTop;
TRange.select();
}



}
}

if (TRange==null || strFound==0) {
TRange=win.document.body.createTextRange();
dupeRange = TRange.duplicate();
strFound=TRange.findText(str);
if (strFound) {
//the following line added by Mike and Susan Keenan, 7 June 2003
win.document.body.scrollTop = TRange.offsetTop;
TRange.select();
}


}

}

if (!strFound) alert ("String '"+str+"' not found!") // string not found


}
// -->
//end of search script





var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
// BROWSER?
if (browser == ''){
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
else browser = 'IE';
}
if (version == ''){
version= navigator.appVersion;
paren = version.indexOf('(');
whole_version = navigator.appVersion.substring(0,paren-1);
version         = parseInt(whole_version);
}

if (browser == 'IE' && version >= 4) document.write('<'+'link rel="stylesheet" href="/csstlm/ie.css" />');
if (browser == 'Netscape' && version >= 2.02) document.write('<'+'link rel="stylesheet" href="/csstlm/standard.css" />');

// -->
//start calculator script
<!--Hide JavaScript from Java-Impaired Browsers
var irate, mi, cmi, years, tprinc, princ, paym, cpaym, osp,v,downp,downr,comp;
function calcPaym(cdn){
   tprinc = round2d(parseFloat(document.smpc.tprinc.value));
   downp = .01*parseFloat(document.smpc.downp.value);
   downr = ceil2d(downp*tprinc);
   princ = tprinc-downr;
   
   document.smpc.princ.value = fmt2d(princ,0);
   document.smpc.downr.value = fmt2d(downr,0);

   
   irate = .01*parseFloat(document.smpc.percent.value);
   years=parseFloat(document.smpc.years.value);
   term = parseFloat(document.smpc.term.value);
   if(term > years)term=years;
   
   if (term==0 || years==0||irate<.0001||princ<1)
   {alert("values must be numeric");}
   else 
   {
       if(cdn)mi = Math.pow(1+ irate/2,1/6) 
       else   mi = 1+(irate/12);
       v = 1/mi;
       paym = ceil2d(princ*(mi-1)/(1-Math.pow(mi,-(years*12))));
       osp = (princ-(v*paym*(1-Math.pow(v,12*term)))/(1-v))/Math.pow(v,12*term);
       if(osp<0)osp = 0;
       
       document.smpc.paym.value=fmt2d(paym,0);
   }
}
function round2d(n){return(.01* Math.round(100*n));}
function floor2d(n){return(.01* Math.floor(100*n));}
function ceil2d(n){return(.01* Math.ceil(100*n));}
// format number n as string width w with 2 decimal places
function fmt2d(n,w)
{
   var work,dp,sl,dl;
   
   work = ""+floor2d(n); // force only 2 decimals
   sl=work.length;
   
   if(-1 == (dp = work.indexOf(".")))work=work+".00";
   else if(3 > sl-dp)work = work+".00".substring(sl-dp,3);
   sl = work.length;
   if(0 != w && w !=sl)
      if(w<sl){work = "*";for(sl=1;sl<w;sl++)work=work+"*";}
      else for(;sl<w;sl++)work=" "+work; 
   return work;
}

//end calculator script





function tell(){
	var pge =document.getElementById('frmain');
	var pgsr=window.frames.mainfr.location;
	console.log(pge,pgsr);
	document.getElementById('frmain').src=window.frames.mainfr.location;
	pge.src=new pgsr;
}
function gframe(){
	parent.window.scrollTo(0,0);
	var frpage=document.getElementById('frmain');
	var query = window.location.search +".html";
	var posa = query.search(/fmls/);
	var posb = frpage.src.search(/fmls/);
	if (query.length <6){
		frpage.src="/home.html"
	}
	else{
			if (posa>0){
				frpage.src="http://www.fmlsweb.com/MERRITTS/DesktopDefault.aspx?pageid=1127&pagealias=FramesSearch"; 
				ifrsize('2940','606','http://www.fmlsweb.com/MERRITTS/DesktopDefault.aspx?pageid=1127&pagealias=FramesSearch');

			}
			else{
				

				if (query.substring(0, 1) == '?') {
					query = query.substring(1);
					}
				frpage.src=query;
				}

				
	}
}

function lnka(pgel){
		
		var pge =document.getElementById('frmain');
		pge.src="/"+ pgel + ".html";
		/*pge.style.height="200px";*/
}
function mout(){

		var ele=document.getElementById('em1');
		ele.src='/images/em1.gif';

}
function setfr(ulf){
	document.getElementById('frmain').href=ulf; 
	window.scroll(0,0);
}

function ifrsize(hsiz,wsiz,ul){
// this works in firefox: var ss=document.getElementById('frmain');
// ss.contentDocument.body.scrollTop=300;
// this works in firefox: document.getElementById('frmain').contentDocument.getElementById("mt").scrollIntoView(true);
	//document.body.scroll = "no";
	//setTimeout("window.scrollTo(0,0)",1);
	var scrl=document.getElementById('frmain');
	//window.scroll(0,0);
	scrl.style.overflow='auto';
	document.getElementById('navbar2').style.display='block';
	document.getElementById('navbar3').style.display='none';
	sz=document.getElementById('frmain');


	if (navigator.appName.indexOf('Netscape') != -1){
	browser = 'Netscape'
	}
	else {browser = 'IE';
	}
	if (ul !=""){	
		if (browser == 'IE'){
			document.frames['frmain'].document.body.style.overflow='auto';
			document.frames['frmain'].document.body.style.overflow='visible';
			}
		else {
			document.getElementById('frmain').style.overflow='auto';
			}
		}
if(typeof(res)=="object") debugger;		
		if (browser=='IE'){
			document.getElementById('navbar2').style.bottom=((hsiz-334) + 'px');
			wsiz=wsiz-26;
			//document.frames['frmain'].document.body.style.overflow='hidden';
/* 			var scrl=document.getElementById('frmain');
			scrl.document.body.scroll='no';
			scrl.style.overflow='hidden'; */
		}
		// hsiz=336;
		// wsiz=549;
	sz.style.height=(hsiz + 'px');
	sz.style.width=(wsiz + 'px');

	if (ul.search(/fmls/)>0)
		{
		var hd = "<form><input type=\"button\" onclick=\"tell()\" value=\"Call function\"></form>";
		
		sz.style.width=(wsiz + 'px');
		document.getElementById('navbar').style.bottom=((hsiz-334) +'px');
		document.getElementById('navbar').style.margin_left=hsiz-200;
/* 		document.getElementById("hdraa").innerHTML=hd ; */
		document.getElementById('topnav').style.display='none';
/* 		document.frames['frmain'].document.body.style.background='none'; */
		document.getElementById('navbar2').style.display='none';
		document.getElementById('navbar3').style.zIndex=4;
		document.getElementById('navbar3').style.display='block';
		document.getElementById('preamble').style.marginLeft='95px';
		
		}
/* parent.window.scrollTo(0,0); */

/* setTimeout("self.scrollTo(0,0)",1); */

}

function mover(){
		var ele=document.getElementById('em1');
		ele.src='/images/em2.gif';
		}

function lchange(nav){
		var sellers=document.getElementById('lsellers');
		var about=document.getElementById('about');
		var buyers=document.getElementById('lbuyers');
		var bs=document.getElementById('bsai');
		if (nav==1)
		{
		document.getElementById('fm1').spage.value="start.html";
		//document.getElementById('sch').innerHTML="<h3>Print all Buyers info</h3>";
		bs.src="/images/buyers2.gif";
		sellers.style.display="none";
		buyers.style.display="block";
		about.style.display="none";
		var ttt1=document.getElementById('stext2');
		ttt1.src="/images/butsch.jpg";
		var ttt2=document.getElementById('prta');
		ttt2.src="/images/butprntb.jpg";
		var lsll=document.getElementById('frmain');
		//ifrsize('330','549','');
		lsll.src='/home.html';
		}
		else if (nav==2)
		{
		//document.getElementById('sch').innerHTML="<h3>Print all Sellers info</h3>";
		document.getElementById('fm1').spage.value="lsell.html";
		bs.src="/images/sellers2.gif";
		sellers.style.display="block";
		buyers.style.display="none";
		about.style.display="none";
		var ttt3=document.getElementById('stext2');
		ttt3.src="/images/butprntsh.jpg";
		var ttt4=document.getElementById('prta');
		ttt4.src="/images/butprnt.jpg";
		var lsll=document.getElementById('frmain');
		//ifrsize('330','549','');
		lsll.src='/preparing_to_sell.html';
		}
		else 
		{
		document.getElementById('fm1').spage.value="other.html";
		//document.getElementById('sch').innerHTML="<h3>Print all Other info</h3>";
		bs.src="/images/about2.gif";
		sellers.style.display="none";
		buyers.style.display="none";
		about.style.display="block";
		var ttt5=document.getElementById('prta');
		ttt5.src="/images/butoth.jpg";
		var ttt6=document.getElementById('stext2');
		ttt6.src="/images/butsoth.jpg";
		var oth=document.getElementById('frmain');
		//ifrsize('330','549','');
		oth.src='/gwinnett_cities.html';
		}
}
function frefresh(){
	var frm = document.getElementById('frmain');
	var dne = frm.src;
	
}
function calcHeight()
{
  //find the height of the internal page
  var the_height=document.getElementById('frmain').contentWindow.document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('frmain').height=
      the_height;
}
