	jQuery(document).ready(function(){
  		  			
  		$('#home').click(function () {	
			$('#border-top').animate( { backgroundPosition:'509px 0' }, 600 );
			$('#content-slider').animate( { marginLeft:"0" }, 600);
                  
    	});
    	
    	$('#templates').click(function () {
  			$('#border-top').animate( { backgroundPosition:'723px 0' }, 600 );
			$('#content-slider').animate( { marginLeft:"-800px" }, 600);  			
                  
    	});
    	    	
    	$('.templateLink').click(function () {
  			$('#border-top').animate( { backgroundPosition:'723px 0' }, 600 );
			$('#content-slider').animate( { marginLeft:"-800px" }, 600);
                  
    	});
    	
    	$('#examples').click(function () {
  			$('#border-top').animate( { backgroundPosition:'937px 0' }, 600 );
			$('#content-slider').animate( { marginLeft:"-1600px" }, 600); 
                  
    	});
    	
    	$('#contact').click(function () {
  			$('#border-top').animate( { backgroundPosition:'1151px 0' }, 600 );
			$('#content-slider').animate( { marginLeft:"-2400px" }, 600 );
                  
    	});    	    	  
    	
    	
    	setInterval('homeShow()', 10000);
  		setInterval('tempShow()', 2000); 
  		setInterval('egShow()', 5000);
    	
    	    			
	});



function homeShow() {
    	
    	var lastimgchk = $('#homeshow img:last').attr('class');
    	
    	if (lastimgchk == 'current') {
    	
    	$('#homeshow img:first').addClass('active').animate({opacity: 1.0}, 1000, function() {
            $('#homeshow img:last').removeClass('current');
            $('#homeshow img:last').css({opacity: 0});
            $('#homeshow img:first').addClass('current');
            $('#homeshow img:first').removeClass('active');
        });
    	    	
    	} else {
    	
    	var $current = $('#homeshow img.current');
    	var $active = $('#homeshow img.current + img');
    	
    	$active.addClass('active').animate({opacity: 1.0}, 1000, function() {
            $current.removeClass('current');
            $current.css({opacity: 0});
            $active.addClass('current');
            $active.removeClass('active');
        });
    	    	    			
		
		}
		
		}


function tempShow() {
    	
    	var lastimgchk = $('#tempshow img:last').attr('class');
    	
    	if (lastimgchk == 'current') {
    	
    	$('#tempshow img:first').addClass('active').animate({opacity: 1.0}, 1000, function() {
            $('#tempshow img:last').removeClass('current');
            $('#tempshow img:last').css({opacity: 0});
            $('#tempshow img:first').addClass('current');
            $('#tempshow img:first').removeClass('active');
        });
    	    	
    	} else {
    	
    	var $current = $('#tempshow img.current');
    	var $active = $('#tempshow img.current + img');
    	
    	$active.addClass('active').animate({opacity: 1.0}, 1000, function() {
            $current.removeClass('current');
            $current.css({opacity: 0});
            $active.addClass('current');
            $active.removeClass('active');
        });
    	    	    			
		
		}
		
		}    	
		
function egShow() {
    	
    	var lastimgchk = $('#egshow img:last').attr('class');
    	
    	if (lastimgchk == 'current') {
    	
    	$('#egshow img:first').addClass('active').animate({opacity: 1.0}, 1000, function() {
            $('#egshow img:last').removeClass('current');
            $('#egshow img:last').css({opacity: 0});
            $('#egshow img:first').addClass('current');
            $('#egshow img:first').removeClass('active');
        });
    	    	
    	} else {
    	
    	var $current = $('#egshow img.current');
    	var $active = $('#egshow img.current + img');
    	
    	$active.addClass('active').animate({opacity: 1.0}, 1000, function() {
            $current.removeClass('current');
            $current.css({opacity: 0});
            $active.addClass('current');
            $active.removeClass('active');
        });
    	    	    			
		
		}
		
		} 		
		
		