//Pop-it menu- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function writeClose(){
	document.write("<a href=javascript:void(0) class=bodyText onclick=hidemenu()>Close Window [x]</a>")	
}

//opens window for advertiser popup
//added 1.12.05 by Kasey McCurdy
function goToURL(address){
	sponsorWin = window.open(address,'sponsor','width=800,height=650,toolbar=yes,resizable=yes,scrollbars=yes,location=yes,status=yes,menubar=yes,screenX=50,screenY=50')
    if(window.focus){sponsorWin.focus()};
	}
//SPECIFY ADVERTISERS THAT HAVE HOVER ADS
var ad = new Array();
var adHLink = new Array();
	//home depot hover ad
	adHLink[0] = ""; //link 
	ad[0]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr><td align=right><a href=javascript:void(0) class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr><td class=greyHeadline>Get the skills you need to improve your home.</td></tr>' +
		  '<tr onClick=><td class=bodyText><img src="images/presentedBy/large/homeDepot.gif" width="80" height="80" border="0" align="left">From installing a ceiling fan to decorating your windows, free National Clinics from The Home Depot will teach you how to create projects that will improve the look and value of your home.  <br><br><strong>Learn more about The Home Depot clinics.</strong> &nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></td>' +
		  '</tr></table>'
	//anderson
	adHLink[1] = "http://www.andersenwindows.com";
	ad[1]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr onClick=goToURL(adHLink[1])><td class=greyHeadline>Long Live the Home!</td></tr>' +
		  '<tr onClick=goToURL(adHLink[1])><td class="bodyText"><img src="images/presentedBy/large/anderson.gif" border="0" align="left">The Andersen® brand is the most recognized and most used brand in the window and patio door industry. For a local dealer, more information, or a copy of the Andersen 20/10 limited warranty, visit www.andersenwindows.com or call 1-800-426-4261.  <br><br><div align=right><b><a href=http://www.andersenwindows.com target=_blank class=featuredSponsorLink>Click To Visit AndersonWindows.com</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></a></td>' +
		  '</tr></table>'
	//behr
	adHLink[2] = "http://www.behr.com";
	ad[2]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr onClick=goToURL(adHLink[2])><td class="greyHeadline">Get Your Style From BEHR Paints!</td></tr>' +
		  '<tr onClick=goToURL(adHLink[2])><td class="bodyText"><img src="images/presentedBy/large/behr.gif" border="0" align="left">Color is the most powerful and yet inexpensive way to change and coordinate the look and feel of your entire home. BEHR has revolutionized the color selection process by making it easier than ever for you to explore new decorating ideas and coordinate colors with confidence using ColorSmart by BEHR(tm). Try it online at www.behr.com or at The Home Depot. <br><br><div align=right><b>Click To Visit Behr.com</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>' +
		  '</tr></table>'
	//ford
	adHLink[3] = "http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome3";
	ad[3]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr onClick=goToURL(adHLink[3])><td class="greyHeadline">Ford Freestyle – One Vehicle. Endless Possibilities.</td></tr>' +
		  '<tr onClick=goToURL(adHLink[3])><td class="bodyText"><table width=100% cellspacing=0 cellpadding=0><td width=124 valign=top><img src="/images/presentedBy/large/ford_120x70.jpg" border="0"></td><td class="bodyText">Somewhere between a car and an SUV, there’s an entirely new way to get around. The totally new Freestyle. It combines the things you love about a car with the stuff you need from an SUV.</td></table> <br><div align=right><b>Learn more about the 2005 Ford Freestyle</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>' +
		  '</tr></table></a>'
	
	//quilted northern
	adHLink[4] = "http://www.quiltednorthern.com/splash.html";
	ad[4]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr onClick=goToURL(adHLink[4])><td class="greyHeadline"> Give Your Bathroom a Makeover!</td></tr>' +
		  '<tr  onClick=goToURL(adHLink[4])><td class="bodyText"><img src="images/presentedBy/large/quiltedNorthern.gif" border="0" align="left">The makers of Quilted Northern Ultra® offer you simple solutions for improving your bathroom – from accessorizing to organizing. Click here for helpful ideas for all of the bathrooms in your home.<br><br><div align=right><b>Click To Visit QuiltedNorthern.com</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>' +
		  '</tr></table>'
	//jeldwen
	adHLink[5] = "http://www.jeldwen.com";
	ad[5]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
		  '<tr ><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
		  '<tr onClick=goToURL(adHLink[5])><td class="greyHeadline">RELIABILITY For Real Life!</td></tr>' +
		  '<tr onClick=goToURL(adHLink[5])><td class="bodyText"><img src="images/presentedBy/large/jeldwen.jpg" border="0" align="left">JELD-WEN carefully crafts a wide variety of reliable windows, interior doors and exterior doors. Log onto our web site to learn more about <Br>JELD-WEN products, including the exclusive, durable AuraLast wood. <br><br><div align=right><b>Click To Visit JELD-WEN.com</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>' +
		  '</tr></table>'
	//beneful
	adHLink[6] = "http://www.beneful.com";
	ad[6]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[6])><td class="greyHeadline">America’s Home welcomes man’s best friend!</td></tr>' +
	  "<tr onClick=goToURL(adHLink[6])><td class='bodyText'><img src='images/presentedBy/large/beneful.gif' border=0 align=left>You've never seen a dog food like Beneful! Beneful's wholesome ingredients like real meat, whole grains, and vegetables provide abundant nutrition for your dog's health and happiness! <br><br><div align=right><b>Click To Visit Beneful.com</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'
	//dell
	adHLink[7] = "http://www.dell4me.com";
	ad[7]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[7])><td class="greyHeadline">&nbsp;</td></tr>' +
	  "<tr onClick=goToURL(adHLink[7])><td class='bodyText'><img src='images/presentedBy/large/dell.gif' border=0 align=left>Dell is a trusted and diversified information-technology supplier and partner, and sells a comprehensive portfolio of products and services directly to customers worldwide. Dell designs, builds and delivers innovative, tailored systems that provide customers with exceptional value. For more information about Dell and its products and services, visit www.dell4me.com.</b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'	  
	//john deere
	adHLink[8] = "http://www.JohnDeere.com/Vehicles";
	ad[8]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[8])><td class="greyHeadline">Set your plans in motion. </td></tr>' +
	  "<tr onClick=goToURL(adHLink[8])><td class='bodyText'><img src='images/presentedBy/large/johnDeereTractor.jpg' border=0 align=left>The John Deere Gator ™ Compact Series Utility Vehicle can take you from do-it-yourselfer to do-it-a-lot-easier.  And thanks to its versatile cargo box, and car-like operation, it’s sure to become your new best friend.  Learn more about Gator Utility Vehicles at <b><a href='#'>www.JohnDeere.com/Vehicles</a></b>&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'	 	  
	//james 
	adHLink[9] = "http://www.jameshardie.com";
	ad[9]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[9])><td class="greyHeadline">Durable Beauty, Flawless Character. </td></tr>' +
	  "<tr onClick=goToURL(adHLink[9])><td class='bodyText'><img src='images/presentedBy/large/james.jpg' border=0 align=left>Whether you’re building a new home or just remodeling, James Hardie offers a wide selection of fiber-cement siding allowing you to create the look you crave.  No wonder it’s already protecting over 3.5 million of North America’s finest homes.<strong>&nbsp;&nbsp;Vist www.jameshardie.com&nbsp;</strong><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'	 	  
	//simmons
	adHLink[10] = "http://www.healthsmartbed.com";
	ad[10]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[10])><td class="greyHeadline">America’s Home is a HealthSmart ™ Home</td></tr>' +
	  "<tr onClick=goToURL(adHLink[10])><td class='bodyText'><img src='images/presentedBy/large/simmons.jpg' border=0 align=left>Introducing the innovative HealthSmart™ Bed, only from Simmons. The bed that helps wash away stains, germs, bacteria, dust mites, odors and perspiration just like when you clean your sheets.<strong>&nbsp;&nbsp;Vist www.HealthSmartBed.com &nbsp;</strong><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr><tr><td class=greyHeadline>Free Informational Downloads</td></tr>' + 
	  '<tr>' +
	  '<td class="bodyText"><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0>&nbsp;<a href="http://www.winamericashome.com/pdf/simmons_couples.pdf" class="bodyText">Sleep Tips For Couples</a></td>' +
	  '</tr>' +
	  '<tr>' +
	  '<td class="bodyText"><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0>&nbsp;<a href="http://www.winamericashome.com/pdf/simmons_understanding.pdf" class="bodyText">Understanding Sleep -- Are you sleep deprived?</a></td>' +
	  '</tr>' +
	'</table>'	 	  	  
	//martex
	adHLink[11] = "http://www.martex.com";
	ad[11]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[11])><td class="greyHeadline">Color your world!</td></tr>' +
	  "<tr onClick=goToURL(adHLink[11])><td class='bodyText'><img src='images/presentedBy/large/martex.jpg' border=0 align=left>In America's Home and yours, choose colors in your bed and bath to express your personality, lighten your mood and lift your spirits. Martex color. Can you feel it? <strong><br><br>Vist www.martex.com&nbsp;</strong><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'	
	//wear dated
	adHLink[12] = "http://www.weardated.com";
	ad[12]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[12])><td class="greyHeadline">Get durable with Wear-Dated!</td></tr>' +
	  "<tr onClick=goToURL(adHLink[12])><td class='bodyText'><img src='images/presentedBy/large/wearDated.jpg' border=0 align=left>When it comes to the durability of your carpet, one thing's for sure...'you'll wear out before Wear-Dated(R) does'.  Wear-Dated carpet fiber meets stringent construction standards and is tough tested for durability.<strong><br><br>Vist www.weardated.com&nbsp;</strong><img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'
	//thomasville
	adHLink[13] = "http://www.thomasvillecabinetry.com";
	ad[13]='<table width="290" border="0" cellpadding="2" cellspacing="0" onmouseout=javascript:delayhidemenu() onmouseover=javascript:clearhidemenu() align=center>' +
	  '<tr><td align=right><a href=# class=bodyText onclick=hidemenu()>Close [x]</a></td></tr>' +
	  '<tr onClick=goToURL(adHLink[13])><td class="greyHeadline">You know the furniture.  Now discover the cabinetry. </td></tr>' +
	  "<tr onClick=goToURL(adHLink[13])><td class='bodyText'><img src='images/presentedBy/large/thomasville.jpg' border=0 align=left>Thomasville® has brought distinctive furnishings to homes just like yours for over 100 years.  The same dedication to craftsmanship and style continues today with Thomasville Cabinetry®.  For your kitchen, bath and throughout your home, we offer choices and styles that integrate beautifully with your ideas, your décor ... your vision of home.  Thomasville Cabinetry is available only at The Home Depot.  See the collection at <strong>www.thomasvillecabinetry.com</strong>.&nbsp;<img src=http://www.winamericashome.com/images/shell/arrow_right_blue.gif align=middle border=0></div></td>" +
	  '</tr></table>'				  
////No need to edit beyond here
var ie4=document.all
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=300 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
//eventX=ie4? event.clientX : ns6? e.clientX : e.x
//eventY=ie4? event.clientY : ns6? e.clientY : e.y
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+340 : ns6? window.pageXOffset+340 : eventX-340
else
//position the horizontal position of the menu where the mouse was clicked
//menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX
menuobj.thestyle.left=140? document.body.scrollLeft+340: ns6? window.pageXOffset+140 : 140

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4-20? document.body.scrollTop+eventY-menuobj.contentheight-20 : ns6? window.pageYOffset+eventY-menuobj.contentheight-20 : eventY-menuobj.contentheight-20
else
menuobj.thestyle.top=ie4-20? document.body.scrollTop+event.clientY-20 : ns6? window.pageYOffset+eventY-20 : eventY-20
menuobj.thestyle.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

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

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",1500)
}

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

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
document.onclick=hidemenu


//write out the div
document.write("<div id='popmenu' class='menuskin' onMouseout='dynamichide(event)'></div>");
