var shoppingCartPtr;

//CVV  pre-R08 workaround 
try {
	showCVVDescModal = function(n) {};
	showSavedCVVDescModal = function(n) {};
} catch(e) { }

function simpleCVVModal() {
	var x = window.open('//img.disneystore.com/content/hub/checkout11/cvvmodals/default.html', 'DisneyStore', 'width=595,height=430,scrollbars=no'); return false;
}

$(document).ready(function() {
	$('p#saved_cvvSection a').click(simpleCVVModal);
	$('p#cvvSection a').click(simpleCVVModal);
});

function open_guest_services_window(pageName) {
	var GuestServices;
	if (pageName == "") pageName = "mainmenu";
	GuestServices = open("http://img.disneystore.com/content/global/guest_services10/"+pageName+".html","GuestServices","height=470,width=570,toolbar=no,menubar=yes,resizable=yes,scrollbars=yes");
	GuestServices.focus();
	return true;
}

function open_gs_window(path) {
	var newPath = path.replace(/\//gi,"").toLowerCase();
	if (newPath.indexOf("sizeinfo") >= 0) {
		newPath = "sizes";
	}
	if (newPath.indexOf("giftcardsmain") >= 0) {
		newPath = "giftcards";
	}
	if (newPath.indexOf("contactus") >= 0) {
		newPath = "contact";
	}
	return open_guest_services_window(newPath);
}

// dsy_ic_redirector added 10/22/07 by gschlott, updated 11/14/07 & 4/30/09
// This function is used by Instant Credit landing page links in the DisneyStore.com site.
// It determines which CELL code should be passed to the landing page based on the business rules around the disneystore.com domain.
// NOTE that is the function is used in a footer link, the parameters should be blank so that the CELL values can be overridden when special events are scheduled.
function dsy_ic_redirector(param_cell_dsi,param_cell_dsy) {
	var ic_url = "https://www.disneystore.com/disney/store/DSIInstantCreditCardSelectionDisplay?storeId=10054&langId=-1&catalogId=10002";
	var chosen_cell_dsi = param_cell_dsi;
	var chosen_cell_dsy = param_cell_dsy;
	try {
		if (ic_cell_footer_dstore_dsi != null && ic_cell_footer_dstore_dsi != "" && param_cell_dsi == "") chosen_cell_dsi = ic_cell_footer_dstore_dsi;
		if (ic_cell_footer_dstore_dsy != null && ic_cell_footer_dstore_dsy != "" && param_cell_dsi == "") chosen_cell_dsy = ic_cell_footer_dstore_dsy;
	} catch (e) { alert(e); }
	if (chosen_cell_dsy != "" && document.cookie.indexOf("SOURCE=325310") >= 0) ic_url += "&CELL="+chosen_cell_dsy;
	else if (chosen_cell_dsi != "") ic_url += "&CELL="+chosen_cell_dsi;
	window.location.href = ic_url;
}

