// JavaScript Document


$(function() {
	$(document).snowfall();
	$('#left-top').snowfall({flakeCount : 8, maxSpeed : 3});
	$('.cirroHover').each(function(){
		var txt = $(this).attr('title');
		$(this).append('<em class="" style="position:absolute;background:#000;color:#fff">'+txt+'</em>');
		$(this).find('em').hide();
	});
	
	$('.cirroHover').hover(function(){
		var x = $(this).offset().left;	
		var y = $(this).offset().top;
		$(this).find('em').css({top: ((y*1)+12)+'px', left: x+'px'}).show('fast');
		return false;
	});
	$('.cirroHover').mouseleave(function(){
		$(this).find('em').hide('fast');
	});
	
  	$('h1').click(function(){
		window.location='index.php';
  	});
	$('input[type=text],textarea').each(function(){
		if($(this).val() == ""){
			$('input#submit').attr('disabled','true');
		}
  	});
	
	$('input[type=text],textarea').keyup(function(){
		var disabled = '';
		$('input[type=text],textarea').each(function(){
			if($(this).val() == ""){
				disabled = 'true';
			}
  		});
		$('input#submit').attr('disabled',disabled);
  	});
	
	$('a[name=modal]').click(function(e) {  
       //Cancel the link behavior  
       e.preventDefault();  
       //Get the A tag  
       id = $(this).attr('href');  
     
       //Get the screen height and width  
       var maskHeight = $(document).height();  
       var maskWidth = $(window).width();  
     
       //Set height 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',  $(window).scrollTop());  
       $(id).css('left', ($(window).width() - $(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, .window').hide();  
   });       
     
   //if mask is clicked  
   $('#mask').click(function () {  
       $(this).hide();  
       $('.window').hide();  
   });   


   
   
});