//Onload functions
if ( !window._onLoadFunctions ) {
  var _onLoadFunctions = [];
}

//Add an onload function.
function addOnLoadFunction( onLoadFunction ) {
  _onLoadFunctions[_onLoadFunctions.length] = onLoadFunction;
}

//Execute onload functions.
function doOnLoad() {
  for ( var i = 0; i < _onLoadFunctions.length; i++ ) {
    _onLoadFunctions[i]();
  }
}

//PNG Fix for IE
if ( document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule ) {
  document.styleSheets[0].addRule( 'div', "behavior:url('" + window.common_url + "include/iepngfix.htc')" );
  document.styleSheets[0].addRule( 'img', "behavior:url('" + window.common_url + "include/iepngfix.htc')" );
  document.styleSheets[0].addRule( '.png', "behavior:url('" + window.common_url + "include/iepngfix.htc')" );
}

// Popup window
function popup( link, target, width, height ) {
  var left = (screen.availWidth - width)/2;
  var top = (screen.availHeight - height)/2;
  var style = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1';
  var location = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
  var thepopup = window.open( link, target, style + ',' + location );
  thepopup.focus();
  return true;
}

