                                                                                                                                                                                                                                                                                /*
    Jquery Document Ready
*/
$(function () {

try{
$('#mobile').click(function (){
   $.cookie("mobile_agent", "true",{ path: '/', domain: 'thebrf.org', expires: 1 });
window.location="/Mobile/Home";
return false;
   });
  
}catch(e){}

try{

$(".foundNews:last").css("border-bottom","0px none");

}catch(err){}


try{
$('#Home .grid_5 img').hide();}
catch(e){}

    $('.navLink').each(function () {
//alert($(this).width());
        var w = $(this).width() + 8;
        w= w%2?w-1:w;
        $(this).siblings('ul').find('a').each(function () {
            $(this).width(w);
            $(this).css('min-width',w);
        });
    });

try{
		var hiddenNav = $("#hiddenNav").attr("rel");
		$(".nav li[rel="+hiddenNav+"] > a").addClass("selected");
	}catch(err){}


	try{
	 	var hiddenNav = $("#hiddenNav").attr("rel");
	 	$(".sub li[rel="+hiddenNav+"] > a").addClass("selected");
                   $(".nav ul a[rel="+hiddenNav+"]").parent().parent().siblings('a').addClass("selected");
	}catch(err){} 

try{
	 	var hiddenNav = $("#hidNav").attr("rel");
	 	$(".sub li[rel="+hiddenNav+"] > a").addClass("selected");
	}catch(err){} 




   try{ $("#slides").slides({
        play: 6000,
        pause: 5000,
        hoverPause: true,
        fadeSpeed: 350,
        crossfade: true,
        effect: 'fade'

    });

   }catch(e){} 


try{
$('.otherArticle span').each(function(){
var a = $(this).html();
if(!jQuery.trim(a)){
$(this).hide();
}
});
}catch(e){}

try{
$('.otherNews p').each(function(){
var b= $(this).html();
if(!jQuery.trim(b)){
$(this).hide();
}
});
}catch(e){}

try{
$('.interiorpg .grid_7 p').each(function(){
var c = $(this).html();
if(!jQuery.trim(c) || c=='&nbsp;'){
$(this).hide();
}
});
}catch(e){}

try{
$('.sub ul').each(function(){
var f = $(this).html();
if(!jQuery.trim(f)){
$(this).hide();
}
});
}catch(e){}

try{
var totalst = $('.interiorpg .areas li').length;
var halfst = totalst/2;
var leftcol = "";
var rightcol = "";
$('ul.areas li').each(function(i){
if(i>=totalst){

}
else if(i>=halfst){
rightcol += "<li>"+$(this).text()+"</li>";
}else{
leftcol += "<li>"+$(this).text()+"</li>";
}
});
$('ul.areas').html(leftcol);
$('ul.areasright').html(rightcol);
}catch(e){}

});


/*
    Functions
*/
// Cufon.replace('#Home h2,h1');
try{
   Cufon.replace('#Home h3,h2',{ fontFamily: 'News Gothic Std' }); 
Cufon.replace('a.call strong',{ fontFamily: 'Avenir LT Std' });


}catch(e){}

try{
var fixed = true;
$(document).scroll(function() {
    if( $(this).scrollTop() >= 205) {
        if( !fixed ) {
            fixed = true;
            $('ul.sub').css({position:'fixed',top:0}); // Or set top:20px; in CSS
        }                                          // It won't matter when static
    } else {
        if( fixed ) {
            fixed = false;
            $('ul.sub').css({position:'static'});
        }
    }
});
}catch(e){}
    

   

    

    

    

    

    

    

    

    
