function stardust(){
	var mysrc = 'images/sparks.swf';
	$('#content-banner h1').after('<div id="small01"></div><div id="particles01"></div><div id="particles02"></div><div id="small02"></div>');
	$('#small01').flash(
		{ src: mysrc,
			width: 40,
			height: 150 }, 
		{ update: false }
	);	
	$('#small02').flash(
		{ src: mysrc,
			width: 40,
			height: 150 }, 
		{ update: false }
	);	
	$('#particles01').flash(
		{ src: mysrc,
			width: 190,
			height: 150 }, 
		{ update: false }
	);	
	$('#particles02').flash(
		{ src: mysrc,
			width: 190,
			height: 150 }, 
		{ update: false }
	);	
}



$(document).ready(function(){			
	stardust(); 
	$(function() {
		// set opacity to nill on page load
		$("ul#menu span, #do-best span, #logo span, #continue span, #submit span, #info-submit span").css("opacity","0");
		// on mouse over
		$("ul#menu span, #do-best span, #logo span, #continue span, #submit span, #info-submit span").hover(function () {
			// animate opacity to full   
			$(this).stop().animate({										
				opacity: 1
			}, 'slow');
		},
		// on mouse out
		function () {
			// animate opacity to nill
			$(this).stop().animate({
				opacity: 0
			}, 'slow');
		});
	});
	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
			  
		//Set the popup window to center
		$(id).css('top',  100);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 			
	});
	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();				
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});	
});