//for setting the form value to what is in the Q parameter on the querystring...
var searchKeyword = queryString("q");
if (searchKeyword == undefined)	//if it is undefined, set it to nothing
	{searchKeyword = "";}

//variables to change between G and C.
var pname	= window.location.pathname.toLowerCase();
var pURL	= window.location.href.toLowerCase();
var baseURL	= "http://www.cdw.com"
var pageLogo	= "http://img.cdw.com/assets/pages/framework/top_logo.gif";
var LogoAlt	= "CDW";
var printLogo	= "http://img.cdw.com/global/logos/cdw/cdw_printablepage_logo.gif";
var pagePhone	= "800.750.4239";
var searchURL	= "/Search_c.aspx";
var activeSite	= "c";

//Set all the CDWG Specific parameters for the framework
if (pURL.indexOf("cdwg.com",0) >= 1) 
{
	pageLogo	= "http://img.cdw.com/assets/pages/framework/top_logo_g.gif";
	printLogo	= "http://img.cdw.com/global/logos/cdwg/cdwgprint.gif";
	LogoAlt		= "CDWG";
	pagePhone	= "800.750.4239";
	activeSite	= "g";
	searchURL	= "/Search_g.aspx";
	baseURL	= "http://www.cdwg.com"
}

//Grab a specific parameter from the querysting.
function queryString(fieldName) 
{
	qs = window.location.search.substring(1);	//qs = querystring
	pl = qs.split("&");							//pl = parameter list
	for (i=0;i<pl.length;i++) 
	{
		cp = pl[i].split("=");					//cp = current paramater
		if (cp[0].toLowerCase() == fieldName.toLowerCase()) 
		{
			return unescape(cp[1]);
		}
	}
}
//write out the CSS files...	
document.write("\<link href='/Main.css' rel='stylesheet' type='text/css'>");
document.write("\<link href='/Printable.css' rel='stylesheet' type='text/css'>");
document.write("\<link href='http://www.cdw.com/content/FooterPages.css' rel='stylesheet' type='text/css'>");

//write out the JS files...
document.write("\<script language='javascript' type='text/javascript' src='/global/gui/javascript/glwindow.js'>\</script\>");
document.write("\<script language='javascript' type='text/javascript' src='/browser.js'>\</script\>");
document.write("\<script language='javascript' type='text/javascript' src='/cm/v40/eluminate.js'>\</script\>");
document.write("\<script language='javascript' type='text/javascript' src='/cm/cmdatatagutils.js'>\</script\>");

//Write the printable header...
document.write('<div class="printable">');
	document.write('<table border="0" summary="table for printable page header">');
		document.write('<tr>');
			document.write('<td align="left"><img src="' + printLogo + '" border="0" alt="' + LogoAlt + '" /></td>');
			document.write('<td align="right" valign="middle" nowrap width="100%"><strong><font size=3 face="verdana,helvetica,arial" color="#000000">' + pagePhone + '</font></strong></td>');
		document.write('</tr>');
	document.write('</table>');
document.write('</div>');

