jQuery(document).ready(function($){
$('body').removeClass('no_js').addClass('yes_js');
$('#nav li, ul.sub-menu, ul.children').each(function(){
n = $('ul.sub-menu:not(ul.sub-menu li > ul.sub-menu), ul.children:not(ul.children li > ul.children)', this).length;
if(n) $(this).addClass('parent');
});
$('#nav ul.sub-menu li, #nav ul.children li').hover(
function()
{
$(this).stop(true, true).animate({paddingLeft:10 }, 200);
},
function()
{
$(this).animate({ paddingLeft:0 }, 200);
}
);
$('#nav ul > li').hover(
function()
{
$('ul.sub-menu:not(ul.sub-menu li > ul.sub-menu), ul.children:not(ul.children li > ul.children)', this).stop(true, true).fadeIn(300);
},
function()
{
$('ul.sub-menu:not(ul.sub-menu li > ul.sub-menu), ul.children:not(ul.children li > ul.children)', this).fadeOut(300);
}
);
$('#nav ul > li').each(function(){
if( $('ul', this).length > 0 )
$(this).children('a').append(' »')
});
$('#nav ul.sub-menu li, #nav ul.children li').hover(
function()
{
var options;
winWidth = $(document).width();
subMenuWidth = $(this).parent().outerWidth();
space = $(this).offset().left + subMenuWidth * 2;
if(space < winWidth) options = {left:subMenuWidth-20};
else options = {left:subMenuWidth*-1};
$('ul.sub-menu, ul.children', this).hide().css(options).stop(true, true).fadeIn(300);
},
function()
{
$('ul.sub-menu, ul.children', this).fadeOut(300);
}
);
function yiw_lightbox()
{
$('a.thumb').hover(
function()
{
$('zoom').appendTo(this).css({
dispay:'block',
opacity:0,
height:$(this).children('img').height(),
width:$(this).children('img').width(),
'top':$(this).css('padding-top'),
'left':$(this).css('padding-left'),
padding:0}).animate({opacity:0.4}, 500);
},
function()
{
$('.zoom').fadeOut(500, function(){$(this).remove()});
}
);
jQuery("a[rel^='prettyPhoto']").prettyPhoto({
slideshow:5000,
autoplay_slideshow:false,
show_title:false
});
}
yiw_lightbox();
$('a.socials, a.socials-small').tipsy({fade:true, gravity:'s'});
$('.toggle-content:not(.opened), .content-tab:not(.opened)').hide();
$('.toggle-title').click(function(){
$(this).next().slideToggle(300);
$(this).children('span.open-toggle').toggleClass('closed');
$(this).attr('title', ($(this).attr('title') == 'Close') ? 'Open' : 'Close');
return false;
});
$('.tab-index a').click(function(){
$(this).parent().next().slideToggle(300, 'easeOutExpo');
$(this).toggleClass('opened');
$(this).attr('title', ($(this).attr('title') == 'Close') ? 'Open' : 'Close');
return false;
});
$('.tabs-container').tabs();
$('.tabs-container').tabs( "option", "fx", { opacity: 'toggle' } );
$('#slideshow images img').show();
});