var lang = "en";

if (get_cookie("hhLanguage") != lang) {
	delete_cookie("hhLanguage");
	var expire = new Date();
	expire.setTime( expire.getTime() + 31536000000 );
	document.cookie = "hhLanguage="+lang+";path=/;expires="+expire.toGMTString(); 
}

var pricingPopupText = '<div title="About Prices" id="pricingPopup" style="display:none;"><p>Prices shown do not include taxes. While every effort is made to maintain prices shown, we reserve the right to adjust prices when necessary and also to substitute or discontinue any item which may become unavailable. </p>\
						<p>Prices shown are by the geographical area in which the store is located and are based on delivery at our store. In Northern and remote areas, there may be an additional charge to cover freight. Pricing at stores may vary slightly based on store location and market conditions.</p>\
						</div>';
var eFlyerPopupText = 	'<p>Find your eFlyer by selecting your preferred Home Store. Already have an account? <a href="#">Sign in</a></p>'+
						'<div><form id="postalCodeForm" method="post" action="/en/index/store-locator.htm"><label>Enter your postal code<br /><input type="text" name="postalcode" /></form></div>'+
						'<a id="findstoreeflyer" class="button with-arrow" href="#"><span class="first-child"><span class="inner">FIND STORE</span></span></a><a class="closelink" href="#">Cancel and close</a>';
var noeFlyerPopupText = '<p>There is currently no eFlyer for your Home Store.</p>'+
						'<p><a href="#">Why not look through our catalogs instead?</a></p>';
						
var commonStrings = {
	quantity:'Quantity: ',
	displaying:'Displaying'
};


var measurePopup = '<div id="measurementPopup" title="Units of measure"><table><thead><tr><th scope="col">Abbreviation</th><th scope="col">Label</th><th class="empty">&nbsp;</th><th scope="col">Abbreviation</th><th scope="col">Label</th><th class="empty">&nbsp;</th><th scope="col">Abbreviation</th><th scope="col">Label</th></tr></thead><tr><td>AS</td><td>Assortment</td><td class="empty">&nbsp;</td><td>KT</td><td>Kit</td><td class="empty">&nbsp;</td><td>BD</td><td>Bundel</td></tr><tr><td>LB</td><td>Pound</td><td class="empty">&nbsp;</td><td>BG</td><td>Bag</td><td class="empty">&nbsp;</td><td>LG</td><td>Length</td></tr><tr><td>BX</td><td>Box</td><td class="empty">&nbsp;</td><td>LR</td><td>Litre</td><td class="empty">&nbsp;</td><td>CD</td><td>Card</td></tr><tr><td>PA</td><td>Pail</td><td class="empty">&nbsp;</td><td>CF</td><td>Hundred Feet</td><td class="empty">&nbsp;</td><td>PD</td><td>Pad</td></tr><tr><td>CFT</td><td>Cubic Feet</td><td class="empty">&nbsp;</td><td>PK</td><td>Pack</td><td class="empty">&nbsp;</td><td>CL</td><td>Coil</td></tr><tr><td>PR</td><td>Pair</td><td class="empty">&nbsp;</td><td>CN</td><td>Can</td><td class="empty">&nbsp;</td><td>PRS</td><td>Paris</td></tr><tr><td>CS</td><td>Case</td><td class="empty">&nbsp;</td><td>RL</td><td>Roll</td><td class="empty">&nbsp;</td><td>CT</td><td>Carton</td></tr><tr><td>SF</td><td>Square Foot</td><td class="empty">&nbsp;</td><td>DS</td><td>Display</td><td class="empty">&nbsp;</td><td>SQ</td><td>Hundred Square</td></tr><tr><td>EA</td><td>Each</td><td class="empty">&nbsp;</td><td>ST</td><td>Set</td><td class="empty">&nbsp;</td><td>FT</td><td>Foot</td></tr><tr><td>SY</td><td>Square Yard</td><td class="empty">&nbsp;</td><td>JR</td><td>Jar</td><td class="empty">&nbsp;</td><td>YD</td><td>Yard</td></tr><tr><td>K</td><td>1,000</td><td class="empty">&nbsp;</td><td>LF</td><td>Linear Feet</td><td class="empty">&nbsp;</td><td>KM2</td><td>Square Kilometre</td></tr></table></div>';


//
// Keep me signed in dialog
//
var keepSignedInTitle = "How can you keep me signed in on this computer?";
var keepSignedInPopup = '<p>Each time you visit us, we can recognize your computer using a "cookie" that was sent the first time you visited. Don\'t worry, the cookie doesn\'t contain any personal information. It simply identifies your computer and makes your visit easier because you don\'t have to sign in.</p><p>The cookie will only work with the computer and Web browser you are using right now. So if you\'re using a public computer, you probably shouldn\'t choose the "keep me signed in" option.</p><p>If you decide you no longer want be instantly signed in, you can set the privacy features on your Web browser so that it no longer accepts cookies, or erases all cookies at the end of a session.</p>';

//
// Forgot Password
//
var labelSignIn = "Sign In";
var labelCancelAndClose = "Cancel and close";
var labelClose = "Close";
var messageEnterAddress = "<p>Simply enter the email address you used to sign up, and we'll email your password to you immediately.</p>";
var messageError = "An error occurred. Please try again.";
var messagePasswordSent = "<p><strong>Your new password has been sent!</strong></p><p>Please check your email account for your new temporary password.</p>";
var messageInvalidEmail = "Invalid email address";

var bad_login= "Incorrect username or password";

function get_cookie(cookie_name) {
	var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
	if (results) {
		return (unescape(results[2]));	
	} else {
    	return null;
	}
}
function delete_cookie(cookie_name) {
	var cookie_date = new Date();  // current date & time
	cookie_date.setTime(cookie_date.getTime() - 1);
	document.cookie = cookie_name += "=; path=/; expires=" + cookie_date.toGMTString();
}
