LEGO.VIP.modals = LEGO.VIP.modals ? LEGO.VIP.modals : {
	init: function(){
		sjq(".vipLearnMore").live("click", function(event){

			LEGO.modal.openModal(null, {name:LEGO.modal.small, href:event.target.href})
			event.preventDefault();
		});
		sjq(".vipSignUpToEarnRewards").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.medium, href:event.target.href})
			event.preventDefault();
		});
		sjq(".vipViewYourAccount").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.small, source:document.getElementById("TestDivData").innerHTML})
			event.preventDefault();
		});
		sjq(".vipTermsAndConditions").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.large, href:event.target.href})
			event.preventDefault();
		});
		sjq(".vipSignInToLegoIdSetOptInFromPage").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.legoId, href:event.target.href})
			event.preventDefault();
		});
		sjq(".vipSignInToLegoIdSetOptInFromModal").live("click", function(event){
			LEGO.modal.close();
			setTimeout(function(){
				LEGO.modal.openModal(event, {name:LEGO.modal.legoId, href:event.target.href})
				LEGO.modal.setClose(function () {
					LEGO.modal.close();
					setTimeout(function(){
						sjq.ajax({
							url: "/VIP/modal/vipLearnMoreModal.jsp",
							success: function(data){
								LEGO.modal.openModal(event, {name:LEGO.modal.small, source:data})
							}
						})
					}, 700) // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
				})
			}, 700); // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
			event.preventDefault();
		});
		sjq(".signinCheckUserModal").live("click", function(event){
			LEGO.modal.close();
			setTimeout(function(){
				LEGO.modal.openModal(event, {name:LEGO.modal.legoId, href:event.target.href})
				LEGO.modal.setClose(function () {
					LEGO.modal.close();
					setTimeout(function(){
						sjq.ajax({
							url: "/checkout/checkUserModal.jsp",
							success: function(data){
								LEGO.modal.openModal(event, {name:LEGO.modal.small, source:data})
							}
						})
					}, 700) // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
				})
			}, 700); // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
			event.preventDefault();
		});
		sjq(".promoCodeMoreInfo").bind("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.large})
			event.preventDefault();
		});
		sjq("#return-guarantee-widget .learnmore, #return-guarantee-widget > h4 > a").bind("click", function(event){
			 LEGO.modal.openModal(event, {name:LEGO.modal.large, href:event.target.href + "?modalView=true", scroll:true})
			 event.preventDefault();
			});
		sjq(".social-bookmark-redirects").bind("click", function(event){
			 LEGO.modal.openModal(event, {name:LEGO.modal.large, href:event.currentTarget.href + "&modalView=true"})
			 event.preventDefault();
			});
		sjq(".signInToLegoIdfromOrderSummary").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.legoId, href:event.target.href})
			event.preventDefault();
		});
		sjq(".giftCardInfoModal").live("click", function(event){
			LEGO.modal.openModal(event, {name:LEGO.modal.large, href:event.target.href, scroll:true})
			event.preventDefault();
		});
		sjq(".promotionalMoreInfo").live("click", function(event){
			event.preventDefault();
			LEGO.modal.openModal(event, {
			 	name:LEGO.modal.small,
			 	href:event.target.href + "?modalView=true",
			 	scroll:true,
			 	loadUrlInIframe: false
			});
		});
	},
	SignInFromModal: function(href){
		LEGO.modal.close();
		setTimeout(function(){
			LEGO.modal.openModal(null, {name:LEGO.modal.legoId, href:href})
			LEGO.modal.setClose(function () {
				LEGO.modal.close();
				setTimeout(function(){LEGO.modal.openModal(null, {name:LEGO.modal.small, href:"/VIP/modal/vipLearnMoreModal.jsp"})}, 700) // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
			})
		}, 700); // THIS TIMEOUT NEEDS TO BE LONGER THAN THE FADE OUT IN LEGO.modal..close()
	}
}
