/**
 * Getters and Setters
 */
function getIsIE() {
	return isIE;
}
function setIsIE() {
	try { document.attachEvent(); return true; } 
	catch(e) { return false; }
}

/* ===============================
 * May Sales Event
 ============================== */
var MSEInterval = {};

jQuery(window).bind("load", function() { 
	MSEInterval = setInterval(checkMSE, 100);
});
 
function checkMSE() {
	if (jQuery("#CmastheadQuickLinks ul").length < 1) {
		return;	
	}
	else {
		clearInterval(MSEInterval);
		MSE();
	}
}
 
function MSE() {
	
	var usePromo = false;

	var arr = ContextManager.getPromotions() || []; // returns array of Promotion objects

	for (var i = 0; i < arr.length; i++) {
	   if (arr[i].title == "2010 August Sales Event") usePromo = true;
	}

	if (usePromo) {	
		if (jQuery("#CmastheadQuickLinks ul li.se_masthead").length > 0) return;
	
		// get current domain
		var regexpDomain = /[^\/]+[a-z0-9_-]+[.][a-z0-9_-]+[^\/]/i;
		var domain = document.location.href;
		domain = "http://" + domain.match(regexpDomain);
	
		// set the path to the image asset
		var se_image_path = domain + "/Sales_Event/SE_masthead_button.png";
	
		// create the nodes
		var se_masthead = "<li class=\"se_masthead\"><a href=\"./QuickQuoteForm?cs:a:i=lexASE10-CTA-design9\"><img border=\"0\" src=\"" + se_image_path + "\"></a></li>";
	
		// append them to the DOM
		jQuery("#CmastheadQuickLinks ul").prepend(se_masthead);
	}
}
