function openWin(url,w,h){
 	myWindow = window.open(url, "myWindow", "width="+w+",height="+h);
	myWindow.focus();
	myWindow.moveTo(150,150);
}


//************************
//macromedia functions
//************************
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//************************
// displays bhg.com header
//************************
function displayBhgHeader(){
	document.write("<img src='images/shell/bhg_siteNav_header.gif' width='760' height='29' border='0' usemap='#Map' />")
}

//************************
// image map for  bhg header
//************************
function displayBhgHeaderMap(){
	document.write("" +
	"<map name='Map' id='Map'>" +
	  "<area shape='rect' coords='94,2,210,26' href='http://www.bhg.com/bhg/househome/index.jhtml' />" +
	  "<area shape='rect' coords='216,3,335,26' href='http://www.bhg.com/bhg/food/index.jhtml' />" +
	  "<area shape='rect' coords='341,2,408,25' href='http://www.bhg.com/bhg/gardening/index.jhtml' />" +
	  "<area shape='rect' coords='416,3,492,25' href='http://www.bhg.com/bhg/holidays/index.jhtml' />" +
	  "<area shape='rect' coords='499,3,558,24' href='http://www.bhg.com/bhg/crafts/index.jhtml' />" +
	  "<area shape='rect' coords='564,2,627,25' href='http://www.bhg.com/bhg/health/index.jhtml' />" +
	  "<area shape='rect' coords='634,3,695,25' href='http://www.bhg.com/bhg/family/index.jhtml' />" +
	  "<area shape='rect' coords='700,2,754,24' href='http://www.bhg.com/bhg/store/index.jhtml' />" +
	  "<area shape='rect' coords='3,3,89,25' href='http://www.bhg.com' />" +
	"</map>")
}

//************************
// displays BHBL header
//************************
function displayHeader(){
	var homeLink;
	myDate = new Date();
	myMonth = myDate.getMonth();
	myDay = myDate.getDate(); 
	
	if(myMonth == 6 && myDay == 29){
		homeLink = "http://www.bhg.com/bhg/contest/member/contest.jhtml?regSource=1167&contest=BHBLDrawing7" 
	} else {
		homeLink = "http://www.bhg.com/bhg/contest/member/contest.jhtml?regSource=1169&contest=BHBLDrawing9_10"
	}
	document.write("" + 
	"<script>MM_preloadImages('images/nav/navi_r3_c2_f2.gif','images/nav/navi_r3_c3_f2.jpg','images/nav/navi_r3_c4_f2.gif','images/nav/navi_r3_c5_f2.gif');</script>" +
	
"<table border='0' cellpadding='0' cellspacing='0' width='760'> " +
	  "<tr>" + 
	   "<td><img src='images/nav/spacer.gif' width='299' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='67' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='132' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='83' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='147' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='32' height='1' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='1' height='1' border='0' alt=''></td></tr>" + 
	  "<tr>" + 
	   "<td rowspan='2'><img name='navi_r2_c1' src='images/nav/navi_r2_c1.jpg' width='299' height='104' border='0' alt=''></td>" + 
	   "<td colspan='5'><img name='navi_r2_c2' src='images/nav/navi_r2_c3.jpg' width='461' height='77' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='1' height='77' border='0' alt=''></td></tr>" + 
	  "<tr>" + 
	   "<td><img src='/images/shell/shim.gif' width='65' height='8'></td>" + 
	   "<td align=right><a href='http://www.winamericashome.com' onMouseOut='MM_swapImgRestore()' onMouseOver=MM_swapImage('navi_r3_c2','','images/nav/navi_r3_c2_f2.gif',1);><img name='navi_r3_c2' src='images/nav/navi_r3_c2.gif' width='67' height='27' border='0' alt=''></a></td>" + 
	   "<td><a href='prizes.html' onMouseOut='MM_swapImgRestore();' onMouseOver=MM_swapImage('navi_r3_c4','','images/nav/navi_r3_c4_f2.gif',1);><img name='navi_r3_c4' src='images/nav/navi_r3_c4.gif' width='83' height='27' border='0' alt=''></a></td>" + 
	   "<td><a href='http://www.bhg.com/bhg/category.jhtml?categoryid=/templatedata/bhg/category/data/DecoratingIdeas_BetterHomeBetterLiving.xml' onMouseOut='MM_swapImgRestore();' onMouseOver=MM_swapImage('navi_r3_c5','','images/nav/navi_r3_c5_f2.gif',1);><img name='navi_r3_c5' src='images/nav/navi_r3_c5.gif' width='147' height='27' border='0' alt=''></a></td>" + 
	   "<td><img name='navi_r3_c6' src='images/nav/navi_r3_c6.jpg' width='32' height='27' border='0' alt=''></td>" + 
	   "<td><img src='images/nav/spacer.gif' width='1' height='27' border='0' alt=''></td></tr></table>");
}

