/**
 * jget plugin
 * @author Alexandre Magno
 * @desc get a query string to be accessible for javascript
 * @version 1.0
 * @example
 *
 * http://www.foo.com/test.php?var1=test1
 * var outputQuery = $.jget['var1'];
 * $.debug(outputQuery);
 * //Will show 'test1'
 *
 *
 * @license free
 * @param bool vertical, bool horizontal
 * @site http://blog.alexandremagno.net
 *
 */

jQuery.extend({

	//starting the jget object
	jget: {},
	//get the url
	url: window.location.href.replace(/^[^\?]+\??/,''),
	//get the queryString
	parseQuery: function ( query ) {
	   var Params = {};
	   if ( ! query ) {return Params;}// return empty object
	   var Pairs = query.split(/[;&]/);
	   for ( var i = 0; i < Pairs.length; i++ ) {
	      var KeyVal = Pairs[i].split('=');
	      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
	      var key = unescape( KeyVal[0] );
	      var val = unescape( KeyVal[1] );
	      val = val.replace(/\+/g, ' ');
	      Params[key] = val;
	   }
	   return Params;
	},
	//Make the jget object available to jQuery.extend
	getQueryString: function() {
		this.jget = this.parseQuery(this.url);
	},
	//debugging
	debug: function(message) {
		if(!$.browser.msie) {
			console.info(message);
		} else if($.browser.safari) {
			window.console.log(message);
		} else {
			alert(message);
		}
	}
});

//start the plugin
$.getQueryString();


/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // NOTE Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};


/***************************************
  Columns
   @author Karl Swedberg
   @version 0.2 (08/19/2008)
   @requires jQuery v1.2.6+
  
***************************************/

(function($) {
$.fn.columns = function(options) {
  var opts = $.extend(true, {}, $.fn.columns.defaults, options);

  return this.each(function(event) {
    var $container = $(this),
      nname = this.nodeName,
      $kids = $container.children(),
      col = 1,
      item = 1,
      items = [],
      cClass = opts.columnClass;
    
    if (opts.columnWrapper) {
      var cw = this.className ? this.className + ' ' + opts.columnWrapperClass : opts.columnWrapperClass;
      var $wrap = $(opts.columnWrapper)
        .addClass(cw + ' ' + cw + '-' + opts.columns)
        .attr('id', this.id)
        .insertBefore($container);
    }
    for (var i=0, klength = $kids.length; i < klength; i++) {
      items.push($kids[i]);
      var itemStart = (klength/opts.columns)*col;
      if (i+1 >= itemStart || i === klength-1) {
      item = Math.ceil(itemStart);  
        var $parent = $('<' + nname + ' class="' + cClass + ' ' + cClass + '-' + col + '"></' + nname + '>')
          .append($(items));
        if (i === klength-1) {
          $parent.addClass(cClass + '-last');
        }
        if (opts.columnWrapper) {
          $parent.appendTo($wrap);
        } else {
          $parent.insertBefore($container);
        }
        if ($parent[0].nodeName == 'OL' && col > 1) {
          $parent.attr('start', start);
        }
        col++;
        items = [];
      }
      var start = item+1;
    }
    
    $container.remove();


  });
};

})(jQuery);


$.fn.columns.defaults = {
  columns: 3,
  columnClass: 'floatcols',
  columnWrapper: '<div></div>', // set to null if you don't want a wrapper around all columns
  columnWrapperClass: 'column-wrapper'
};




/* Browser sniffing?! Only used to lay an  over select boxes in IE6 */
ie6 = false;
if ($.browser.msie) {
	if(parseInt(jQuery.browser.version, 10) == 6){
		ie6 = true;
	}
}

/* catch and replace for swfs */
if (!swfobject.hasFlashPlayerVersion("9.0.0")) {
	$("div.flashalt-pre").addClass("flashalt").removeClass("flashalt-pre").show("normal");
}



