
// write nav
document.write("<div style='margin-left:10;margin-top:10'>");
document.write("<a href='http://www.ahsolutions.net/index.html'>Home Page</a><br>");
document.write("<a href='http://www.ahsolutions.net/search2.shtm'>Available Properties</a><br>");
document.write("<a href='http://www.ahsolutions.net/sell.htm'>Sell your home</a><br>");
document.write("<a href='http://www.ahsolutions.net/buy.htm'>Buy a home</a><br>");
document.write("<a onMouseOut='hideIt();' onMouseOver='showMenuBox();' href='#'>Mortgage Calculator</a><br>");
document.write("<span onMouseOver='showIt();' onMouseOut='hideIt();' id='menuBox' style='display:none;font-size:8pt;width:100%'></span>");
document.write("<a href='http://www.ahsolutions.net/lender.htm'>Private Lenders</a><br>");
document.write("<a href='http://www.ahsolutions.net/renter.htm'>Stop Paying Rent!</a><br>");
document.write("<a href='http://www.ahsolutions.net/foreclosureprevention.htm'>Foreclosure Prevention</a><br>");
document.write("<a target='_blank' href='http://www.scoreup.net'>Credit Repair</a><br>");
document.write("<a href='http://www.ahsolutions.net/why.htm'>Why AHS?</a><br>");
document.write("<a href='http://www.ahsolutions.net/faq.htm'>AHS FAQ</a><br>");
document.write("<a href='http://www.ahsolutions.net/news.shtm?"+genNumbers()+"'><img src='http://www.ahsolutions.net/images/news.gif' border='0'></a><br>");
document.write("<a href='http://www.ahsolutions.net/contact.htm'>Contact</a><br>");
document.write("</div>");
document.write("<p><hr width=90%>");

// Generate and return a random number between 1-100
// this is used to ensure fresh CGI return data that is
// not cached
function genNumbers() {
    var i, rannum;

    // This will generate 0-100.
    rannum = Math.random()*100;

		// rannum is now a decimal value
		// so round to nearest integer
    rannum = Math.round(rannum);
    
    return rannum;
}	

// determine browser
var name=navigator.appName;
if (name.indexOf('Microsoft') !== 0) {
  //not ie
  ie=false;
  document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove = getMousePos;
}else{
	//is ie  
  ie=true;
}

// get mouse position in non-ie browser
function getMousePos(e){
	if (!e)
	var e = window.event||window.Event;
	
	if('undefined'!=typeof e.pageX){
		mouseX = e.pageX;
		mouseY = e.pageY;
	}	else	{
		mouseX = e.clientX + document.body.scrollLeft;
		mouseY = e.clientY + document.body.scrollTop;
	}
}

// show mortage calc menu
function showMenuBox(){
		// get current mouse position
		var posx = 0;
		var posy = 0;
		
		/*
	  if (ie) { // grab the x-y pos.s if browser is IE
	    posx = event.clientX + document.body.scrollLeft;
	    posy = event.clientY + document.body.scrollTop;
	  } else {  // grab the x-y pos.s if browser is NS
	  	var e = window.event||window.Event;
	    posx = mouseX; //e.pageX;
	    posy = mouseY; //e.pageY;
	  }  
*/

	 //posx=271;

	 var mb=document.getElementById('menuBox');
	 
	 //mb.style.position="absolute";
	 mb.style.border="1pt solid black";
	 mb.style.background="#ccddee";
	 //mb.style.zIndex=10;
	 //mb.style.padding="10px";
	 //mb.style.top=posx;
	 //mb.style.left=posy; 
	 mb.style.display="inline";
	 //mb.style.textAlign="left";
	 
	 var html="<a href='http://www.ahsolutions.net/calc.htm'>Mortgage Calculator--Contract for Deed</a><br>"
	 html+="<a href='http://www.ahsolutions.net/rtocalc.htm'>Rent-To-Own Calculator </a><br>"
	 mb.innerHTML=html;
	  
}


function hideIt() {
     document.getElementById("menuBox").style.display="none";
}

function showIt() {
     document.getElementById("menuBox").style.display="inline";
}
