var navInitData = {
	INTERVAL_MS:23
}
var nav1 = $("<img src=\"/media/images/StaticContent/vera/submenu1.png\" alt=\"shop by look\">");
var nav2 =$("<img src=\"/media/images/StaticContent/vera/submenu2.png\" alt=\"shop for home\">");
var nav3 = $("<img src=\"/media/images/StaticContent/vera/submenu3.png\" alt=\"collection preview\">");
var logo = $("<img src='/media/images/StaticContent/vera/kohls_logo.png' alt='Shop Kohls.com'/>");
jQuery().ready(function(){
	$("#skip-float span").append("<a href=\"#\" rel=\"nofollow\" class=\"styleswitch\" ></a>");	
	$('link[type*=css][href*=global]').attr("title","global");
	$('link[title=global]').each(function(i){
		this.disabled = true;
		this.disabled = false;
	});
	switch($.browser.name){		
		case "mozilla":					
			$("link[type*=css]").not("link[title=global]").each(function(i){
				this.disabled = true;
				this.disabled = false;
			});			
			break;
		case "firefox":
			$("link[type*=css]").not("link[title=global]").each(function(i){
				this.disabled = true;
				this.disabled = false;
			});
			if($.layout.versionNumber=="1.9"){
				$('button').css({'padding-bottom': '2px'});
			}
			break;
		default:
			break;
	}
	
	var c = readCookie('style');
	if(c){
		switchStylestyle(c);
	}else{
		createCookie('style', 'global', 365);
		$("a.styleswitch").text("Switch to high contrast style").attr('href','?style=alternate');
		switchStylestyle('global');
	}
	
	if($("#cartpop").length > 0){
		$("#cartpop").css("display","none");
		$("#cartpop").css("visibility","visible");		
		$("#cartpop").slideUp(0,function(){
			$("#cartpop").slideDown("slow");
		});	
	}
	// toolbar setup		
	$('a.styleswitch').click(function(e){
		e.preventDefault();
		switchStylestyle($(this).attr("href").split("=")[1]);
	});	
	
	if($("#shopping_cart_form").length > 0){
		$("#shopping_cart_form :checkbox").click(function(){
			$("#shopping_cart_form").submit();
		});
		$(".prod-actions ul li a[href=#]").removeAttr("onclick");
		$(".prod-actions ul li a[href=#]").click(function(){
			var updateDiv = $(this).parents("td").siblings(".prod-quantity");
			var num = updateDiv.children("label").attr('for').split("_")[1];
			$("#remove_"+num).val("true");
			updateDiv.find("input[type=image]").click();
		});
		
	}
	$("#equity-bar").append("<div class='equity_image_one'><a href='/upgrade/events/single_event.jsp?FOLDER<>folder_id=2534374752627870'></a></div><div class='equity_image_two'><a href='/upgrade/events/single_event.jsp?FOLDER<>folder_id=2534374753039582'></a></div><div class='equity_image_three'><a href='/upgrade/events/single_event.jsp?FOLDER<>folder_id=2534374752646087'></a></div>")
	$("div.equity_image_one a").append(nav1);
	$("div.equity_image_two a").append(nav2);
	$("div.equity_image_three a").append(nav3);
	$(".disclaimer").append("<div class='kohls_logo'><a href='http://www.kohls.com/upgrade/global/target.jsp?siteid=kohlsmainpage'></a></div>");
	$("div.kohls_logo a").append(logo);
	if ($.browser.msie && $.layout.versionNumber != "8"){
		$.ifixpng('/media/images/StaticContent/global/pixel.gif');
		$("span,h1,h2,h3,h4,h5,h6,img").ifixpng();		
		//correctPNG();
	}
});
(function($) {
	var interval = null;
	var checklist = [];
	$.elementReady = function(id, fn) {
		checklist.push({id: id, fn: fn});
		if (!interval) {
			interval = setInterval(check, navInitData.INTERVAL_MS);
		}
		return this;
	};
	function check() {
		var docReady = $.isReady; // check doc ready first; thus ensure that check is made at least once _after_ doc is ready
		for (var i = checklist.length - 1; 0 <= i; --i) {
			if ($('#'+checklist[i].id).length > 0) {
				var fn = checklist[i].fn; // first remove from checklist, then call function
				checklist[i] = checklist[checklist.length - 1];				
				fn.apply($('#'+checklist[i].id), [$]);
				checklist.pop();
			}
		}
		if (docReady) {
			clearInterval(interval);
			interval = null;
		}
	};
})(jQuery);
(function($,b,l,u,t,a){t=true;u=u;a=navigator.userAgent;b={name:(/(Firefox|Minefield|Chrome|Safari|MSIE|Opera)/.exec(a)||[0,u])[1].toLowerCase()};b.version=b.name.match(/(firefox|minefield)/)?/(Firefox|Minefield)\/([A-Za-z0-9\.]*?)$/.exec(a)[2]:b.name.match(/(safari|chrome|opera)/)?/(Version|Chrome|Opera)\/([A-Za-z0-9\.]*?)\s/.exec(a)[2]:b.name.match(/(msie)/)?/MSIE\s([A-Za-z0-9\.]*?);/.exec(a)[1]:u;l={name:b.name.match(/(firefox|minefield)/)?'gecko':b.name.match(/(chrome|safari)/)?'webkit':b.name.match(/(msie)/)?'trident':b.name.match(/(opera)/)?'presto':u};l.version=b.name.match(/(firefox|minefield)/)?/rv\:([A-Za-z0-9\.]*?)\)/.exec(a)[1]:b.name.match(/(chrome|safari)/)?/AppleWebKit\/([A-Za-z0-9\.]*?)\s/.exec(a)[1]:b.name.match(/(msie)/)?b.version:b.name.match(/(opera)/)?(b.version>9.27)?'futhark':'linear_b':u;b.versionNumber=parseFloat(b.version,10)||1;b.versionX=(b.version+'').substr(0,1);l.versionNumber=parseFloat(l.version,10)||1;l.versionX=(l.versionNumber+'').substr(0,1);b[b.name]=t;l[l.name]=t;b.className=b.name+b.versionX;l.className=l.name+l.versionX;$.browser=$.extend($.browser,b);$.layout=l;$.os={name:(/(Win|Mac|Linux|SunOS|Solaris|iPhone)/.exec(navigator.platform)||[u])[0].toLowerCase().replace('sunos','solaris')};$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));})(jQuery);

function correctPNG() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<span " + imgID + imgClass + imgTitle +
							 " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" +
							 "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" +
							 "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
