//NOTE: YOU MUST ADD 25px to the height of each 
//of these to account for the close banner

var websetModals = {
	//FreeShipping 100 Popup
	'fs100PopupModal': {
		opts: {
			ajaxData: {'name': '100Shipping'},
			id: 'fs100PopupModal',
			height: 375,
			width: 486,
			closeSelector: '#checkoutModalCloseLink, #fs100PopupModalOverlay'
		}
	},
	//Clearance Popup
	'clearancePopupModal': {
		opts: {
			ajaxData: {'name': 'clearance'},
			id: 'clearancePopupModal',
			height: 288,
			width: 486,
			closeSelector: '#checkoutModalCloseLink, #clearancePopupModalOverlay'
		}
	}
};

$.each(websetModals, function( key, val ) {
	websetModals[key].open = function() {
		if (!websetModals[key].modal) {
			websetModals[key].modal = new Modal($.extend({
				useAjax: true,
				url: '/'+jsContextRoot+'/popups/popup_modal.jsp'
			}, websetModals[key].opts));
		}
		websetModals[key].modal.open();
	};
});

$(document).ready(function() {
	var popupUrl = '/'+jsContextRoot+'/popups/popup_modal.jsp';
	
	$('a.a_jsFS100Link').unbind('click.aerieFS100Link').bind('click.aerieFS100Link', function ( evt ) {
		evt.preventDefault();
		websetModals['fs100PopupModal'].open();
	});
	
	$('a.a_jsClearanceLink').unbind('click.aerieClearanceLink').bind('click.aerieClearanceLink', function ( evt ) {
		evt.preventDefault();
		websetModals['clearancePopupModal'].open();
	});
});


/****IE 6 PNG FIXES*****/
$(document).ready(function() {
	//aerie brand tabs
	$('#tabbedNav li a').ifixpng();
	//aerie top right freeshipping banner
	$('#aerie_fs_banner').ifixpng();
	//aerie bottom content shadow
	$('div.default_pageBottom').ifixpng();
	//aerie homepage fixes
	$('#ahp_right_sliver').ifixpng();
	$('#ahp_left_sliver').ifixpng();
	//aerie gifts homepage fix
	$('#gifts_heart_sliver').ifixpng();
	//Footer Logo Sprite
	$('#centerLogos ul').ifixpng();
	//Footer Legal Logos
	$('#veryBotLogos').ifixpng(); 
	//aerie rollover
	$('#aerie_rollover_image').ifixpng();
});