// footer include file: Matt

/////////////////////////////// JS FUNCTIONS: RONK /////////////////////////////////
//////////// Email Deals form functions: Ron
//////////// Betsy Bury 02/11/09: Enhanced edits within function  
//////////// Betsy Bury 02/11/09: Enhanced edits within function
function subscribePg(form)
{
 var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
	if (!emailfilter.test(form.email.value))
	{
		alert("Please enter a valid email address");
		return false;
	}
	else if ((form.zipcode.value != "") && (form.zipcode.value != "ZipCode") && (form.zipcode.value.length < 5))
		{
		alert("Please enter a valid 5 digit US ZipCode \n or a valid Canadian ZipCode \n or leave blank");
		return false;
		}
		else if ((form.zipcode.value != "") && (form.zipcode.value != "ZipCode") && (form.zipcode.value.length == 5) && (isNaN(stringTrim(form.zipcode.value))))
		{
		alert("Please enter a valid 5 digit US ZipCode\n or a valid Canadian ZipCode\n or leave blank");
		return false;
		}

	//Get datestamp: Ron
	datetoday = new Date();
	var datestring;
	var month = datetoday.getMonth()+1;
	if (month < 10) { month = '0' + month; }
	var day = datetoday.getDate();
	if (day < 10) { day = '0' + day; }
	var year = datetoday.getFullYear();
	datestring = month + '/' + day + '/' + year;

	//Load variables with form field values
	var emailName = stringTrimL(form.email.value);
	var fName = stringTrimL(form.firstname.value);
	var zCode = stringTrimL(form.zipcode.value);
	location.href = 'http://newsletter.northerntool.com/subscription.jsp?eMail=' + emailName + '&fName=' + fName + '&zip=' + zCode + '';
	return false;
}

/* String Trim Right function removes any whitespace (spaces, tabs, and line breaks) using Reg Expression from the
ending of a String and replaces them with nothing */
function stringTrimR(strToTrim) {
	return(strToTrim.replace(/\s+$/g, ''));
}

/* String Trim Left function removes any whitespace (spaces, tabs, and line breaks) using Reg Expression from the
beginning of a String and replaces them with nothing */
function stringTrimL(strToTrim) {
	return(strToTrim.replace(/^\s+/g, ''));
}

/* String Trim removes any whitespace (spaces, tabs, and line breaks) using Reg Expression from the
beginning and ending of a String and replaces them with nothing */
function stringTrim(strToTrim) {
	return(strToTrim.replace(/^\s+|\s+$/g, ''));
}
//////////// End - Email Deals form functions //////////////////

/////////////////////////// END OF FUNCTIONS /////////////////////////////////

//document.write('</td></tr></table>');

document.write('</center></div><div id="footerWrapper"><div style="width:996;height:28px;background:url('+imageServer+'/images/footer/bottom-1024.jpg) center no-repeat;margin:0 auto;"></div>');

// email sign-up test begin: matt

document.write('<!-- mbox begin -->');
document.write('<div class="mboxDefault">');
	// email deals sign up
	document.write('<div id="footer-bar" style="margin:0 auto;">');
		document.write('<div id="email-deals">');
		document.write('<a href="'+ServerHTTP+'/emaildeals/"><img src="'+imageServer+'/images/footer/email-deals-text.gif" alt="Email Deals | Weekly Exclusives, Sales + Specials"/></a>');
		document.write('<form action="http://newsletter.northerntool.com/subscription.jsp?" name="EmailSubscribe" method="get" onSubmit="return subscribePg(this)">');
			document.write('<input type="text" name="email" maxlength="60" value="Email Address" class="text-input" style="width:180px;">');
			document.write('<input type="text" name="firstname" maxlength="25" VALUE="First Name" class="text-input" style="width:80px;">');
			document.write('<input type="text" name="zipcode" maxlength="7" VALUE="ZipCode" class="text-input" style="width:60px;">');
			document.write('<input type="image" src="'+imageServer+'/images/footer/signup-new.gif" alt="Sign Up"/>');
		document.write('</form>');
		document.write('</div>');
	document.write('</div>');
document.write('</div>');

mboxCreate('Footer_EmailSignUpTest');
document.write('<!-- mbox end -->');
// email sign-up test end: matt

focusfix(".text-input", "focused");

// bottom text links
document.write('<table align="center" border="0" cellpadding="0" cellspacing="0" width="766"><tr><td><tr><td><table cellpadding="0" cellspacing="0" width="766" border="0"><tr>');

document.write('<td valign="top"><div class="footerContainer"><img src="'+imageServer+'/images/footer/text-header-1.gif" width="171" height="20" alt="Leader Since 1981"><div class="linkList"><ul>');
document.write('<li><a href="'+ServerHTTP+'/companyinfo/?cm_sp=Global%20Footer-_-Since%201981-_-Company%20Info" rel="nofollow">Company Info</a></li>');
document.write('<li><a href="'+ServerHTTP+'/affiliates/?cm_sp=Global%20Footer-_-Since%201981-_-Affiliates" rel="nofollow">Affiliates</a></li>');
document.write('<li><a href="'+ServerHTTP+'/careers/?cm_sp=Global%20Footer-_-Since%201981-_-Careers" rel="nofollow">Careers</a></li>');
document.write('<li><a href="'+ServerHTTP+'/gov/?cm_sp=Global%20Footer-_-Since%201981-_-Government">Government</a></li>');
document.write('<li><a href="'+ServerHTTP+'/?cm_sp=Global%20Footer-_-Since%201981-_-Home">Home</a></li>');
document.write('</ul></div></div></td>');

