$(document).ready(function(){		
	$('a.newWindow').click(function(){
		window.open(this.href);
		return false;
	});
	//timer to show mini game top banner
	$("body").oneTime(950, "alert", function(){
		$("#flashGameTop").slideDown().click(function(){
			$("#flashGameTop > #gameContainer").slideDown();	
			$("#flashGameTop > #gameContainer > #game").flash({
		    	src: 'minigame.swf',
		    	width: 533,
		    	height: 400
			}); // end:Flash game
		$("#flashGameTop").unbind('click');	
		}); // end: Timer func
	});
	$("#flashGameTop > #gameContainer > #button").click(function(){
		$("#flashGameTop").slideUp();
	});
	var flag = false; // using flag variable to make sure flash game does not show up multiple times. 
	$("#flashGameCenter-play").click(function(){
			if (flag == false) {
			$("#flashGameCenter").find("#gameContainer").slideDown().find("#game").flash({
		    	src: 'minigame.swf',
		    	width: 533,
		    	height: 400
			}); // end: Flash game
			flag = true
			}
		});		
		$("#flashGameCenter").find("#gameContainer > #button").click(function(){
				$("#flashGameCenter").find("#gameContainer > #game").html('');
				$("#flashGameCenter").find("#gameContainer").slideUp();
				flag = false;
		});	
	$("#watchvideo").click(function(){
		$("html, body").animate({scrollTop:0}, 'fast');									
		$("#overlay-small").html('<img src="images/spacer.png" height="39" width="20"/><br/><object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/_z3pMaFQfIo&hl=en&fs=1&color1=0x402061&color2=0x9461ca&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_z3pMaFQfIo&hl=en&fs=1&color1=0x402061&color2=0x9461ca&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>');
		$("#overlay-small").show("scale","fast");	
	});	
	$("#overlay-small").click(function(){
		$(this).hide("scale","slow");
	})		
	$(".screen1").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 
		$("#overlay").show("scale","fast").html('<img src="images/ss1.jpg" alt="Jojo\'s Fashion Show World Tour Game Screenshot 1"/>');
	});		
	$(".screen2").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 								 
		$("#overlay").show("scale","fast").html('<img src="images/ss2.jpg" alt="Jojo\'s Fashion Show World TourGame Screenshot 2"/>');
	});	
	$(".screen3").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 								 
		$("#overlay").show("scale","fast").html('<img src="images/ss3.jpg" alt="Jojo\'s Fashion Show World Tour Game Screenshot 3"/>');
	});
	/*// form popup script
	$(".btnDownload").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');	
		$("#overlayForm").show().find("#formContent").html('<iframe src="http://iwin.rsys1.net/servlet/website/ResponseForm?pPpgEchqhl.25VTW_3hksK.25VT0hNk_uhmpMR_.40hkt" width="388" height="540" scrolling="no" frameborder="0"><p>Your browser does not support iframes.</p></iframe>');
	});		
	// form close script
	$("#btn_notifyClose").click(function(){
		$("#overlayForm").hide("scale","slow");
	})	*/
	$("#overlay").click(function(){
		$(this).hide("scale","slow");
	});	
	$("#rt-instruction").click(function(){
		$("#dl-instruction").slideToggle();
	});	
}); // end: document ready