jQuery(document).ready(function() {
   var preload = new Array('/fileadmin/templates/images/bBCRegionsHover.gif', '/fileadmin/templates/images/bCareerOppHover.gif', '/fileadmin/templates/images/bCareerPlanningHover.gif', '/fileadmin/templates/images/bGoOn.gif','/fileadmin/templates/images/bHomeHover.gif','/fileadmin/templates/images/bNewsEventHover.gif','/fileadmin/templates/images/bSearchOn.gif','/fileadmin/templates/images/ContactUsOn.gif','/fileadmin/templates/images/GlossaryOn.gif','/fileadmin/templates/images/TextBiggerOn.gif','/fileadmin/templates/images/TextSmallerOn.gif','/fileadmin/templates/images/bFindJobOn.gif');
   
   var loader = new Array();
   jQuery.each(preload, function(i) {
      loader[i] = new Image();
      loader[i].src = this;
   });

   $('#pageGradient > a + h2').css('margin-top', '0');
   var divider = '<tr><td colspan="2"><img src="/fileadmin/templates/images/COB_divider.gif" alt="divider" width="208" height="1" border="0" /></td></tr>';
   $('table.quickFacts tr').before(divider);
   $('table.quickFacts tr:last-child').after(divider);
   //swfobject.embedSWF("/fileadmin/templates/flashMap.swf", "flashMap", "512", "264", "8");
   //replace with T3 extension that changes the default loaded image
   /*$('#homePhotoBottom').attr("src","/fileadmin/templates/images/homePhoto"+lastPhotoSelected+"Bottom.jpg");
   		
   $('#changePhotoNav img').each(function(i,val){
   		$(this).bind("click",function(){
   			var c = $(this).attr("id").substr(3,1);
   			swapImages(c);
   		});
   		$(this).bind("mouseover",function(){
   			var c = $(this).attr("id").substr(3,1);
   			if($(this).attr("id").substr(3,1) != lastPhotoSelected)
   				$(this).attr("src","/fileadmin/templates/images/bCP-"+c+"Hover.gif");
   		});
   		$(this).bind("mouseout",function(){
   			var c = $(this).attr("id").substr(3,1);
   			if($(this).attr("id").substr(3,1) == lastPhotoSelected)
   				$(this).attr("src","/fileadmin/templates/images/bCP-"+c+"On.gif");
   			else
   				$(this).attr("src","/fileadmin/templates/images/bCP-"+c+"Off.gif");
   		});
   });
   $('#findHome1').bind("mouseover",function(){
   			var c = lastPhotoSelected;
   			$(this).attr("src","/fileadmin/templates/images/bFindJobP"+c+"On.jpg");
   		});
   $('#findHome1').bind("mouseout",function(){
   			var c = lastPhotoSelected;
   			$(this).attr("src","/fileadmin/templates/images/bFindJobP"+c+"Off.jpg");
   		});
   function swapImages(which){
   		$("#CP-"+lastPhotoSelected).attr("src","/fileadmin/templates/images/bCP-"+lastPhotoSelected+"Off.gif"); 
   		$("#CP-"+which).attr("src","/fileadmin/templates/images/bCP-"+which+"On.gif"); 
   		$('#p'+orig).css("background-image","url(/fileadmin/templates/images/homePhoto"+which+"Top.jpg)");
   		$('#findHome1').attr("src","/fileadmin/templates/images/bFindJobP"+which+"Off.jpg");
   		$('#homePhotoBottom').attr("src","/fileadmin/templates/images/homePhoto"+which+"Bottom.jpg");
   		lastPhotoSelected = which;
   }*/
   
   $('div.chapter h2').prepend('+ ').wrapInner('<a href="#"></a>');
   $('div.chapter').each(function() {
      $(this).before($(this).children('h2').clone());
      $(this).children('h2').remove();
   });
   $('div.chapter').prev('h2').children('a').click(function() {
      var section = $(this).parent().next('div.chapter').get(0);
      if ($(section).css('display') == 'none') {
      	this.innerHTML = "- " + this.innerHTML.substr(2,this.innerHTML.length-2);
         $(section).show();
         
      }
      else {
         $(section).hide();
         this.innerHTML = "+ " + this.innerHTML.substr(2,this.innerHTML.length-2);
      }
      return(false);
   });
});

function show(n){
document.getElementById(n).style.display='block';
}

function hide(n){
document.getElementById(n).style.display='none';
}

function showNav(n){
document.getElementById(n).style.display='block';
}

function hideNav(n){
document.getElementById(n).style.display='none';
}