RECIPETOOLS  = {
	currentopen : "",
	printwin : "",
	init : function(triggers){
		$(document).keyup(function(event){
			if (event.keyCode == 27) {
				RECIPETOOLS.hide();
			}
		});
		$(triggers).bind("click", function(){
			pageTracker._trackEvent("RecipeTools", "Print", document.title);
			RECIPETOOLS.printwin = window.open($(this).attr("href"), "printwin", "height=600,width=800,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");
			return false;
		});
	},
	reveal : function(event){
		event.stopPropagation();
		event.preventDefault();
		RECIPETOOLS.hide();
		RECIPETOOLS.currentopen = $(this).next("ul").addClass("open").bind("click", function(event){event.stopPropagation();});
	},
	hide : function(){
		if(RECIPETOOLS.currentopen != ""){
			$(RECIPETOOLS.currentopen).removeClass("open");
			RECIPETOOLS.currentopen = "";
		}
		if(RECIPETOOLS.printwin != ""){
			RECIPETOOLS.printwin.close();
			RECIPETOOLS.printwin = "";
		}
	},
	doprint : function(){
		RECIPETOOLS.printwin.print();
		pageTracker._trackEvent("RecipeTools", "Print-Click", document.title);
		RECIPETOOLS.hide();
		return false;
	}
};

EMAILTOOLS  = {
	currentopen : "",
	printwin : "",
	init : function(triggers){
		$(document).keyup(function(event){
			if (event.keyCode == 27) {
				EMAILTOOLS.hide();
			}
		});
		$(triggers).bind("click", EMAILTOOLS.reveal);
		$(triggers).next().find("a.close").bind("click", function(){EMAILTOOLS.hide(); return false;});
		$(triggers).next().find("div a").bind("click", function(event){
			event.preventDefault();
			EMAILTOOLS.printwin = window.open($(this).attr("href"), "printwin", "height=600,width=800,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");
		});
		$("body").bind("click", EMAILTOOLS.hide);
	},
	reveal : function(event){
		pageTracker._trackPageview("/_forms/email-overlay");
		pageTracker._trackEvent("RecipeTools", "Email-Open", document.title);
		event.stopPropagation();
		event.preventDefault();
		 
		EMAILTOOLS.hide();
		EMAILTOOLS.currentopen = $(this).next("ul").addClass("open").bind("click", function(event){event.stopPropagation();});
	},
	hide : function(){
		//pageTracker._trackPageview("/_forms/email-overlay/close");
		if(EMAILTOOLS.currentopen != ""){
			pageTracker._trackEvent("RecipeTools", "Email-Close", document.title);
			$(EMAILTOOLS.currentopen).removeClass("open");
			EMAILTOOLS.currentopen = "";
		}
		if(EMAILTOOLS.printwin != ""){
			pageTracker._trackEvent("RecipeTools", "Email-Close", document.title);
			EMAILTOOLS.printwin.close();
			EMAILTOOLS.printwin = "";
		}
	}
};


/*RECIPETOOLS  = {
	currentopen : "",
	printwin : "",
	init : function(triggers){
		$(document).keyup(function(event){
			if (event.keyCode == 27) {
				RECIPETOOLS.hide();
			}
		});
		$(triggers).bind("click", RECIPETOOLS.reveal)
		$(triggers).next().find("a.close").bind("click", function(){RECIPETOOLS.hide(); return false;})
		$(triggers).next().find("div a").bind("click", function(event){
			event.preventDefault();
			RECIPETOOLS.printwin = window.open($(this).attr("href"), "printwin", "height=600,width=800,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no")
		})
		$("body").bind("click", RECIPETOOLS.hide)
	},
	reveal : function(event){
		event.stopPropagation();
		event.preventDefault();
		RECIPETOOLS.hide();
		RECIPETOOLS.currentopen = $(this).next("ul").addClass("open").bind("click", function(event){event.stopPropagation();})
	},
	hide : function(){
		if(RECIPETOOLS.currentopen != ""){
			$(RECIPETOOLS.currentopen).removeClass("open")
			RECIPETOOLS.currentopen = "";
		}
		if(RECIPETOOLS.printwin != ""){
			RECIPETOOLS.printwin.close();
			RECIPETOOLS.printwin = "";
		}
	},
	doprint : function(){
		RECIPETOOLS.printwin.print();
		RECIPETOOLS.hide();
		return false;
	}
}*/

