//HEADER JS - v3.0 -km 06/2006
var dmn =  'http://' + location.hostname;
var domain = dmn;

var loc = new String(location);

//var ref = document.referrer;

//get rid of this once everything is switched over
var msnTrail = Get_Cookie('msnTrail');

var onLRW = (loc.contains('lifetimetv.com/lrw')||loc.contains('mylifetime.com/lrw'));
var onLMN = (loc.contains('lifetimetv.com/lmn')||loc.contains('mylifetime.com/lmn'));
var onBoards = (loc.contains('boards.lifetimetv.com'));
var onSurvey = (loc.contains('surveyor.lifetimetv.com'));
var onSearch = (loc.contains('googlebot.lifetimetelevision.com'));
var wideSite = false;
var wideSiteImg = "";

var onExternalSite = (		(!location.hostname.contains('lifetimetv.com')) &&
							(!location.hostname.contains('mylifetime.com')) 
							) ? 1 : -1;

//For external sites, make relative links point back to ltv.com
if (onExternalSite==1) { domain="http://www.mylifetime.com" }


//list of sites that need the wide header
var wideSiteList = [
							{ 	
								'site' : '.com/breastcancer',
								'img' : '<a href="/breastcancer/sbcfl.php"><img src="/images/breastcancer/widerightad.jpg" class="widerightimg" border=0 /></a>' 
							},
							{ 	
								'site' : '.com/dreamdecember',
								// 'img' : '<a href="/breastcancer/sbcfl.php"><img src="/images/breastcancer/widerightad.jpg" class="widerightimg" border=0 /></a>' 
                               	'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/games/',
								'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								//'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shows/gaystraightortaken/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/movies/noraroberts/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : 'typepad.com',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : 'norarobertsblog',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : 'bloodblog',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},

							{ 	
								'site' : 'livinghealthy',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shopping/coupons/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shopping/recipes/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : 'spotnora.',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/mobile/index.php',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/mobile/experts.php',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : 'v-click',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shows/bloodties/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/extra/womenofworth/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/endviolence/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/sweeps/bunco/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shows/lisawilliams/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},
							{ 	
								'site' : '.com/shows/armywives/',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							},							
							{ 	
								'site' : 'armyposts.lifetimetv.com',
								//'img' : '<a href="http://www.realarcade.com/gamepass?tps=lifetime_&src=landingpage" target="_blank"><img src="/images/games/widerightad.gif" class="widerightimg" style="border:1px solid #3CB0C0" /></a>' 
								'img' : '<oascall_top2 />'
							}


							];


var wideSiteExceptionList = [
							 { 	
								'site' : '.com/shows/lisawilliams/index.php'
							},
							 { 	
								'site' : '.com/shows/lisawilliams/bio/'
							},
							 { 	
								'site' : '.com/shows/lisawilliams/asklisa/'
							},
							 { 	
								'site' : '.com/shows/lisawilliams/gallery/'
							},
							 { 	
								'site' : '.com/shows/lisawilliams/glossary/'
							},
							{ 	
								'site' : '.com/shopping/itunes/'
							},
							{ 	
								'site' : '.com/shows/bloodties/bloodties.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/rules.html'
							},
							{ 	
								'site' : '.com/sweeps/bunco/prizing.html'
							},
							{ 	
								'site' : '.com/sweeps/bunco/sweepsover.html'
							},
							{ 	
								'site' : '.com/sweeps/bunco/error.html'
							},
							{ 	
								'site' : '.com/sweeps/bunco/thank_you_db.html'
							},
							{ 	
								'site' : '.com/sweeps/bunco/entry.shtml'
							},
							{ 	
								'site' : '.com/sweeps/bunco/storysubmission.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/editorial.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/article.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/cookies.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/cheesecake.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/jicama_salsa.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/fab_themes.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/hosting_bunco.php'
							},
							{ 	
								'site' : '.com/sweeps/bunco/healthful_bunco.php'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/entry.shtml'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/prizing.html'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/thank_you_db.html'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/error.html'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/rules.html'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/photos/'
							},
							{ 	
								'site' : '.com/sweeps/ultimatefamily2007/features/'
							},
							{ 	
								'site' : '.com/shows/armywives/homefront/'
							}
							
							];

