/*
 * That's all you need to pop up an IFrame(light box)
 * 
 * This script requires nyromodal 1.6.2
 *
 * Questa classe gestir� l'apertura di tutti i nyroModal cos� da avere un manager centralizzato
 */
	
	function newUser(){			    			    	
		jQuery.nyroModalManual({
			url: "/wazzamba-web/spring/basicRegistration?auto=true&claim=false",
			width: 800,
			height: 502,
			forceType:'iframe',
			closeButton: null
		});	
			
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */	
				
		return false;		        
	}
	
	function openContestRegistration() {			    			    	
		jQuery.nyroModalManual({
			url: "/wazzamba-web/spring/contestRegistration",
			width: 800,
			height: 502,
			forceType:'iframe',
			closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;		        
	}
	
	function buyGC(){			    			    	
		jQuery.nyroModalManual({											
			url: "/wazzamba-web/spring/buyWazDollars",
			endRemove: removeModalEnd,
            width: 800,
			height: 502,
            forceType:'iframe',
            closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;	        
	}
	
	function buyGameCredits(){			    			    	
		jQuery.nyroModalManual({											
			url: "/wazzamba-web/spring/buyGameCredits",
			endRemove: removeModalEnd,
            width: 800,
			height: 502,
            forceType:'iframe',
            closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;	        
	}
	
	function buyGameCreditsAndRedirectTo(url){			    			    	
		jQuery.nyroModalManual({											
			url: "/wazzamba-web/spring/buyGameCredits",
			endRemove: function() {
   
		    	window.location.href = url;	
		   
		    }, 
            width: 800,
			height: 502,
            forceType:'iframe',
            closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;	        
	}
	
	function buyPowerUps(){			    			    	
		jQuery.nyroModalManual({											
			url: "/wazzamba-web/spring/buyPowerUps",
			endRemove: removeModalEnd,
            width: 800,
			height: 502,
            forceType:'iframe',
            closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;	        
	}
	
	function buyDiscount(partner, rate, partnerName, milesPrice){			    			    	
		jQuery.nyroModalManual({											
			url: "/wazzamba-web/portal/shop/purchase/discount?partner="+partner+"&rate="+rate+"&partnerName="+partnerName+"&milesPrice="+milesPrice,
            endRemove: removeModalEnd,
            width: 800,
			height: 502,
            forceType:'iframe',
            closeButton: null
		});	
		
		self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
		
		return false;	        
	}
	
	//	###############################
    //  # 	GENERIC DIALOG MANAGEMENT 
    //  ###############################
    
        function openModalDialog(url){       
            jQuery.nyroModalManual({
              	width: 800,
				height: 502,
				forceType:'iframe',
                url: '/wazzamba-web' + url,
                closeButton: null
            });
         
            self.parent.document.getElementById("nyroModalIframe").allowTransparency = "allowtransparency"; /* IE only */
            
            return false;
        }   
	
	function removeModalEnd(){
		window.location.href=window.location.href;
	}