OVERLAY = {
	called : false,
	postimeout : 0,
	init : function(triggers){
		// Create overlay div to darken background
		if(!OVERLAY.called){
			OVERLAY.called = true;
			var overlaydiv = document.createElement("div");
			$(overlaydiv).attr("id", "overlay");
			$("body").append(overlaydiv);
			overlaydiv = $(overlaydiv);
			overlaydiv.hide();
			overlaydiv.fadeOut(10);
			overlaydiv.width($("body").width());
			overlaydiv.height($(document).height());   
			overlaydiv.bind("click", OVERLAY.closeOverlay);
			// Create holder div to load overlays into
			var holderdiv = document.createElement("div");
			$(holderdiv).attr("id", "popupholder");
			$(holderdiv).hide();
			$("body").append(holderdiv);
			// Bind close events
			$(document).keyup(function(event){
				if (event.keyCode == 27) {
					OVERLAY.closeOverlay();
				}
			});
		}
		// Link anchors
		$(triggers).bind("click", OVERLAY.openOverlay);
	},
	closeOverlay: function(){
		pageTracker._trackEvent("Overlay", "close");
		$("#popupholder iframe").attr("src", "");
		$("#popupholder").fadeOut(250, function(){
			if(ie6){
				$("select").css("visibility", "visible");
			}
			$("#overlay").fadeOut(250,function(){
				$("#popupholder").empty();	
			});
		});
		return false;
	},
	openOverlay: function(){
		if(ie6){
			$("select").css("visibility", "hidden");
		}
		$("#overlay").show();
	//	$("#popupholder").show();
		var url = $(this).attr("href");
		pageTracker._trackEvent("Overlay", "open", url);
		$("#overlay").css("height", $(document).height()+"px");
		$("#overlay").css("width", $(window).width()+"px");
		
		$("#overlay").fadeTo(250, 0.25);
		// Just load 'oc' (overlay content) div, not whole document
		$("#popupholder").load(url + " #oc", {}, function(){
			OVERLAY.postimeout = setInterval(OVERLAY.posOverlay, 100);
			$("#popupholder").fadeIn(250);
			$("#closeoverlay a, #oc .picoverlay img").bind("click", OVERLAY.closeOverlay);
			$('#contenttabs').before('<ul id="sizenav">').cycle({
				fx:			'fade',
				timeout:	4000,
				speed:		'slow',	    
				height:		319,
				cleartype:	false,
				pager:		'#sizenav',
				pagerAnchorBuilder: function(idx, slide) { 
					return '<li><a href="#">'+$(slide).attr("title")+'</a></li>'; 
				}
			});
			OVERLAY.init("#oc .viewnutrition");
			$('#contenttabs').cycle('pause');
			
			
		});
		return false;
	},
	
	posOverlay: function(){ 
		if($("#oc").width() < 200) {return false;}
		clearInterval(OVERLAY.postimeout);
		$("#oc").css("margin-left", ($(window).width()/2)-($("#oc").width()/2)+"px");
		$("#oc").css("margin-top", ($(window).height()/2)-($("#oc").height()/2)+"px");	
	}
};

function jumpLocation(itemid){
	$("#"+itemid).addClass("highlighted");
	newtop = $("#"+itemid).offset();
	$('html,body').animate({scrollTop: newtop.top+"px"});
	return false;
}

function faqs(){
	if(document.location.href.split("#").length > 1){
	jumpLocation(document.location.href.split("#")[1]);}
	$("#faqlist a").bind("click", function(){
		$("li.highlighted").removeClass("highlighted");
		return jumpLocation($(this).attr("href").split("#")[1]);
	});
	$("p.backtotop a").bind("click", function(){
		return jumpLocation("faqlist");
	});
}



function columnLayout(){
    if($(".pathways").hasClass("col2")){
        $(".pathways li:nth-child(2n-1)").addClass("first");
    }
    if($(".pathways").hasClass("col3")){
        $(".pathways li:nth-child(3n-2)").addClass("first");
    }
}

