var $j = jQuery.noConflict();

$j(function(){
	//newsdetail
	if(!$j('#breakingnews').is('div')){
		$j('#pagenav').show();
		$j('.contentpaneopen-newsdetail img').each(function(){
			if($j(this).parent().parent().is('td.contentpaneopen-newsdetail')){
				$j(this).attr('class','detail_image');
			}
		});
		$j('.module-advance').before($j('.module-usermenu'));//.hide();
	}else{
		$j('.moduletable-morenews').hide();
	}
	//** remove category breadcrumbs in news **/
	if($j('.module-newssection').is('div')){
		$j('a.pathway').each(function(i){
			if(i == 2) $j(this).hide().next().hide();
		})
	}
	//directory
	if($j('#clickablemap').is('img')){
		$j('.moduletable-boxbottom td center + br').hide();
		$j('.moduletable-boxbottom').show();
	}
	//archive
	if($j('.componentheading-ijarchive').is('span')){
		$j('span.componentheading-ijarchive')
		.parent().attr('class', 'archive-heading')
		.next().attr('class', 'archive-creator')
		.next().attr('class', 'archive-category')
		.next().attr('class', 'archive-content')
		.next().attr('class', 'archive-date')
		.next().attr('class', 'archive-word');
	}
	$j('.sectiontableentry1-ijarchive b a, .sectiontableentry2-ijarchive b a').attr('class', 'archive-entry');
	$j('.sectiontableentry1-ijarchive ul, .sectiontableentry2-ijarchive ul').attr('class', 'archive-list');
	$j('.sectiontableentry1-ijarchive b:has(ul) ul, .sectiontableentry2-ijarchive b:has(ul) ul').removeAttr('class').addClass('archive-years');
	//MyBlog
	if($j('#fp-content-index').is('div')){
        $j('div.moduletablevolunteer div.box').each(function(i){
            i++;
            (i%2) ? $j(this).addClass('odd') : $j(this).addClass('even');
        });
    }else{
        $j('div.moduletablevolunteer').hide();
    }
    //CB
	$j('.cbProfile .cbPosMiddle').removeAttr('style').width(160);
	$j('.cbProfile .cbPosRight').removeAttr('style').width(540);
	$j('.cbProfile .cbPosRight .cbStatusList tr td').each(function(i){
		i++;
        (i%2) ? $j(this).removeAttr('style').addClass('odd') : $j(this).removeAttr('style').removeAttr('width').addClass('even');
	});
	$j('#CB select[name*=editor]').parent().parent().hide();
	$j('#cbMenuNav #menu1').hide();
	
	//Field projects
	if ($j('.moduletable-boxtop').is('div')){
        var c = false;
        $j('span.pagenav').each(function(){
            if ($j(this).text() == '1') c = true;
        });
        if(!c) $j('.moduletable-boxtop').hide();
    };
	
});
