(function () {
  var Dom = YAHOO.util.Dom,
      Event = YAHOO.util.Event;

  var fix_centre_col = function () {
    var fixedWidth        = 314;
    var buffer            = 3;
    var pageWrapperRegion = Dom.getRegion("pageWrapper");
    var colsRegion        = Dom.getRegion("grid_cols");
    var leftC             = Dom.get("left_col");
    var rightC            = Dom.get("right_col");

    /* get the middle col fixed width as % to work out % of left and right cols */
    var fixedColWidth = ( (fixedWidth / colsRegion.width) * 100 );
  
    var outsideColWidth = (100 - fixedColWidth) - buffer;

    /* set the page to a fixed width otherwise the right col 
       will drop below the middle col when the page is resized */
    Dom.setStyle("pageWrapper", "width", pageWrapperRegion.width+"px");

    Dom.setStyle(leftC, "width", fixedWidth+"px");
    Dom.setStyle(rightC, "width", outsideColWidth+"%");
  
  }
  
  Event.onDOMReady(fix_centre_col);
}) ();
