var $j = jQuery.noConflict();
var maxNr = 500;
$j(document).ready(function() {
							
<!-- Add border 0 to the last li -->					
$j('.box ul').each(function(i, el) { $j(el).find('li:last').addClass("no-border"); });
$j('.wrap').each(function(i, el) { $j(el).find('.post_entry:last, .portfolio_gallery_holder:last').addClass("no-border"); });
$j('ul.menu').each(function(i, el) { $j(el).find('li:last').addClass("no-back"); });
$j('ul.menu').each(function(i, el) { $j(el).find('li:first').addClass("no-padding"); });

$j(".portfolio_box").hover(function()
{ $j(this).css("background-image","url(wp-content/themes/corporate/images/portfolio_over.png)"); }, function(){ $j(this).css("background-image","none"); });

$j(".portfolio_box img, .portfolio_box_slide img, .related_posts_box img, .sidebar img, .post_entry.blog img").hover(function()
{ $j(this).animate({opacity: .7,left: '0px'}, "500"); }, function(){ $j(this).animate({opacity: 1,left: '0px'}, "500"); });



<!-- Add margin 0 to the fourth box -->
$j('.footer').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 4 == 0) { $j(el).find('div.box:eq('+j+')').addClass("no_margin"); }
	}
});

<!-- Add margin 0 to the third li -->
$j('.sidebar .widget_flickr, .footer .widget_flickr').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 3 == 0) { $j(el).find('li:eq('+j+')').addClass("no_margin"); }
	}
});

<!-- Add margin 0 to the fourth box -->
$j('.wrap').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 3 == 0) { $j(el).find('div.portfolio_box:eq('+j+')').addClass("no_margin"); }
	}
});

<!-- Add margin 0 to the third box -->
$j('.main').each(function(i, el) {
	for(var j = 0; j <= maxNr; j++)
	{
		if((j + 1) % 3 == 0) { $j(el).find('.box:eq('+j+')').addClass("no_margin"); }
	}
});

<!-- Div clear after first row of boxes -->
for(var j = 0; j <= maxNr; j++)
{
	if((j + 1) % 3 == 0) { $j("div.main .box").eq(j).after($j('<div class="clear"></div>')); }
	
	if((j + 1) % 3 == 0) { $j("div.home_widgets .box").eq(j).after($j('<div class="clear"></div>')); }
	
	if((j + 1) % 4 == 0) { $j("div.wrap .portfolio_box_slide").eq(j).after($j('<div class="clear"></div>')); }
	
	if((j + 1) % 4 == 0) { $j("div.footer .box").eq(j).after($j('<div class="clear"></div>')); }
}

<!--prettyPhoto -->
$j("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});

<!--Menu -->
$j(document).ready(function() {	$j("ul.menu").superfish(); }); 
			
});

// Cufon font
Cufon.replace('h1, h2, h3, h4, h5, h6', {hover: true});

