/*-- img preloader --*/
	$(function () {
		$('.preloader img').hide();
	});

	var i = 0;
	var int=0;
	$(window).bind("load", function() {
		var int = setInterval("doThis(i)",500);
	});

	function doThis() {
		var images = $('.preloader img').length;
		if (i >= images) {
			clearInterval(int);
		}
		$('.preloader img:hidden').eq(0).fadeIn(500);
		i++;
	}
/*--// img preloader --*/

$(document).ready(function(){

/*-- superfish menu --*/
        $('ul.sf-menu').superfish({ 
            delay:       500,                     
            animation:   {height:'show'},  				
            speed:       500,                   
            autoArrows:  true,                          
			disableHI:   true,              				
            dropShadows: true                         
        }); 
/*--// superfish menu --*/

/*-- Tooltip --*/
	$(function() {
		$('.tooltip').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
			});
		});
/*--// Tooltip --*/	
	
/*-- jCarousel lite controls --*/
	$(function() {
	  $(".carousel").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		speed: 1000
	  });
	});

/*--// jCarousel lite controls --*/

/*-- cuffon replacements --*/
Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('h5');
Cufon.replace('h6');
/*-- cuffon replacements --*/

/*-- smooth scroller --*/
 jQuery('a[href*=#]').click(function() {
 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 && location.hostname == this.hostname) {
   var jQuerytarget = jQuery(this.hash);
   jQuerytarget = jQuerytarget.length && jQuerytarget
   || jQuery('[name=' + this.hash.slice(1) +']');
   if (jQuerytarget.length) {
  var targetOffset = jQuerytarget.offset().top;
  jQuery('html,body')
  .animate({scrollTop: targetOffset}, 1000);
    return false;
   }
 }
  });
/*--// smooth scroller --*/

/*-- img opacity--*/
$(".thumb img").fadeTo("slow", 0.7); 

$(".thumb img").hover(function(){
	$(this).fadeTo("slow", 1.0); 
}
,function(){
	$(this).fadeTo("slow", 0.7); 
});

/*--// img opacity--*/

/*-- hide info boxes --*/
$('.close').click(function() {
  $(this).parent('.info_box').fadeOut('slow');
});
/*--// hide info boxes --*/

/*-- sidebar tabbed content --*/
$('#tabMenu > li').click(function(){

    if (!$(this).hasClass('selected')) {    
    $('#tabMenu > li').removeClass('selected');
    $(this).addClass('selected');
    $('.boxBody div').slideUp('1500');
    $('.boxBody div:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('1500'); 
   }

  }).mouseover(function() { 
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() { 
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

  $('.boxBody #category li').mouseover(function() {

    $(this).css('color','#666');

  }).mouseout(function() {

  });  
	
  $('.boxBody li').click(function(){
    window.location = $(this).find("a").attr("href");
  }).mouseover(function() {
  }).mouseout(function() {
  });  	
/*--// sidebar tabbed content --*/

/*-- portfolio switch view --*/
    $("a.switch_thumb").toggle(function(){
        $(this).addClass("swap");
        $("ul.display").fadeOut("fast", function() {
            $(this).fadeIn("fast").removeClass("thumb_view");
        });
    }, function () {
        $(this).removeClass("swap");
        $("ul.display").fadeOut("fast", function() {
            $(this).fadeIn("fast").addClass("thumb_view");
        });
    }); 
/*--// portfolio switch view --*/

/*-- fancybox plugin --*/
$("a.fancy").fancybox();
/*--// fancybox plugin --*/

});




