var j = jQuery.noConflict();

j(function() {

j(".gallery-item a").attr('rel','gallery[modal]');
j(".gallery-icon a").prettyPhoto({animationSpeed:'normal',theme:'pp_default', show_title : false});



        j('.two-thirds #portfolioItem li:nth-child(2n+2)').css({ marginRight: '0px'});
        j('.three-cols li:nth-child(3n+3)').css({ marginRight: '0px'});
        j('.four-cols li:nth-child(4n+4)').css({ marginRight: '0px'});
        j('.five-cols li:nth-child(5n+5)').css({ marginRight: '0px'});
        j('#blog_articles_full li:nth-child(2n+2)').css({ marginRight: '0px'});
        j('.full .ddrecentposts li:nth-child(3n+3)').css({ marginRight: '0px'});
        j('.two-thirds .ddrecentposts li').css({ marginRight: '0px'});
        j('.one-col ul li:last').css({ borderBottom: '0px'});
        j('#blog_articles li:last').css({ borderBottom: '0px'});





j('.portfolioImg img').hover(function(){

    j(this).stop().animate({ opacity: .8 }, 250);

}, function(){

    j(this).stop().animate({ opacity: 1 }, 350);

});

j('.gallery-icon img').hover(function(){

    j(this).stop().animate({ opacity: .8 }, 250);

}, function(){

    j(this).stop().animate({ opacity: 1 }, 350);

});

j('.blog_thumb_big img').hover(function(){

    j(this).stop().animate({ opacity: .8 }, 250);

}, function(){

    j(this).stop().animate({ opacity: 1 }, 350);

});

});



/* Bubble ToolTip */
function ToolTip() {

	j('ul.icons li').hoverIntent(function() {

		//adds a identifier class
		j(this).addClass('hovered');

		//fades all others
		j('ul.icons li:not(.hovered)').stop().animate({ opacity: .4 }, 250);

		//shows the balloon - 1) fixes the css - 2) animates it
		j(this).children('.tooltip').css({ display: 'block', opacity: 0, bottom: '35px' }).stop().animate({ bottom: '45px', opacity: 1 }, 200);

	}, function() {

		//disappear balloon
		j(this).children('.tooltip').fadeOut(150);

		//removes the identifier class
		j(this).removeClass('hovered');

		//makes all other lis solid again
		jQuery('ul.icons li').stop().animate({ opacity: 1 }, 200)

	});

}

/* Load Functions When DOM is Ready */

  j(document).ready(function() {

	ToolTip();

     
});



/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:30,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);