//is this a wide site?
for (i=0; i<wideSiteList.length; i++)
{
	//if the location contains one of the url snippets in the list, make it wide!
	if (loc.contains(wideSiteList[i]['site']))
	{
		wideSite = true;
		wideSiteImg = wideSiteList[i]['img'];
		break;
	}
}

for (i=0; i<wideSiteExceptionList.length; i++) {
	if (loc.contains(wideSiteExceptionList[i]['site'])) {
		wideSite = false;
		break;
	}
}

//if on an external site, change all links to www.lifetimetv.com
if ( (onBoards) || (onSurvey) || (onSearch) ) { domain='http://www.mylifetime.com'; }


/*
	This list determines which button is highlighted when you reach a  particular "section." 
	Add urls to each array with a comma and they will be added to that list for that button. -km 6/2006
*/	
var navRules = 
	{		
		'schedule' 		: [ 'lifetimetv.com/shows/tvschedule/' ],
		'movies' 		: [ 'lifetimetv.com/movies/' ],	
		'games' 			: [ 'lifetimetv.com/games/' ],
		'sweeps' 		: [ 'lifetimetv.com/sweeps/' ],
		'video' 			: [ 'lifetimetv.com/videolounge/' ],
		'mobile' 		: [ 'lifetimetv.com/mobile/' ],
		'shop' 			: [ 'lifetimetv.com/shopping/' ],
		'boards' 		: [ 'boards.lifetimetv.com/' ],
		'diethealth' 	: [ 'lifetimetv.com/reallife/health/' ],	
		'lovesex' 		: [ 'lifetimetv.com/reallife/relation/'],
		'astrology' 		: [ 'lifetimetv.com/astro/' ]
	};

//find out what the highlighted button should be
var navButton = getTopNavState(); //'movies';	
var hdrTabsPath = domain + '/images/common/headertabs/';

var headerHTML = [];	
	
//ADVERTISEMENT
if (wideSite)
{
	var oastag2 = '<div id="companionad_Top2"><script>OAS_AD("Top2")</script></div>';
	
	if (wideSiteImg.contains('oascall'))
	{
		wideSiteImg = oastag2;
	}
	
	headerHTML.push(
		'<div id="adcontainer">',
		'<table cellpadding=0 cellspacing=0 width="988" height="100" id="adtable">',
		'	<tr valign="middle">',
		'		<td width="746" align="center"><div id="companionad_Top1"><script>OAS_AD("Top1")</script></div></td>',
		'		<td width="2" bgcolor="#FFFFFF"><spacer type="block" height="1" width="2" /></td>',
		'		<td width="240" align="center" bgcolor="#CCCCCC">'+wideSiteImg+'</td>',
		'	<tr>',
		'</table>',
		'<\/div>',
		'<div id="navdivider"><\/div>'
	);
}
else
{
	headerHTML.push(
		'<div id="adcontainer">',
		'<table cellpadding=0 cellspacing=0 id="adtable">',
		'	<tr>',
		'		<td class="adcol1"><div id="companionad_Top1"><script>OAS_AD("Top1")</script></div></td>',
		'	<tr>',
		'</table>',
		'<\/div>',
		'<div id="navdivider"><\/div>'
	);
	//var ls = new String(location.search);
	//if (ls.contains('debug')) { alert(headerHTML.join('\n')); }
}