function displayFeaturedSponsor(){
	//set up array of ad images, ad text, and click links
	//main image 
	adImage = new Array();
		adImage[0] = "images/presentedBy/large/anderson.gif";
		//adImage[1] = "images/presentedBy/large/dell.gif";
		adImage[1] = "images/presentedBy/large/homeDepot.gif";
		adImage[2] = "images/presentedBy/large/behr.gif";
		adImage[3] = "images/presentedBy/large/homeDepot.gif";
		adImage[4] = "images/presentedBy/large/ford100.jpg";
		adImage[5] = "images/presentedBy/large/homeDepot.gif";
		adImage[6] = "images/presentedBy/large/0502ba_120x70_appliance.gif";
		adImage[7] = "images/presentedBy/large/0502ba_120x70_howtoclinics.gif";
		adImage[8] = "images/presentedBy/large/0502ba_120x70_learnhow.gif";
	adHead = new Array();//headline
		adHead[0] = "Long Live the Home";
		//adHead[1] = "New Year's Savings From Dell!";
		adHead[1] = "Home Depot Project of the Month";
		adHead[2] = "Get your style from BEHR Paints! ";
		adHead[3] = "Home Depot Know How";
		adHead[4] = "Ford Freestyle – One Vehicle. Endless Possibilities";
		adHead[5] = "Get the Skills You Need to Improve Your Home";
		adHead[6] = "Buy Appliances Online, Plus Get FREE Delivery!"
		adHead[7] = "FREE How-To Clinics"
		adHead[8] = "Learn How at HomeDepot.com!"
	adText = new Array();//text
		adText[0] = "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.";
		//adText[1] = "Take 10% off your purchase of ANY Dimension desktop or up to 15% off Inspiron notebooks instantly! Simply 'customize &amp; price' and purchase a new Dimension!";
		adText[1] = "Learn how to troubleshoot an electrical problem, build a deck, install cabinet doors or lay out a garden bed, step by step. We can guide you through over 150 home improvement projects and offer plenty of tips and ideas along the way.";
		adText[2] = "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.";
		adText[3] = "Learn how to troubleshoot an electrical problem, build a deck, install cabinet doors or lay out a garden bed, step by step. We can guide you through over 150 home improvement projects and offer plenty of tips and ideas along the way.";
		adText[4] = "Somewhere between a car and an SUV is a brand new way to get around. Meet the all new 2005 Ford Freestyle – One Vehicle. Endless Possibilities.<br><a href='http://www.fordvehicles.com/cars/freestyle' target=_blank class=bodyText>Learn more >></a>";
		adText[5] = "From installing a ceiling fan to decorating your windows, National Clinics from The Home Depot® will teach you how to create projects that will improve the look and value of your home. <a class=bodyText href=http://www.homedepotclinics.com target=_blank>Click here to view The Home Depot Clinic Schedule</a>";
		adText[6] = "At homedepot.com, you can get hundreds of the best appliances at guaranteed low prices. Plus, you get free delivery by mail-in rebate with major appliance purchases over $299."
		adText[7] = "Learn how to paint a room, tile a floor and more at The Home Depot’s FREE clinics. Our expert instructors can show you exactly what you need to know to make your project a resounding success. Learn more and sign up at  <a class=bodyText href=http://www.homedepotclinics.com target=_blank>homedepotclinics.com</a>"
		adText[8] = "Get the know-how you need for all kinds of projects online at homedepot.com. You can access step-by-step instructions, project calculators – even videos. Best of all, these helpful tools are all FREE."
	adLink = new Array();//link
		adLink[0] = "http://www.andersonwindows.com";
		//adLink[1] = "http://www.dell.com";
		adLink[1] = "http://www.homedepot.com/prel80/HDUS/EN_US/diy_main/pg_diy.jsp?CNTTYPE=PROD_META&CNTKEY=Know+How%2fproject&app=webSite&projectKey=Painting%2fDecorative+Painting+Techniques%2fSponging+On&cm_mmc=1hd.com2BHG-_-partnership-_-win_americas_home-_-win_americas_home";
		adLink[2] = "http://www.behr.com";
		adLink[3] = "http://www.homedepot.com/prel80/HDUS/EN_US/diy_main/pg_diy.jsp?CNTTYPE=PROD_META&CNTKEY=Know%20How&MID=9876&pos=n28";
		adLink[4] = "http://www.fordvehicles.com/cars/freestyle"
		adLink[5] = "http://www.homedepotclinics.com";
		adLink[6] = "http://www.homedepot.com/prel80/HDUS/EN_US/diy_main/pg_diy.jsp?CNTTYPE=PROD_META&CNTKEY=misc/searchResults.jsp&MID=9876&N=2984+4370&pos=n08";
		adLink[7] = "http://www.homedepotclinics.com";
		adLink[8] = "http://www.homedepot.com";
		
	rn = Math.round(Math.random() * (adImage.length-1));
		if(rn == -1){
			rn = 0;
		}
	//template for images/text to go into 
	document.write("" +
	"<a href='" + adLink[rn] + "' class=featuredSponsorLink target=_blank>" +
	"<table width='595' border='0' cellpadding='0' cellspacing='0' class='defaultTable'>" +
	  "<tr>" +
		"<td width='100' align=center><img src='" + adImage[rn] + "' border='0'/></td>" +
		"<td width='10'><img src='images/shell/verticalLine_60px.gif' border='0'/></td>" +
		"<td width='484' align='center' valign='middle'><table width='475' border='0' cellspacing='0' cellpadding='3'>" +
		  "<tr>" +
			"<td class='greyHeadline'>" + adHead[rn] + "</td>" +
		  "</tr>" +
		  "<tr>" +
			"<td class='bodyText'>" + adText[rn] + "</td>" +
			"</tr>" +
		  "<tr>" +
			"<td align='right' class='bodyText'><table width='140' border='0' cellspacing='0' cellpadding='0'>" +
			 "<tr>" +
				"<td width='130' align='right'><a target=_blank href='" + adLink[rn] + "' class='bodyText'>Click Here</a>&nbsp;</td>" +
				"<td width='10'><a target=_blank href='" + adLink[rn] + "'><img src='images/shell/arrow_right_blue.gif' width='12' height='12' border='0' /></a></td>" +
			  "</tr>" +
			"</table></td>" +
		  "</tr>" +
		"</table>" +
		"</td>" +
		"</tr>" +
	"</table>" +
	"</a>" +
	"")
}

