$(document).ready(function(){		
	$('.newWindow').click(function(){
		window.open(this.href);
		return 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/PuPH16GSxR0&hl=en_US&fs=1&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PuPH16GSxR0&hl=en_US&fs=1&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>');
		$("#overlay-small").fadeIn();	
	});	
	$("#overlay-small").click(function(){
		$(this).fadeOut("fast");
	})		
	$(".screen1").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 
		$("#overlay").fadeIn().html('<img src="images/ss1.jpg" alt="Jewel Quest 4 Game Screenshot 1"/>');
	});		
	$(".screen2").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 								 
		$("#overlay").fadeIn().html('<img src="images/ss2.jpg" alt="Jewel Quest 4 Game Screenshot 2"/>');
	});	
	$(".screen3").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');									 								 
		$("#overlay").fadeIn().html('<img src="images/ss3.jpg" alt="Jewel Quest 4 Game Screenshot 3"/>');
	});
	// form popup script
	$(".btnDownload").click(function(){ 
		$("html, body").animate({scrollTop:0}, 'fast');	
		$("#overlayForm").fadeIn().find("#formContent").html('<iframe src="http://iwin.rsys1.net/servlet/formlink/f?pOpgQSRAB" 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").fadeOut("fast");
	})	
	$("#overlay").click(function(){
		$(this).fadeOut("fast");
	});	
	$("#rt-instruction").click(function(){
		$("#dl-instruction").slideToggle();
	});	
}); // end: document ready