//write the main header...
	document.write('<div class="shadow1">');
		document.write('<div class="shadow2">');
			document.write('<div class="shadow3">');
				// WRAPPER 
				document.write('<div class="wrapper">');
					// GLOBAL NAV
					document.write('<div class="globalNav webOnly" style="text-align: left;">');
						document.write('<ul>');

							if (activeSite == "c") 
							{
								document.write('<li class="selected"><a href="http://www.cdw.com/">CDW</a></li>');
								document.write('<li><a href="http://www.cdwg.com/">CDW-G</a></li>');
							}
							else  //CDWG
							{
								document.write('<li><a href="http://www.cdw.com/">CDW</a></li>');
								document.write('<li class="selected"><a href="http://www.cdwg.com/">CDW-G</a></li>');
							}

							document.write('<li style="border-right:1px solid #ccc;"><a href="http://www.cdw.ca/">CDW Canada</a></li>');
							document.write('<li>' + pagePhone + '</li>');
							document.write('<li class="shopCDW"><a href="' + baseURL + '">Shop CDW</a></li>');
						document.write('</ul>');
					document.write('</div>');
					// END GLOBAL NAV
					
					// HEADER
					if (activeSite == "c") 
						{	document.write('<div class="header webOnly">');	}
					else	//CDWG
						{	document.write('<div class="header" style="background:#cc0000 url(http://img.cdw.com/assets/pages/framework/red_trim_g.gif) repeat-x; ">');	}
					
						document.write('<img style="position:absolute; top:8px; left:0px;" src="' + pageLogo + '" width="276" height="69" border="0" alt="' + LogoAlt + '" /><br />');
						document.write('<ul>');
							document.write('<li><a href="' + baseURL + '/content/about/default.asp">About CDW</a></li>');
							document.write('<li><a href="' + baseURL + '/content/careers/default.asp">Careers</a></li>');
							document.write('<li><a href="/default.htm" style="background:#585147 url(http://img.cdw.com/global/corp-header/topNavOn_bg.gif) repeat-x;">Newsroom</a></li>');
							document.write('<li><a href="' + baseURL + '/content/terms-conditions/default.asp">Terms and Conditions</a></li>');
							document.write('<li style="border:none; margin:0px;"><a href="' + baseURL + '/content/contact-us/default.asp">Contact Us</a></li>');
						document.write('</ul>');
					document.write('</div>');
					// END HEADER
					
					document.write('<table width="100%" cellspacing="0" cellpadding="0" border="0">');
						document.write('<tr>');
							document.write('<td class="webOnly" width="161" valign="top" style="padding:19px 12px;" >');

							// COLUMN 1:  LEFT SIDE NAV
								document.write('<div class="leftnav">');
									document.write('<ul>');
										document.write('<img src="http://img.cdw.com/content/newsroom/lnav-newsroom.gif" border="0" alt="" /><br />');
										
										//Determine the current section and highlight the appropriate link in the left nav menu...
										//Newsroom laning page
										if (document.location.pathname == "/" || document.location.pathname == "/default.htm") 
											{	document.write('<li class="selected">Newsroom Home</li>');	}
										else
											{	document.write('<li><a href="/">Newsroom Home</a></li>');	}
										
										//News-Release section...
										if (pname.indexOf("/news-releases/",0) >= 0) 
											{	document.write('<li class="selected">News Releases</li>');	}
										else
											{	document.write('<li><a href="/news-releases/">News Releases</a></li>');	}
										
										//Features section...
										if (pname.indexOf("/features/",0) >= 0) 
											{	document.write('<li class="selected">Features</li>');	}
										else
											{	document.write('<li><a href="/features/">Features</a></li>');	}
										
										//Executives section...
										if (pname.indexOf("/executives/",0) >= 0) 
											{	document.write('<li class="selected">Executives</li>');	}
										else
											{	document.write('<li><a href="/executives/">Executives</a></li>');	}
											
										//Resource Center section...
										if (pname.indexOf("/resourcecenter/awards/",0) >= 0) 
											{	document.write('<li class="selected">Awards</li>');	}
										else
											{	document.write('<li><a href="/resourcecenter/awards/">Awards</a></li>');	}
										
										//Ask the Experts section...
										if (pname.indexOf("/asktheexpert/",0) >= 0) 
										{	document.write('<li class="selected">Ask Experts</li>');	}
										else
											{	document.write('<li><a href="/asktheexpert/">Ask Experts</a></li>');	}
										
										//Company Information section...
										if (pname.indexOf("/journalistinformation/",0) >= 0) 
											{	document.write('<li class="selected">Company Information</li>');	}
										else
											{	document.write('<li><a href="/journalistinformation/">Company Information</a></li>');	}
										
									document.write('</ul>');
								document.write('</div>');
							// END COLUMN 1:  LEFT SIDE NAV
							document.write('</td>');
							document.write('<td valign="top" align="center" style="padding:13px 26px 0px 0px;">');
							// COLUMN 2:  MAIN BODY CONTENT

//Print This Page function moved from footer
if (pname.indexOf(".",0) < 1) 
{	pname = window.location.pathname + 'default.htm';	}
	//write the print button...
	document.write('<a href="javascript:window.print()">' +
		'<img src="/images/printpage.gif" alt="Print This Page" border="0" vspace="5" align="right" />' +
		'</a><br clear=all />');

	//form posting to search engine. Required
	document.write('<form action="' + searchURL + '" method="get" ID="Form1">');
		document.write('<table width="600" border="0" cellspacing="0" cellpadding="0" ID="Table1">');
			document.write('<tr>');
				document.write('<td width="7" colspan="4"><img src="/images/spacer.gif" height="7" alt=""></td>');
			document.write('</tr>');
			document.write('<tr>');
				document.write('<td width="7" rowspan="2"><img src="http://img.cdw.com/cdw/NewsRoom/banner_01.gif" width="7" height="91" alt=""></td>');
				document.write('<td align="left" bgcolor="#B4AD9A"><img src="http://img.cdw.com/cdw/NewsRoom/banner_02.gif" width="136" height="27" alt=""></td>');
				document.write('<td width="7" rowspan="2"><img src="http://img.cdw.com/cdw/NewsRoom/banner_04.gif" width="7" height="91" alt=""></td>');
				document.write('<td width="200" rowspan="2"><img src="http://img.cdw.com/cdw/NewsRoom/banner_05.jpg" width="200" height="91" alt=""></td>');
			document.write('</tr>');
			document.write('<tr>');
				document.write('<td bgcolor="#B4AD9A">');
					document.write('<table cellpadding="0" cellspacing="0" border="0" ID="Table2">');
						document.write('<tr>');
							document.write('<td rowspan="2"><img src="http://img.cdw.com/cdw/NewsRoom/spacer.gif" width="23" height="64" alt=""></td>');
							document.write('<td><img src="http://img.cdw.com/cdw/NewsRoom/banner_07.gif" alt="Search here for the latest news and technology information."></td>');
						document.write('</tr>');
						document.write('<tr>');
							document.write('<td>');
								document.write('<input name="from" type="hidden" value="newsroom" ID="Hidden1"/ >');
								document.write('<input name="q" type="text" size="20" value="' + searchKeyword + '" maxlength="50" ID="Text1"/ >');
								document.write('<input type="image" src="http://img.cdw.com/cdw/NewsRoom/banner_go.gif" ID="Image1" NAME="Image1"/>');
							document.write('</td>');
						document.write('</tr>');
					document.write('</table>');
				document.write('</td>');
			document.write('</tr>');
		document.write('</table>');
	document.write('</form>');
	//form posting to search engine. Required