/*-----------------------------------------------------------------------------------*/
/*	IMAGE HOVER
/*-----------------------------------------------------------------------------------*/
$(function() {
$('#drop a img, #right-side img, .list a img').css("opacity","1.0");	
$('#drop a img, #right-side img, .list a img').hover(function () {										  
$(this).stop().animate({ opacity: 0.85 }, "fast"); },	
function () {			
$(this).stop().animate({ opacity: 1.0 }, "fast");
});
});


/*-----------------------------------------------------------------------------------*/
/*	PORTFOLIO & CAROUSEL IMAGE HOVER
/*-----------------------------------------------------------------------------------*/

$(function() {
$(".galleries ul.grid img, .carousel a img").css("opacity","1.0");
$(".galleries ul.grid img, .carousel a img").hover(function () {
$(this).stop().animate({ opacity: 0.75 }, "fast");  },
function () {
$(this).stop().animate({ opacity: 1.0 }, "fast");  
}); 
});

$(function() {
$(".enlarge, .details, .play").css("opacity","0.75");
$(".enlarge, .details, .play").hover(function () {
$(this).stop().animate({ opacity: 1.0 }, "fast");  },
function () {
$(this).stop().animate({ opacity: 0.75 }, "fast");  
}); 
});
 
$(document).ready(function() {
	$(".tagcloud a, ul.tabs li a, .next a, .page-navi li a").append("<span></span>");	
});


/*-----------------------------------------------------------------------------------*/
/*	TOGGLE AND TABS
/*-----------------------------------------------------------------------------------*/

$(document).ready(function(){
//Hide the tooglebox when page load
$(".togglebox").hide();
//slide up and down when click over heading 2
$("h4").click(function(){
// slide toggle effect set to slow you can set it to fast too.
$(this).toggleClass("active").next(".togglebox").slideToggle("slow");
return true;
});
});


var $j = jQuery.noConflict(); 
$j(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$j("ul.tabs").tabs("div.panes > div");
});

/*-----------------------------------------------------------------------------------*/
/*	POST SCROLL
/*-----------------------------------------------------------------------------------*/

$(function() {

    function scroll(direction) {

        var scroll, i,
                positions = [],
                here = $(window).scrollTop(),
                collection = $('.post');

        collection.each(function() {
            positions.push(parseInt($(this).offset()['top'],10));
        });

        for(i = 0; i < positions.length; i++) {
            if (direction == 'next' && positions[i] > here) { scroll = collection.get(i); break; }
            if (direction == 'prev' && i > 0 && positions[i] >= here) { scroll = collection.get(i-1); break; }
        }

        if (scroll) {
            $.scrollTo(scroll, {
                duration: 750       
            });
        }

        return false;
    }

    $("#next,#prev").click(function() {        
        return scroll($(this).attr('id'));        
    });

    $(".scrolltoanchor").click(function() {
        $.scrollTo($($(this).attr("href")), {
            duration: 750
        });
        return false;
    });

});

/*-----------------------------------------------------------------------------------*/
/*	PORTFOLIO HOVER
/*-----------------------------------------------------------------------------------*/

jQuery(function($){
				
				$('.fade').mosaic({
        speed		: 250
    });
				
		    
		    });
		    
/*-----------------------------------------------------------------------------------*/
/*	CYCLE SLIDER
/*-----------------------------------------------------------------------------------*/		    
		    
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    $(pager).find('li').removeClass('activeLI')
        .filter('li:eq('+currSlideIndex+')').addClass('activeLI');
};
$(function() {
    $('#cycle-slider').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 5000,
        pause: 0,
        pager:  '#nav',
        cleartypeNoBg: true,
        pagerAnchorBuilder: function(idx, slide) {
            return '#nav li:eq(' + (idx) + ') a';
        }
    });
});

		    
/*-----------------------------------------------------------------------------------*/
/*	PRETTYPHOTO
/*-----------------------------------------------------------------------------------*/	

$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square', autoplay_slideshow: false, overlay_gallery: false});
		});
