$(document).ready(function(){
//Start common code
    
    /*Call the bookmark.js function when ready*/
    try{
        var bookmark = new Bookmark();
        bookmark.init( "http://news.bbc.co.uk/", "bookmarkContainer" );
    }catch( e ){
        
    }
    
    /*PNG fix for IE*/
    jQuery(document).pngFix(); 
    
    //Tabs
    jQuery('#tabbedContent > ul').tabs();
    
    //fake round corners
    jQuery(".genericBox").append("<span class='tl corner'></span><span class='tr corner' ></span><span class='bl corner'></span><span class='br corner'></span>");
    
    
      
    /*find the news box,
    add the "read more" link,
    hide it, 
    toogle the portion (toReveal) to show and hide*/
    
    jQuery("#primaryBox .toReveal").before("<p class='linkReadMore'><a href='#'>Show more</a></p>");
    jQuery(".toReveal").hide();
    
    jQuery(".linkReadMore").toggle(
      function () {
        jQuery(".toReveal").slideDown("slow");
        jQuery(".linkReadMore").attr("id","readLess").html("<a href='#'>Show less</a>");
        return false;
      },
      function () {
        jQuery(".toReveal").slideUp("slow");
        jQuery(".linkReadMore").removeAttr("id").html("<a href='#'>Show more</a>");
        return false;
      }
    );
    
    /*more fake corbners*/
    jQuery(".linkReadMore").append("<span class='bl corner'></span><span class='br corner'></span>");

    /*add hover state for ie 6 on the secondary navigation*/
    jQuery("#secondaryNavigation li span").hover(function(){
        jQuery(this).addClass("hover");
    },
    function(){
        jQuery(this).removeClass("hover");
    }
    
    );
    
    /*show and hide for "grouped Items"*/
    jQuery(".reveal").hide();

    
    jQuery(".moreItems a").toggle(
      function () {
        jQuery(this).parent().next().slideDown("slow");
        jQuery(this).addClass("minus");
        return false;
      },
      function () {
        jQuery(this).parent().next().slideUp("slow");
        jQuery(this).removeClass("minus");
        return false;
      }
    );
    
    
    
		
    
//End common code       
});