COUNTRYSELECT = {	
	inactivestates : {},
	init : function(){
		inactive = COUNTRYSELECT.inactivestates; cd = "#countrydropdown"; sd = "#statedropdown";
		inactive.US = Array();
		$(cd+","+sd).addClass("js");
//		$(cd+", label[for=countrydropdown]").show();
		$(cd+" option[value=US]").attr("selected", "selected");
		
		$(sd+" optgroup option").each(function(i,opt){
			$(opt).addClass($($(opt).parent().get(0)).attr("class"));
		});
		$(sd+" optgroup option").clone().appendTo(sd);
		$(sd+" optgroup").remove();
		
		$(cd+" option[value!=US]").each(function(i,opt){
			inactive[$(opt).val()] = $(sd+" option[class="+$(opt).val()+"]").remove();
		});
		
		$(cd).bind("change", function(){
			$(cd+" option").each( function(i,opt){
				if (inactive[$(opt).val()].length === 0){
					inactive[$(opt).val()] = $(sd+" option[class="+$(opt).val()+"]").remove();
				}
			});
			$(sd).append(inactive[$(cd+" option:selected").val()]);
			inactive[$(cd+" option:selected").val()] = Array();
			
		});
		
		COUNTRYSELECT.getLocations('true');
		
		$("form.findastore").bind("submit", COUNTRYSELECT.getLocations);
	},
	
	getLocations : function(onload){
		$("#countrydropdown, #statedropdown, #familydropdown").attr('disabled', 'disabled');
		$("#locationlist").empty().html('<div class="loader"></div>');
		$.get(
			$("form.findastore").attr("action"),
			{countrydropdown: (onload == 'true' ? $.jget['countrydropdown'] : $("#countrydropdown option:selected").val()),
			statedropdown: (onload == 'true' ? $.jget['statedropdown'] : $("#statedropdown option:selected").val()),
			familydropdown: (onload == 'true' ? $.jget['familydropdown'] : $("#familydropdown option:selected").val())},
			function(data){
				pageTracker._trackPageview($("form.findastore").attr("action")+"?countrydropdown="+ $("#countrydropdown option:selected").val()+"&statedropdown="+$("#statedropdown option:selected").val()+"&familydropdown="+$("#familydropdown option:selected").val());
				$("#locationlist").html(data);
				$('.stategroup ul').columns({columns: 3, columnClass: 'storelist', columnWrapper: null});
				$('.stategroup:last').next().remove();
				$("#countrydropdown, #statedropdown, #familydropdown").removeAttr('disabled');
			}
		);
		$("#findstores").blur();
		return false;
	}
	
};
		
function dealersBrokers(){
	$("#dealersbrokers").empty();
	$.get(
		$("#dealerstate").attr("action"),
		{state: $("#dealerstate option:selected").val()},
		function(data){
			$("#dealersbrokers").html(data);
		}
	);
	return false;
}

function bookmarkPage(){
	loc = document.location.href;
	title = document.title;
	pageTracker._trackEvent("RecipeTools", "Bookmark", title, loc);
	try{
		window.external.AddFavorite(loc,title);
		return false;
	}
	catch(err1){}
	try {
		window.sidebar.addPanel(title,loc,'');
		return false;
	}
	catch(err2){}
	alert("Sorry, your browser cannot add bookmarks from this link. Please save this recipe from your browsers bookmark menu.");
	return false;
}

var fieldtext = [];
function memorizeTextField(fs, ft){
	if($(fs).length < 1){ return false;}
	fieldtext[fs] = ft;
	var fieldstring = fs;
	if($(fs).val() == ""){
	$(fs).val(fieldtext[fs]);}
	$(fs).bind("click", function(){
		if($(this).val() == fieldtext[fieldstring]){
			$(this).val("");
		}
	});
	$(fs).bind("blur", function(){
		if($(this).val() == ""){
			$(this).val(fieldtext[fieldstring]);
			
		}
	});
}

function emailRecipe(){
	$("#sendemail").click(function(){

	});
}

function processEmailRecipe(){
	pageTracker._trackPageview("/_forms/email-overlay/submit");
	$.post(
		$("#LO_emailRecipeForm").attr("action"),
		$("#LO_emailRecipeForm").serializeArray(),
		function(data){
			$("#emailRecipe").empty();
			$("#emailRecipe").html(data);
			pageTracker._trackPageview("/_forms/email-overlay/response");
		}
	);
	return false;
}

var addthis_config = {
	username: 'lindsayolives',
	services_compact: 'email, digg, facebook, delicious, twitter, favorites, google, more',
//	services_exclude: 'print',
	data_use_flash: false
};
jQuery.fn.addThis = function(){
	if(typeof(addthis) == "undefined" || typeof(pageTracker) == "undefined"){
		setTimeout($.fn.addThis, 1000);
		return false;
	}
	addthis_config.data_ga_tracker = pageTracker;
	addthis.button(".addthis_button");
	//addthis.toolbox(".addthis_toolbox");
	$('.addthis_toolbox, #sharebutton').fadeIn(1000);	
	
};
var fctester = 0;
function check_fc(){
	if(typeof(fc_json) != "undefined"){
		if(typeof(fc_json["product_count"]) != "undefined"){
			clearInterval(fctester);
			if(fc_json.product_count > 0){
				$("#viewbasket .checkout").show();
			} else {
			   $("#viewbasket .foxycart").html("<strong>View Basket</strong>");
			}
			$("#viewbasket .foxycart").show();
			$("#viewbasket").css("visibility","visible");
		}
	}
}

