
$(window).bind('load', function() {
	 $('div#header a#title').show().animate({top: "0"},1000,"easeOutExpo");
     var i = 1;
     var imgs = $('.image').length;
     var int = setInterval(function() {
     //console.log(i); check to make sure interval properly stops

     if(i >= imgs) clearInterval(int);
     $('.image:hidden').eq(0).fadeIn(200);
     i++;
     }, 500);
     
});

function hover(){

	$('a.image_link').hover(function(){
	    $('.image',this).stop().fadeTo(400, 0.3);
	    $('.image_holder',this).css("background-image", 'url(images/magnifier.png)');
		}, function() {
		$('.image',this).stop().fadeTo(300, 1);
	});
};

/*-----------------------------------------------------------------------------------*/
/*	Preload - images - Quicksand
/*-----------------------------------------------------------------------------------*/
function preload_images(){
	 $('.image.big').wrap('<div class="image_holder big"></div>');
     $('.image.medium').wrap('<div class="image_holder medium"></div>');
     $('.image.small').wrap('<div class="image_holder small"></div>');
};

/*-----------------------------------------------------------------------------------*/
/*	Slide panel
/*-----------------------------------------------------------------------------------*/
function slide_panel(){
	$('div.section_content a.info').toggle(function(){
		$(this).parent('div.section_content').animate({top: "5"},400,"easeInOutBack");
		}, function() {
		$(this).parent('div.section_content').animate({top: "40"},400,"easeInOutBack");
	});
};

function initMenu() {
$('.more').hide();
$('.read-more').click(
function() {
    $(this).prev().prev().slideToggle('normal');
    if($(this).html()=="<em>Show Less</em>") $(this).html('<em>Read More</em>');
    else $(this).html('<em>Show Less</em>');
    return false;
}
);
}


$(document).ready(function() {
        initMenu();
    
        $('.image.big').wrap('<div class="image_holder big"></div>').hide();
        $('.image.medium').wrap('<div class="image_holder medium"></div>').hide();
        $('.image.small').wrap('<div class="image_holder small"></div>').hide();
        
        hover();
 		$.preloadCssImages();

		$(".dropdown li").hover(function(){
			var dropDown = $(this).children("ul");
			var ulWidth = dropDown.width();
			var liWidth = $(this).width();
			var posLeft = (liWidth - ulWidth)/2;
			dropDown.css("left",posLeft);		
		});	

		$("ul.tabs").tabs("> .tabcontent", {
			tabs: 'li', 
			effect: 'fade'
		});
		
	$(".recent_posts li:odd").addClass("odd");

	$(".row .col:first-child").addClass("alpha");
	$(".row .col:last-child").addClass("omega"); 
	
// toggle content
	$(".toggle_content").hide(); 
	
	$("h3.toggle").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});
	
	$("h3.toggle").click(function(){
		$(this).next(".toggle_content").slideToggle();
	});
	
	$(".table-price tr:even").addClass("even");
	
});

