/* Function to stretch the content columns and the bbcpageservices box down to the same level 
   This has to be done after loading as Safari doesn't seem to have access to the stylesheets otherwise */
   
window.onload=function(){

    if (! document.getElementById){ return; }   

   
    // ref to anchor points in bottom left nav and at bottom of content
    var lhn_bottom = document.getElementById('lhn_bottom');    
    var cols_bottom = document.getElementById('cols_bottom');
    
   
    
    // to prevent errors dues to missing ID's and older browsers    
    if (! lhn_bottom || ! lhn_bottom.offsetTop || ! cols_bottom){ return; }
  
    
    // This bit sets the height of the bbcpageservices table cell, done this way because it doesn't have an ID set on it.  
       
    var obj = document.styleSheets;
    
    // go thorugh document stylesheets
    for (var i = 0; i < obj.length; i++){
    
        var obj2 = obj[i];        
         
         // cross-browser ref to css rules  
         if (obj2.cssRules){         	
        	var obj_rules = obj2.cssRules;
         }else if (obj2.rules){        	
        	var obj_rules = obj2.rules;
         }else{
        	var obj_rules = "";
        }     
        	
        // look for the td.bbcpageservices rule and set it using the anchor points defined above
        for (var j=0; j < obj_rules.length; j++){	        	
        	
            if (obj_rules[j].selectorText && obj_rules[j].selectorText.toLowerCase() == "td.bbcpageservices"){                           
               obj_rules[j].style.height = (cols_bottom.offsetTop - lhn_bottom.offsetTop);
            }
        }       
     }
     
     
     
}