/* Slade Villena : slade@ikorb.com */
/* This handles the menu pop ups for Listings, Agents and Testimonials on the site's menu bar */

var defaultMenuWidth="150px";
var linkset=new Array();

/* If you need to add more listings, simply follow the syntax for listings in linkset[0], you can also reaarange the order of the listings from here.*/
linkset[0]='<a href="/101_Frederick.php">101 Frederick Street</a>';
linkset[0]+='<a href="/119_Gharkey.php">119 Gharkey Street</a>';
linkset[0]+='<a href="/228_4thAve.php">228 4th Avenue</a>';
linkset[0]+='<a href="/539_Seacliff.php">539 Seacliff Drive</a>';
linkset[0]+='<a href="/928_WestCliff.php">928 West Cliff Drive</a>';
linkset[0]+='<a href="/1600_49th">1600 49th Avenue</a>';
linkset[0]+='<a href="/3260_Daffodil.php">3260 Daffodil Court</a>';
linkset[0]+='<a href="/4625_OpalCliff.php">4625 Opal Cliff Drive</a>';

/*these are for the Agents menu pop up.  Add more if needed*/
linkset[1]='<a href="/neal_and_paula.php">Neal and Paula Woods</a>';
linkset[1]+='<a href="/McCandless.php">Elise McCandless</a>';
linkset[1]+='<a href="/herry.php">Becky Herry</a>';
linkset[1]+='<a href="/kathy_smith.php">Kathy Smith</a>';
linkset[1]+='<a href="/joan_spicer.php">Joan Spicer</a>';

/*these are for the testimonials */
linkset[2]='<a href="/neal_testimonials.php">Neal and Paula Woods</a>';
linkset[2]+='<a href="/McCandless_testimonials.php">Elise McCandless</a>';
linkset[2]+='<a href="/herry_testimonials.php">Becky Herry</a>';
linkset[2]+='<a href="/kathy_smith_testimonials.php">Kathy Smith</a>';
linkset[2]+='<a href="/joan_spicer_testimonials.php">Joan Spicer</a>';



/* pop up menu code. */
var ie5=document.all && !window.opera;
var ns6=document.getElementById;

function iecompattest(){
	return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(pickMenu, whichLinks){

	clearhidemenu();
	menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu");
	menuobj.innerHTML=whichLinks;

	shiftX = getShiftX(pickMenu);
	menuobj.style.left=shiftX+"px";
	
	if(navigator.appName=="Microsoft Internet Explorer") {
		document.all.popitmenu.style.bottom="3px";
	}
	
	menuobj.style.visibility="visible";
}

function contains_ns6(a, b) {
	while (b.parentNode) 
	if ((b = b.parentNode) == a) return true;
	return false;
}

function hidemenu(){
	if (window.menuobj) menuobj.style.visibility="hidden";
}

function dynamichide(e){
	if (ie5&&!menuobj.contains(e.toElement)) hidemenu();
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) hidemenu();
}

function delayhidemenu(){
	delayhide=setTimeout("hidemenu()",500);
}

function clearhidemenu(){
	if (window.delayhide) clearTimeout(delayhide);
}

function getShiftX(pickMenu) {	
	if(pickMenu=="listings") {return 6;}
	else if(pickMenu=="agents") {return 260;}
	else if(pickMenu=="testimonials") {return 309;}
	return 0;
}

if (ie5||ns6) document.onclick=hidemenu;

//Bennett: In IE for some reason whenever you activate this function, it adds three pixels...  This makes it unnoticable.
showmenu('a','');