	/* Lavalamp Code */
	
	$(function() {
        $("#1").lavaLamp({
            fx: "backout",
            speed: 700,
            click: function(event, menuItem) {
                return true;
            }
        });
    });
    
    /* End Lavalamp Code */
    
    
    /* Slidernav Code */
    
    $(document).ready(function() {
	  $("#slider").SexySlider({
	    width     : 821,
	    height    : 224,
	    delay     : 3000,
	    strips    : 1, // <-- this do the trick
	    autopause : false,
	    navigation: '#slidernav',
	    control   : '#control',
	    effect    : 'fountain'
	  });
	});
	
	/* End Slidernav Code */
	
	
	/* Sifr Code */
	
	var max = {src: 'meta.swf'};
		
		sIFR.activate(max);
		
		sIFR.replace(max, {
			selector: '.infotitle',
			wmode: 'transparent',
			css: {'.sIFR-root': { 'color': '#8d8762',}},
			filters: {
		      DropShadow: {
		        knockout: false
		        ,distance: 1
		        ,color: '#d8d8d8'
		        ,strength: 1
		      }
		    }
		});
		
	/* End Sifr Code */
	
	
	
	/* Boxslider Code */
	
	$(document).ready(function(){
		//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
		//Vertical Sliding
		$('.boxgrid.slidedown').hover(function(){
			$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
		});
		//Horizontal Sliding
		$('.boxgrid.slideright').hover(function(){
			$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
		});
		//Diagnal Sliding
		$('.boxgrid.thecombo').hover(function(){
			$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
		});
		//Partial Sliding (Only show some of background)
		$('.boxgrid.peek').hover(function(){
			$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
		});
		//Full Caption Sliding (Hidden to Visible)
		$('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
		});
		//Caption Sliding (Partially Hidden to Visible)
		$('.boxgrid.caption').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
		});
	});
			
	/* End Boxslider Code */
	
	// Form validation
	$('#contact_form').validate();
	
	// AJAX form
	$('form#contact_form').submit(function() {
		if ($('label.error:visible').length !== 0) {
			return false;
		}
		
		var s = $(this).serialize();
		
		if (($(this).attr('action') === '') || ($(this).attr('action')==='#')) 
			action = '?'; 
		else 
			action = $(this).attr('action');

		$.ajax({
			type: $(this).attr('method'),
			data: s,
			url: action,
			success: function(result) {
				if (result == '1') {
					alert('E-mail sent');
					$('form#contact_form')[0].reset();
				}
				else { 
					alert('E-mail can not be sent!');
				}
				
				return false;
			}
		});	

		return false;
	});	

	

	

