var _base_href = (document.domain=="localhost" || document.domain=="meyer" || document.domain=="jfb" || document.domain.indexOf('192.')>-1 || document.domain.indexOf('172.')>-1) ? "/" : "http://www.potsandpans.com/";
	
var setupGlobalConfig = function() {
	return {
		logs_disabled: false,
		base_href: _base_href,
		extension: ".php",
		animation_speed: 200,
		fade_speed: 100,
		currency_symbol: "$",
		dialogs: {},
		free_shipping_threshold: 100,
		free_shipping_price_threshold: 50.00
	}
};
_global_config = setupGlobalConfig();
 
/* ---------- [ ALL PAGE VIEWS ] ---------- */
$(document).ready(function() {
	setupScreen();
	setupNav();
	setupPCartPromo();
	setupSlider();
	setupListCheckbox();
	setupStarRating();
	setupInformativeBubbles();
	setupEqualizations();
	setupDefaultStates();
	setupScrollPage();
	setupSearchBoxValidation();
	$(".funnel .swatch ul a").checkbox();
	$(".funnel .stovetop ul a").checkbox({
		unavailable: "stovetop-ua"
	});
	_pcart = setupPCart();
	setupLogout();
	setupBrowseLink();
	setNameCookie();
	
	//setupSignIn();
		//alert("here "+$.cookie("gotcookie1"));
	if(($.cookie("gotcookie1")==null)||(($.cookie("gotcookie1")=="forErrorPage"))){
		//alert("calling");
	_pcart.cartcookie();
	
	
}

if($.cookie("gotcookie1")=="forErrorPage2"){
	//alert("in errorPage2 ");
	//	_pcart.cartcookie();
	var exdateErrorPage=new Date();
	$.cookie("gotcookie1","done",{path: '/', expires: exdateErrorPage+1000});
	
}
	if($.cookie("gotcookie1")=="forErrorPage"){
		//alert("forErrorPage2");
	var exdateErrorPage=new Date();
	$.cookie("gotcookie1","forErrorPage2",{path: '/', expires: exdateErrorPage+1000});
	
}

		$("#secondary .my-meals .select-list-item .meals").click(function(){
					mealReload($(this).attr('id'));
					return false;			
			});
						
	
	$(".add-to-recipe-box").moveitem({
		where: $(".pcart-nav .recipe-box")
	});
	//changePassword();
  //$("#changepword").changePassword();
  //$(".slideshow-player, ul.related-images a, div.related-images a").magnify();
	$("#wishlist").wishlist();
	$("#giftlist").giftlist();
	$("#recipebox").recipebox();
	$("#primary .copy-item.to-wish-list").moveitem();
	$(".features.tab-group").tabgroup();
	$(".item-tabs.tab-group").tabgroup({
		selected: "v8",
		container: "self",
		body: ".item-tab"
	});
	$(".billboard-tabs.tab-group").tabgroup({
		selected: "selected",
		container: ".billboard"
	});
	$(".open-modal-dialog").modaldialog();
	$(".open-modal-dialog.register").modaldialog("options", {
		dialog: "register"
		
	});
	$(".open-modal-dialog.login").modaldialog("options", {
		dialog: "login"
	});
	//$(".open-modal-dialog.feedback").modaldialog("options", {
	//	dialog: "feedback"
	//});	
	$(".slideshow-player, div.related-images a").modaldialog({
		dialog: "slideshow-player",
		end: function(_self) {
		$(_self).find("ul.related-images a").magnify();
		
		}
		
	});
	
	
	
	$(".ratings-reviews-write").modaldialog({
		dialog: "ratings-reviews",
		show_screen: true,
		end: function(_self) {
			
		}
	});
	
	$("a.form-submit-link").click(function() {
		
		var _form = $(this).parents("form");
		var _action = _form.attr("action");
		_form.attr("action", $(this).attr("href"));
		_form.submit();
		_form.attr("action", _action);
		return false;
	});
	
		
	
	
	//$(".open-address-book").modaldialog({
	//	dialog: "address-book",
	//	path: "?pagename=PotsAndPans/AddressBook &site=PotsAndPans",
	//	draggable: false,
	//	end: function(_dialog) {
	//		setupAddressBook(_dialog);
	//	}
	//});
	
	//Commented due to functionality change - Jesty
	//$(".open-address-book.add-another-address").modaldialog("options", {
	//	onshow: function(_dialog) {
	//		later(function() { _dialog.find(".add-address a").click(); }, 100);
	//	}
	//});
	
	$(".drop-down-tab").dropdowntab();
	$("form[name=promo-code]").promocode();
	setupScroll({
		container: $("#carousel-personality"),
		increment: 4
	});
	$(".funnel .list .show-hide").show_hide();
	$(".funnel .checkboxes .show-hide").show_hide({
		parent: ".checkboxes"
	});
	$(".funnel .filter .show-hide").show_hide({
		parent: ".filter",
		show: ".slider-cx"
	});
	checkSignInLink();
	setupOutOfStock();
	if($.browser.msie && $.browser.version==6) {
	//if($.browser.msie ) {
		$(window).scroll(function() {
			_pcart.adjust_position();
		});
	}
});




