//NAVIGATION
headerHTML.push(
	'<div id="menu">',
	'	<h1><a href="<%domain%>/index.php" name="&lid=Lifetime+Television&lpos=header"><img src="<%domain%>/images/common/hdr_logo_ani.gif" alt="My story on Lifetime" title="My story on Lifetime" border="0" /></a><\/h1>',
	'	<ul id="nav">',
	'	  <li><a href="<%tvschedulelink%>" class="btn1" name="&lid=Schedule&lpos=header"><img src="<%domain%>/images/common/headertabs/schedule_off.gif" name="tab_schedule" alt="Schedule" title="Schedule" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/movies/index.php" class="btn2" name="&lid=Movies&lpos=header"><img src="<%domain%>/images/common/headertabs/movies_off.gif" name="tab_movies" alt="Movies" title="Movies" border="0" /><\/a><\/li>',
	'	  <li><a href="javascript:launchVideoLounge()" class="btn3" name="&lid=Video&lpos=header"><img src="<%domain%>/images/common/headertabs/video_off.gif" name="tab_video" alt="Video" title="Video" border="0" /><\/a><\/li>',
	'	  <li><a href="http://boards.lifetimetv.com/" class="btn4" name="&lid=Boards&lpos=header"><img src="<%domain%>/images/common/headertabs/boards_off.gif" name="tab_boards" alt="Boards" title="Boards" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/reallife/health/index.html" class="btn5" name="&lid=Diet+and+Health&lpos=header"><img src="<%domain%>/images/common/headertabs/diethealth_off.gif" name="tab_diethealth" alt="Diet & Health" title="Diet & Health" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/reallife/relation/index.html" class="btn6" name="&lid=Love+and+Sex&lpos=header"><img src="<%domain%>/images/common/headertabs/lovesex_off.gif" name="tab_lovesex" alt="Love & Sex" title="Love & Sex" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/astro/index.html" class="btn7" name="&lid=Astrology&lpos=header"><img src="<%domain%>/images/common/headertabs/astrology_off.gif" name="tab_astrology" alt="Astrology" title="Astrology" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/games/index.php" class="btn8" name="&lid=Games&lpos=header"><img src="<%domain%>/images/common/headertabs/games_off.gif" name="tab_games" alt="Games" title="Games" border="0" /><\/a><\/li>',		
	'	  <li><a href="<%domain%>/sweeps/index.html" class="btn9" name="&lid=Sweeps&lpos=header"><img src="<%domain%>/images/common/headertabs/sweeps_off.gif" name="tab_sweeps" alt="Sweeps" title="Sweeps" border="0" /><\/a><\/li>',  
	'	  <li><a href="<%domain%>/mobile/index.php" class="btn10" name="&lid=Mobile&lpos=header"><img src="<%domain%>/images/common/headertabs/mobile_off.gif" name="tab_mobile" alt="Mobile" title="Mobile" border="0" /><\/a><\/li>',
	'	  <li><a href="<%domain%>/shopping/index.php" class="btn11" name="&lid=Shop&lpos=header"><img src="<%domain%>/images/common/headertabs/shop_off.gif" name="tab_shop" alt="Shop" title="Shop" border="0" /><\/a><\/li>',
	'	<\/ul>',
	'<\/div>',
	'<script type="text/javascript">setTopNavState();<\/script>',
	'<div id="navdivider2"><\/div>'
);

//PERSONALIZATION

