


			
			var ApplicationContext = {
				rootUrl : 'http://www.jogos-de-vestir.net'
			};
			
			$( document ).ready( function() {		
			
				$('#newsletter-form').submit( function() {
					window.open( 
						'http://www.feedburner.com/fb/a/emailverifySubmit?feedId=2251320', 
						'popupwindow', 
						'scrollbars=yes,width=550,height=520' );
						
					powerOn.trackPage( "http://www.jogos-de-vestir.net/Advertisements/Advertisement.rails?advertisementPlaceHolder=TrackingNewsletter&updateCookie=False&useLayout=False&backUrl=" );
					         	
					powerOn.trackAnalytics( { url: "/newsletter" } );
						
					return true;
				});	
			
				$('.advertisement').astrack( {
					debug:false, 
					callback: function() {
						powerOn.trackPage( "http://www.jogos-de-vestir.net/Advertisements/Advertisement.rails?advertisementPlaceHolder=TrackingAdvertisement&updateCookie=False&useLayout=False&backUrl=" );
					}
				});
			
				$( '#Search' ).val( "" );
			
				$( 'input.withExample' ).example();
			
			});
			
			function loadFeaturedAndPopularGames( count, categoryID ) {
				loadFeaturedGames( count, $("#featured-games-block"), categoryID );
				loadPopularGames( count, $("#popular-games-block"), categoryID );
			}
			
			function loadFeaturedGames( count, selector, categoryID ) {
				// make sure count is an int
				count = parseInt( count );
			    
			    var container = $(selector);
			    
				if( container.length > 0 ) {
					var data = {
						count: count 
					};
					
					if ( categoryID )
					    data.categoryID = categoryID;
					
					container.load( 
						"http://www.jogos-de-vestir.net/FeaturedGames/FeaturedGames.rails", 
						data, 
						function() {
					        initializeAjaxLinks( container.find( '.tooltip-ajax-link' ) );
				        } );
			    }
			}
			
			function loadPopularGames( count, selector, categoryID ) {
				// make sure count is an int
				count = parseInt( count );
			
			    var container = $(selector);
			
				if( container.length > 0 ) {
					var data = {
						count: count 
					};
					
					if ( categoryID )
					    data.categoryID = categoryID;
			
			        container.load( 
				        "http://www.jogos-de-vestir.net/PopularGames/PopularGames.rails", 
				        data, 
				        function() {
					        initializeAjaxLinks( container.find( '.tooltip-ajax-link' ) );
				        } );
				}
			}
			
			function loadFavoriteGames( count ) {
				if( $("#favorite-contents" ).length > 0 ) {
					$("#favorite-contents .ui-widget-header").load( 
						"http://www.jogos-de-vestir.net/Profile/FavoriteGames.rails", 
						{ count: count }, 
						function() {
							initializeAjaxLinks( $( '#favorite-contents .tooltip-ajax-link' ) );
						} );
				}
			}
			
			function loadCategories( selector, numberOfItems ) {
			    var container = $( selector );
			    if ( container.length > 0 ){
			        container.load(
			            "http://www.jogos-de-vestir.net/Categories/AjaxCategory.rails", 
			            {
			                numberOfItems: numberOfItems
			            }, 
			            function() {
					        initializeAjaxLinks( selector.find( '.tooltip-ajax-link' ) );
				        } );
			    }
			}
			
			function loadCategory( selector, categoryID, numberOfItems )
			{
			    var container = $( selector );
			    if ( container.length > 0 ){
			        container.load(
			            "http://www.jogos-de-vestir.net/Categories/AjaxCategory.rails", 
			            {
			                categoryID: categoryID,
			                numberOfItems: numberOfItems
			            } );
			    }
			}
			
			var Localization = {
				close:		"Fechar", 
				next:		"Seguinte", 
				previous:	"Anterior", 
				finish:		"Finish", 
				cancel:		"Cancelar", 
				ok:			"Ok", 
				save:		"Guardar", 
				pleaseWait: "Por favor, espere...", 
				information: "Information", 
				signInOrRegisterPopupTitle: "Sign In Or Register"
			};
			

$( document ).ready( function() {		

	
		powerOn.initialize();
	
});
