/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

function optiontip(){
	ddrivetip('<b>Contract in Option Period</b><p>The home is under contract and is in the option period. It is usually still being marketed and shown. During the option period (often 7-14 days) the buyer may terminate the contract for any reason. Typically this time is used by the buyer to have the home inspected and negotiate repairs.  Once the option period expires the contract\'s status becomes Pending and the house is considered sold.</p>');
}
function pendingtip(){
	ddrivetip('<b>Pending</b><p>The house is under a contract that is pending. It is no longer being actively marketed nor shown. All repairs have been agreed upon and the buyer and seller are waiting for the closing date. The house is considered sold and the listing agent may place a "Sold" sign in front of it. The main reason that closing fails to happen is a problem with financing.</p>');
}
function kickouttip(){
	ddrivetip('<b>Contract with Kick Out</b><p>The house is under a contract that has a buyer contingency, most often for sale of another property. It is still being marketed and shown. The seller may negotiate a new contract with another buyer and then require the original buyer to remove their contingency or have their contract "kicked out" and replaced with the new contract.</p>');
}
function contingenttip(){
	ddrivetip('<b>Active with Contingency</b><p>The house is under a contract that has a buyer contingency. It is still being marketed and shown. The seller may negotiate a contract with another buyer that will take effect if the first contract falls apart.</p>');
}

document.onmousemove=positiontip