headerHTML.push(
	'<div id="subnav">',
	'	<ul id="member_options">',
	'		<li class="personalization"><%personalization%><\/li>',
	'		<li class="memberlink">| <%accessmsg%><\/li>',
	'		<li class="memberlink">| <%action%><\/li>',
	'	<\/ul>',
	'	<form name="gs" method="GET" action="http://googlebot.lifetimetelevision.com/search" onSubmit="if((this.q.value==\'<%searchstr%>\')||(this.q.value==\'\')){return false;}" class="formstyle">',
	'		<div id="searchbox">',
	'			<input value="date:D:L:d1" name="sort" type="hidden">',
	'			<input value="xml_no_dtd" name="output" type="hidden">',
	'			<input value="lifetimetv" name="site" type="hidden">',
	'			<input value="UTF-8" name="ie" type="hidden">',
	'			<input value="UTF-8" name="oe" type="hidden">',
	'			<input value="<%googlexsl%>" name="client" type="hidden">',
	'			<input value="<%googlexsl%>" name="proxystylesheet" type="hidden">',
	'			<input type="text" id="searchterm" name="q" size="22" value="<%searchstr%>" onclick="if(this.value==\'<%searchstr%>\'){this.value=\'\'}" />',
	'			<input type="image" id="go" name="Go" src="<%domain%>/images/common/hdr_btn_go.gif" />',
	'		<\/div>'	,
	'	<\/form>',
	'	<div id="widerightshim"></div>',
	'	<form name="showsform" class="formstyle">',
	'		<select id="pulldown" name="showlist" onChange="changeURL(this)">',
	'			<option>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- Shows -- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/option>',
	'			<%pulldown%>',
	'		<\/select>',
	'	<\/form>',
	'<\/div>',
	'<div id="navdivider3"><\/div>'
);

//run thru rules, find out what the right button to highlight is
function getTopNavState()
{
	var loc = new String(location);
	var btnName = new String();
	
	for (btn in navRules)
	{
		var thisURLList = navRules[btn];
		
		for (i=0;i<thisURLList.length;i++)
		{
			if (loc.indexOf(thisURLList[i])!=-1)
			{
				btnName = btn;
				break;
			}
		}
	}

	return btnName;
}		

//set that button to be the active button
function setTopNavState()
{
	if (typeof(navButton)!="undefined" && navButton!="")
	{
		document.images['tab_'+navButton].src = hdrTabsPath + navButton + '_on.gif';
	}
}		

