if (window.addEventListener){
	window.addEventListener("mousemove",vToolTipPosition,false);
}else{
	document.onmousemove=vToolTipPosition;
}

function vcardPopup(agentID){
	vPopup("agent_vcard.asp?id="+agentID);
}

function vcalPopup(propertyID,openhouseID){
	vPopup("prop_vcal.asp?propId="+propertyID+"&openHouseId="+openhouseID);
}

function vPopup(url){
	var vWin=window.open(url,"vWin","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=100,height=100");
    vWin.focus();
}

function toggleVToolTip(state){
	if (!document.layers){
		var obj=document.getElementById?document.getElementById("vToolTip"):document.all["vToolTip"];
		obj.style.visibility=state?"visible":"hidden";
		obj.style.left=vTipX+"px";
		obj.style.top=vTipY+"px";
	}
}

function writeVCardToolTip(){
	writeVToolTip("Download VCard","Click to download this agent's contact information into your Address Book. Select OPEN or SAVE when prompted.");
}

function writeVCalToolTip(state){
	writeVToolTip("Save to Calendar","Click to download the Open House date and time to your calendar.<BR><BR>Select OPEN or SAVE when prompted.");
}

function writeVToolTip(strTitle,strTip){
	if (!document.layers){
		document.write("<div id=\"vToolTip\" style=\"position:absolute;visibility:hidden;left:0px;top:0px;width:135px;height:135px;background-image:url(/images/vtooltip.gif);\"><div style=\"position:absolute;visibility:inherit;left:10px;top:23px;width:115px;font:10px Verdana,Helvetica;font-weight:bold;color:#7B815F;\">"+strTip+"</div></div>");
	}
}

var vTipX=0, vTipY=0, vTipOX=0, vTipOY=10;
function vToolTipPosition(e){
	e=e==null?event:e;
	vTipX=vTipOX+e.clientX;
	vTipY=vTipOY+e.clientY;
}