document.write('<td valign="top"><div class="footerContainer"><img src="'+imageServer+'/images/footer/text-header-2.gif" width="171" height="20" alt="Secure Shopping"><div class="linkList"><ul>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/privacypolicy.htm?cm_sp=Global%20Footer-_-Secure%20Shopping-_-Privacy%20Policy" rel="nofollow">Privacy Policy</a></li>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/ordersecurity.htm?cm_sp=Global%20Footer-_-Secure%20Shopping-_-Order%20Security" rel="nofollow">Order Security</a></li>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/terms.htm?cm_sp=Global%20Footer-_-Secure%20Shopping-_-Terms%20Conditions" rel="nofollow">Terms + Conditions</a></li>');
document.write('<li><a href="'+ServerHTTP+'/promotions/lowestprice/lowestpriceguarantee.htm?cm_sp=Global%20Footer-_-Secure%20Shopping-_-Lowest%20Price%20Guarantee" rel="nofollow">Lowest Price Guarantee</a></li>');
document.write('<li><a href="'+ServerHTTP+'/sitemap.htm?cm_sp=Global%20Footer-_-Secure%20Shopping-_-Site%20Map">Site Map</a></li>');
document.write('</ul></div></div></td>');

document.write('<td valign="top"><div class="footerContainer"><img src="'+imageServer+'/images/footer/text-header-3.gif" width="171" height="20" alt="My Account"><div class="linkList"><ul>');
document.write('<li><a href="'+ServerHTTP+'/webapp/wcs/stores/servlet/OrderStatusInquiry?storeId=6970&cm_sp=Global%20Footer-_-My%20Account-_-Order%20Status" rel="nofollow">Order Status</a></li>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/orderandpayment.htm?cm_sp=Global%20Footer-_-My%20Account-_-Order%20Payment" rel="nofollow">Order + Payment</a></li>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/shipping.htm?cm_sp=Global%20Footer-_-My%20Account-_-Shipping%20Delivery" rel="nofollow">Shipping + Delivery</a></li>');
document.write('<li><a href="'+ServerHTTP+'/custhelp/?cm_sp=Global%20Footer-_-My%20Account-_-Help" rel="nofollow">Help</a></li>');
document.write('<li><a href="'+ServerHTTP+'/contactus/?cm_sp=Global%20Footer-_-My%20Account-_-Contact%20Us" rel="nofollow">Contact Us</a></li>');
document.write('</ul></div></div></td>');

document.write('<td valign="top"><div class="footerContainer lastContainer"><img src="'+imageServer+'/images/footer/text-header-4.gif" width="171" height="20" alt="Northern Sites"><div class="linkList"><ul>');
document.write('<li><a href="http://racing.northerntool.com/?cm_sp=Global%20Footer-_-Northern%20Sites-_-NASCAR%20Racing">NASCAR Racing</a></li>');
document.write('<li><a href="http://www.kotulas.com/?cm_sp=Global%20Footer-_-Northern%20Sites-_-Gifts%20Gadgets" target="_blank">Gifts + Gadgets</a></li>');
document.write('<li><a href="http://projects.northerntool.com/?cm_sp=Global%20Footer-_-Northern%20Sites-_-Project%20Communities">Project Communities</a></li>');
document.write('<li><a href="http://www.northerntooluk.com/?cm_sp=Global%20Footer-_-Northern%20Sites-_-United%20Kingdom">United Kingdom</a></li>');
document.write('<li><a href="'+ServerHTTP+'/espanol/ventas.htm?cm_sp=Global%20Footer-_-Northern%20Sites-_-Espanol">Espa&#241;ol</a></li>');
document.write('</ul></div></div></td>');

document.write('</tr></table><div class="clearer"></div></td></tr>');

// order info
document.write('<tr><td><table cellpadding="0" cellspacing="0" border="0"><tr><td id="ccContainer" valign="top"><img style="margin-bottom:13px;" src="'+imageServer+'/images/footer/order-info.gif" alt="Buy Online or Call 1-800-221-0516"/><br/><img src="'+imageServer+'/images/footer/creditcards.gif" width="351" height="25" alt="Visa, MasterCard, Discover, American Express, SmartPay, Northern Power Card, Northern Net 30 Card, Northern Gift Card"><img style="margin: 0 0 1px 7px;" src="https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif" width="37" height="23" alt="We Accept PayPal"></td><td id="yearsinbusinessContainer"><a href="/companyinfo/"><img src="'+imageServer+'/images/footer/28-years-in-business.gif" width="99" height="80" alt="28 Years in Business!"></a></td><td width="20">&nbsp;</td><td id="mcafeeContainer"><!-- START SCANALERT CODE --><a target="_blank" href="https://www.mcafeesecure.com/RatingVerify?ref=63.225.137.160"><img width="65" height="37" border="0" src="//images.scanalert.com/meter/63.225.137.160/63.gif" alt="McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams" oncontextmenu="alert(\'Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.\'); return false;"></a><!-- END SCANALERT CODE --></td><td width="20">&nbsp;</td><td id="verisignContainer"><a href="https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.NORTHERNTOOL.COM&lang=en" target="_blank"><img src="'+imageServer+'/images/footer/verisignseal.gif" width="99" height="80" alt="Click to Verify" border="0"></a></td></tr></table></td></tr>');

// copyright info
document.write('<tr><td align="left"><div class="copyright" style="text-align:left;">Copyright &#169; 1996 &#150; 2009 Northern Tool + Equipment Catalog Co. All Rights Reserved.</div></td></tr></table></td></tr></table></div>');