function displayAdToolbox(){
	document.write(""+
	"<table width='140' border='0' cellspacing='0' cellpadding='0'>" + 
         "<tr>" + 
            "<td align='center' class='presentedBy'>Presented exclusively by </td>" + 
         "</tr>" + 
          "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='10' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.homedepot.com' onMouseover=showmenu(event,ad[0])><img src='images/presentedBy/homeDepot.gif' border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center' class='presentedBy'><br>With these <br>participating brands:<br><br><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.andersenwindows.com' onMouseover=showmenu(event,ad[1])><img src='images/presentedBy/anderson.gif' border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.behr.com' onMouseover=showmenu(event,ad[2])><img src='images/presentedBy/behr.gif'  border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" +  
            "<td align='center'><a href='http://www.beneful.com/'  onMouseover=showmenu(event,ad[6]) target='_blank'><img src='images/presentedBy/beneful.gif' border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.winamericashome.com/dell' onMouseover=showmenu(event,ad[7])><img src='images/presentedBy/dell.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome3' onMouseover=showmenu(event,ad[3])><img src='images/presentedBy/ford.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row
          "<tr>" + 
            "<td align='center'><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.jeldwen.com' onMouseover=showmenu(event,ad[5]) target='_blank'><img src='images/presentedBy/jeldwen.gif' border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><a href='http://www.JohnDeere.com/Vehicles' onMouseover=showmenu(event,ad[8])><img src='images/presentedBy/johnDeere.gif' border='0' /></a></td>" + 
          "</tr>" + 
          "<tr>" + 
            "<td align='center'><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.quiltednorthern.com/splash.html' onMouseover=showmenu(event,ad[4])><img src='images/presentedBy/quiltedNorthern.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row
  		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.jameshardie.com' onMouseover=showmenu(event,ad[9])><img src='images/presentedBy/james.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row
  		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.healthsmartbed.com' onMouseover=showmenu(event,ad[10])><img src='images/presentedBy/simmons.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row
  		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.martex.com' onMouseover=showmenu(event,ad[11])><img src='images/presentedBy/martex.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row
  		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.weardated.com' onMouseover=showmenu(event,ad[12])><img src='images/presentedBy/wearDated.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row		
  		  //sponsor row
          "<tr>" + 
            "<td align='center'><a href='http://www.thomasvillecabinetry.com' onMouseover=showmenu(event,ad[13])><img src='images/presentedBy/thomasville.gif' border='0' /></a></td>" + 
          "</tr>" + 
		  "<tr>" + 
            "<td><img src='images/shell/shim.gif' width='10' height='5' /></td>" + 
          "</tr>" + 
		  //end sponsor row		 		  
        "</table>" + 
		"")
	}
	