function drawHeader_old()
{	
	//configure member links messages
	var memberlinks = {
		'loggedOut' : 
			{
			'personalization'		: 'Become a Member!', 
			'accessmsg' 			: '&nbsp; <a href="<%domain%>/community/members/member_intro.html?rsrc=sn" title="Register Now">Register Now<\/a>',
			'action' 					: '&nbsp; <a href="<%domain%>/cgi/community/members/authentication.pl" title="Log In">Log In<\/a>'
			},
						
		'loggedIn' : 
			{
			'personalization'		: 'Welcome, <%username%>',
			'accessmsg' 			: '&nbsp; <a href="<%domain%>/community/members/exclusive/index.php" title="Member Center">Member Center<\/a>',
			'action' 					: '&nbsp; <a href="<%domain%>/cgi/community/members/authentication.pl?lg_action=reset_lc" title="Log Out">Log Out<\/a>'
			}
	}
	
	var pulldown = new String();
	
	//this fills in the pulldown html
	for (obj in headerLinks)
	{
		if (headerLinks[obj]['label'] == '')
		{
			var optionTmpl = new Class_HTMLTemplate(['<option>'+divider+'<\/option>']);
		}
		else 
		{
			var optionTmpl = new Class_HTMLTemplate(['<option value="<%domain%><%linkurl%>"><%linklabel%><\/option>']);
			optionTmpl.addParams( { 'domain' : domain, 'linkurl' : headerLinks[obj]['url'], 'linklabel' : headerLinks[obj]['label'] } );
		}
		optionTmpl.fillTemplate();
		pulldown+=optionTmpl.text;
	}
	
	//different OAS position call for different sites
	var oastag = ( onLMN || onLRW ) ? 
		'<div id=\'companionad_Top1\'><script>OAS_AD(\'Top\')<\/script><\/div>' :  '<div id=\'companionad_Top1\'><script>OAS_AD(\'Top1\')<\/script><\/div>';
		
	var oastag2 = '<div id=\'companionad_Top2\'><script>OAS_AD(\'Top2\')<\/script><\/div>';

	//run thru each line in the headerHTML and make substitutions where necessary
	for (line in headerHTML)
	{
		if (headerHTML[line].contains('<oascall_top1')) 
		{ 
			document.write(oastag); 
		}
		
		if (headerHTML[line].contains('<oascall_top2')) 
		{ 
			document.write(oastag2); 
		}
		
		//added this bit in to deal with mac IE problems. - TFC 05/25/05
		if (line == 'push')  { headerHTML[line] = ''; }
		
		//search and replace thru a template class
		var l = new Class_HTMLTemplate([headerHTML[line]]);

		l.addParams(
			{ 
			//Change link content based on login state
			'personalization' :  
				(userProfile['loggedIn']==1) ? memberlinks['loggedIn']['personalization'] : memberlinks['loggedOut']['personalization'],
			'accessmsg' : 
				(userProfile['loggedIn']==1) ? memberlinks['loggedIn']['accessmsg'] : memberlinks['loggedOut']['accessmsg'],
			'action' : 
				(userProfile['loggedIn']==1) ? memberlinks['loggedIn']['action'] : memberlinks['loggedOut']['action'],
				
			'domain' : (onBoards || onSurvey || onSearch) ? 'http://www.lifetimetv.com' : domain,
			'tvschedulelink' : 'javascript:location=\''+domain+getTVScheduleLink()+'\'',
			'pulldown' : pulldown,
			'searchstr' : ' SEARCH',
			'googlexsl' : 'ltv_frontend', //(dev) ? 'http://www.lifetimetv.com/google/google_ltv_dev.xsl' : 'ltv_frontend',
			'username' : userProfile['firstname']
			//'widerightad' : wideSiteImg
			}
		);
		
		//replace tokens
		l.fillTemplate();
		
		//once the sub-ins are done, print the line of HTML to the browser
		l.printTemplate();
	}		
	
	//hacks for safari
	if (is_safari)
	{
		//searchbox
		document.getElementById("searchterm").style.height = "17px";
	}
	
	/* everything below this line is for our site which has the wrong doctype (none) right now.
	*
	*	This is the doctype we need:
	*	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	*	<html xmlns="http://www.w3.org/1999/xhtml">
	*/

	if (is_fox || is_ie && is_win)
	{
		document.getElementById("searchterm").style.height = "17px";
	}

	if (is_fox && is_win)
	{
		document.getElementById("adcontainer").style.width = "758px";
		document.getElementById("menu").style.width = "758px";
		document.getElementById("subnav").style.width = "758px";
	}
	//for ie 7. ugh
	if (is_ie || agt.contains('msie 7'))
	{
		document.getElementById("adcontainer").style.width = "760px";
		document.getElementById("menu").style.width = "760px";
		document.getElementById("subnav").style.width = "760px";
		document.getElementById("searchterm").style.height = "17px";
	}

	/*** WIDE SITE RULES ***/

	//these are the rules for adjusting the header to the wider version (990px)
	if (wideSite)
	{
		//stretch all rows
		document.getElementById('adcontainer').style.width = "988px";
		document.getElementById('menu').style.width = "988px";
		document.getElementById('navdivider').style.width = "990px";
		document.getElementById('navdivider2').style.width = "990px";
		document.getElementById('navdivider3').style.width = "990px";
		document.getElementById('subnav').style.width = "988px";
		document.getElementById("searchterm").style.height = "13px";
		
		if (is_safari)
		{
			//searchbox
			document.getElementById("searchterm").style.height = "17px";
		}
		
		if (is_fox && is_win)
		{
			document.getElementById("adcontainer").style.width = "988px";
			document.getElementById("menu").style.width = "988px";
			document.getElementById("subnav").style.width = "988px";
		}
		
		if (is_ie || agt.contains('msie 7'))
		{
			document.getElementById("adcontainer").style.width = "988px";
			document.getElementById("menu").style.width = "988px";
			document.getElementById("subnav").style.width = "988px";
		}

		if (is_safari)
		{
			document.getElementById("adtable").style.height = "107px";
		}
	}
}
drawInHead();
