	$(document).ready(function(){	
		
		// png fix
		if (jQuery.browser.msie && parseInt(jQuery.browser.version) <7) {
			$(document).pngFix();
		}
		
		// slider
		$("#slider").easySlider({
			auto: true, 
			continuous: true,
			controlsShow: false
		});
		
		
		
		if (jQuery.browser.msie && parseInt(jQuery.browser.version) <=7) {

			// hide & show effect
			$('.btn_go').click(function () {	
				$('.p1').fadeOut('800', function () {
					$('.p2').fadeIn('800');	
				});
				
				return false;
			});

			$('.btn_back').click(function () {
				$('.p2').fadeOut('800', function () {
					$('.p1').fadeIn('800');	
				});
				return false;
			});			
			
		} else {

			// scrolling effect
			$('.btn_go').click(function () {	
				$('#mask').scrollTo('.p2', '500');
				$('#page').val('.p2');
				return false;
			});

			$('.btn_back').click(function () {
				$('#mask').scrollTo('.p1', '500');
				$('#page').val('.p1');
				return false;
			});		
			
			$(window).resize(function () {
				$('#mask').scrollTo($('#page').val(), '50');
			});				
			
		}		

		
	});	


    // speed in milliseconds
	var scrollSpeed = 70;
	
	// set the default position
	var current = 0;

	// set the direction
	var direction = 'h';

	function animateBG(){

    	// 1 pixel row at a time
	    current -= 1;
   
	    // move the background with backgrond-position css properties
	    $('table.clouds').css("backgroundPosition", (direction == 'h') ? current+"px bottom" : "0 " + current+"px");
   
	}

	//Calls the scrolling function repeatedly
	var init = setInterval("animateBG()", scrollSpeed);	

	