function bannerAd(){
	banner = new Array();
		banner[0] = "/images/banners/ford.gif"
		banner[1] = "/images/banners/0502ba_728x90_genericshop.gif"
		banner[2] = "/images/banners/0502ba_728x90_giftcard.gif"
		banner[3] = "/images/banners/0502ba_728x90_valuectr.gif"
		banner[4] = "/images/banners/ford.gif"
		banner[5] = "/images/banners/ford.gif"
		banner[6] = "/images/banners/ford.gif"
		banner[7] = "/images/banners/anderson_728x90.jpg"
		banner[8] = "/images/banners/behr_banner.jpg"
		banner[9] = "/images/banners/wear_dated_banner.jpg"

	bannerLink = new Array();
		bannerLink[0] = "http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome2"
		bannerLink[1] = "http://www.homedepot.com";
		bannerLink[2] =	"http://www.homedepot.com";
		bannerLink[3] = "http://www.homedepot.com";
		bannerLink[4] = "http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome2"
		bannerLink[5] = "http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome2"
		bannerLink[6] = "http://www.fordvehicles.com/cars/freestyle/index.asp?bannerid=winhome2"
		bannerLink[7] = "http://www.andersonwindows.com"
		bannerLink[8] = "http://www.behr.com"
		bannerLink[9] = "http://www.weardated.com"
	
	randNo = Math.round(Math.random() * (banner.length-1))
		if(randNo == -1){
			randNo = 0;
		}
	document.write("<a href='" + bannerLink[randNo] + "' target=_blank><img src='" + banner[randNo] + "' border=0></a>")
}