$(document).ready(function(){
	
	$("#LO_emailRecipeForm").RSV({
		onCompleteHandler: processEmailRecipe,
		displayType: "display-html",
		rules: [
		"required,yourname,Please enter your name.",
		"required,youremail,Please enter your email address.",
		"valid_email,youremail,Please check your email address.",
		"required,friendsname,Please enter your friend's name.",
		"required,friendsemail,Please enter your friend's email address.",
		"valid_email,friendsemail,Please check your friend's email address."
		]
	});
	
	if($("#JoinClubLindsayForm").length > 0){
		$("#JoinClubLindsayForm").RSV({
			displayType: "display-html",
			errorFieldClass: "field-error",
			rules: JoinClubLindsayFormRSVRules
		});
	}
	
	swfobject.embedSWF("/swfs/overview/accents.swf", "productbanner440", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/adventures.swf", "productbanner80", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/blackripe.swf", "productbanner8", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/natural.swf", "productbanner37", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/perfect-paring.swf", "productbanner86", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/snackers.swf", "productbanner38", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/spanish-manz.swf", "productbanner102", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/spanish-queen.swf", "productbanner946", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/recloseables.swf", "productbanner880", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});

	
	swfobject.embedSWF("/swfs/productsoverview_shell.swf", "productsoverview", "950", "400", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/overview/retail_overview.swf", "retail_overview", "611", "273", "9.0.0", "", {path:"/swfs/"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/featuredrecipe.swf", "recipeoverview", "601", "388", "9.0.0", "", {xmlPath: "/recipes/recipes.xml", version: "lg"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/homeshell.swf", "homepageflash", "620", "499", "9.0.0", "", {xmlPath: "/swfs/xml/homepage.xml"}, {menu: "false", wmode: "transparent"});
	swfobject.embedSWF("/swfs/featuredrecipe.swf", "featuredrecipes", "330", "222", "9.0.0", "", {xmlPath: "/recipes/recipes.xml", version: "sm"}, {menu: "false", wmode: "transparent"});
	RECIPETOOLS.init("#recipetools .print>a, #olivetoss a,.recipelink");
	EMAILTOOLS.init("#recipetools .email>a");

	$("#printrecipe").bind("click", function(){window.opener.RECIPETOOLS.doprint();});

	$("table.search tbody tr:nth-child(even)").addClass("even");
    $(".storeoverview li:lt(2)").addClass("first");
    $(".storecats li:nth-child(3n-2)").addClass("first");
    $("#productspecs li:nth-child(3n-2)").addClass("first");
    $(".contentlist li:first").addClass("first");
	
	$("body:eq(0)").prepend("<a href=\"/emergency-message\" id=\"emergencylink\"></a>");

	OVERLAY.init("p.enlarge a, #nutritionlink, .sidebar .photo a, #productspecs a,.videolink, #emergencylink");
	
	if($("#countrydropdown").length > 0){
		COUNTRYSELECT.init();
	}
	
	if($("#faqlist").length > 0){
		faqs();
	}
	columnLayout();
	
	if($("#dealersbrokers").length > 0){
		dealersBrokers();
	}
	$("#statesubmit").click(dealersBrokers);
	
	fctester = setInterval(check_fc, 500);
	
	$("form.foxycart input[type=submit]").bind("click", function(){
	   $("#viewbasket .foxycart").html("<strong>View Basket:</strong> <span id=\"fc_quantity\"></span> Items.");
		$("#viewbasket .checkout").show();
	});
	
	if($("select[name='search']").length > 0){
		$("select[name='search']").change(function(){
		   $(this).parents("form").submit();
		});
	}
	
	$("#recipetools .bookmark a").bind("click", bookmarkPage);
	
	memorizeTextField("#getemail", "Enter your email");
	
	$("a[rel~=external]").attr("target","_blank");
	
	$("a[rel~=track]").bind("click",function(){pageTracker._trackPageview("/_exit/"+$(this).attr("rel").replace("track_",""));});
	
	$("#productquickfinder").hover(
		function(){
			$(this).addClass("hover");
		}, 
		function(){
			$(this).removeClass("hover");
		}
	);

	//Comment out the lines below when no emergency notification is active
	/*if ($.cookie("emergencyoverlay") == null) {
				
		$.cookie("emergencyoverlay", "true", {expires: 14});
		
		$("#emergencylink").click(); 

	} */

	//Uncomment the line below when no emergency notification is active
	$.cookie("emergencyoverlay", null, {expires: 12});
});