// portfolio images hover

var $j = jQuery.noConflict();
var maxNr = 10;
$j(document).ready(function() {
$j('.box ul').each(function(i, el) {
	$j(el).find('li:last').addClass("no-border");
});

$j('.content_widgets').each(function(i, el) {
	$j(el).find('div.box:eq(2)').addClass("no_margin");
});

$j('.footer_widgets').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 3 == 0)
		{		
			$j(el).find('div.box:eq('+j+')').addClass("no_margin");
		}
	}
});

$j('.wrap').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 3 == 0)
		{		
			$j(el).find('.shadow_services:eq('+j+')').addClass("no_margin");
			$j(el).find('.shadow_team:eq('+j+')').addClass("no_margin");
			$j(el).find('.shadow_sponsors:eq('+j+')').addClass("no_margin");
			$j(el).find('.shadow_sidebar .flickr li:eq('+j+')').addClass("no_margin");
		}
		if(j % 2 != 0)
		{
			$j(el).find('.shadow_portfolio:eq('+j+')').addClass("no_margin");
		}
	}
	
	$j(el).find('.social li:eq(3)').addClass("no_margin");
	$j(el).find('.social li:eq(7)').addClass("no_margin");
	
	$j(el).find('ul.menu li a:first-child').addClass("main-menu");
	$j(el).find('ul.menu ul li a:first-child').removeClass("main-menu");
	$j(el).find('ul.menu li a:first-child').wrapInner("<span>" + "</span>");

	$j(el).find('ul.menu li ul li:first-child').before($j('<li class="top_corners"><span></span></li>'));
	$j(el).find('ul.menu li ul li:last-child').after($j('<li class="bottom_corners"><span></span></li>'));
	
});
for(var j = 0; j <= maxNr; j++)
{
	if((j + 1) % 3 == 0)
	{		
		$j("div.wrap div.shadow_services").eq(j).after($j('<div class="clear"></div>'));
		$j("div.footer_widgets div.box").eq(j).after($j('<div class="clear"></div>'));
	}
}

$j("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
										
//Append a div with hover class to all the LI
$j('#navMenu li').append('<div class="hover"><\/div>');

<!--Menu -->
// initialise plugins
$j(document).ready(function() { 
$j('ul.menu').supersubs({ 
         	minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason.  
}); 
			
});


    
// Cufon font
Cufon.replace('h1', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('h2', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('h3', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('h4', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('h5', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('h6', {hover: true, textShadow: '2px 1px white'});
Cufon.replace('.footer_twitter'); 
Cufon.replace('.footer_widgets h2', {hover: true, textShadow: '1px 1px black'})
Cufon.replace('.motto h1', {textShadow: '1px 1px black'})
Cufon.replace('a.follow_twitter ', {hover: true});
Cufon.replace('.slogan p ', {hover: true});
Cufon.replace('.featured_post_content h1.title', {hover: true, textShadow: '2px 1px black'});
Cufon.replace('.featured_post_content h2 ', {hover: true, textShadow: '2px 1px black'});
Cufon.replace('.featured_post_content h3 ', {hover: true, textShadow: '2px 1px black'});
Cufon.replace('.featured_post_content h4 ', {hover: true, textShadow: '2px 1px black'});
Cufon.replace('.featured_post_content h5 ', {hover: true, textShadow: '2px 1px black'});
Cufon.replace('.featured_post_content h6 ', {hover: true, textShadow: '2px 1px black'});