function alertSize() {
  var myWidth = 0; //, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth - 20;
    //myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    //myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    //myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myWidth;
}
function getRefToDiv(divID,oDoc) {
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
      if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
          //repeatedly run through all child layers
          for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
              //on success, return that layer, else return nothing
              y = getRefToDiv(divID,oDoc.layers[x].document); }
          return y; } }
  if( document.getElementById ) {
      return document.getElementById(divID); }
  if( document.all ) {
      return document.all[divID]; }
  return false;
}

function rePosition() {
	var tempy = alertSize();
	if( tempy > 800 ) {
		myReference = getRefToDiv( 'side-bar' );
		if( myReference ) {
	  		if( myReference.style ) { myReference = myReference.style; }
	  		var noPx = document.childNodes ? 'px' : 0;
			myReference.left =205 + (tempy/2) + noPx;
		}
	}
}

window.onload = function(e) {
  rePosition();
}

window.onresize = function(e) {
  rePosition();
}

