var maxWindowWidth=650;
var minWindowWidth=420;
var maxPersonWidth=200;
var minPersonWidth=100;	
var defaultOtherWidth=maxWindowWidth-maxPersonWidth; 

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof(window.onload)!= 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function winr(e){
	
	var newWindowWidth=$("articleComplete").offsetWidth;
	
	if (maxWindowWidth!=newWindowWidth || 1==1 ){
		if (typeof($("articleImageIMG"))!="undefined"){

			var defaultImageWidth = $("articleImageIMG").offsetWidth;
			var defaultImageHeight = $("articleImageIMG").offsetHeight;
			var imageRatio = defaultImageWidth / defaultImageHeight;
			var imageToTextRatio = maxWindowWidth / maxPersonWidth;
				
			personWidth = newWindowWidth / imageToTextRatio;
			
			var imageHeight = personWidth / imageRatio;
			var newImageWidth=personWidth;
			
			//$("articleContent").style.marginRight=newImageWidth+"px";
			$("subColPerson").style.width=newImageWidth+"px";
			$("articleContentSpacer").style.width=newImageWidth+"px";
			$("articleImage").style.width=newImageWidth+"px";
			$("articleImageIMG").style.width=newImageWidth+"px";
			$("articleImageIMG").style.height=imageHeight+"px";
			$("subColPerson").style.marginTop="-" + imageHeight+"px";
			
		}
	}
	oldWindowWidth=newWindowWidth;
}
function wininsider(e){
	
	var newWindowWidth=$("articleComplete").offsetWidth;
	
	if (maxWindowWidth!=newWindowWidth || 1==1 ){
		if (typeof($("articleImageIMG"))!="undefined"){

			var defaultImageWidth = $("articleImageIMG").offsetWidth;
			var defaultImageHeight = $("articleImageIMG").offsetHeight;
			var imageRatio = defaultImageWidth / defaultImageHeight;
			var imageToTextRatio = maxWindowWidth / maxPersonWidth;

			personWidth = newWindowWidth / imageToTextRatio;
			
			imageHeight = personWidth / imageRatio;
			var newImageWidth=personWidth;
			
			$("articleImage").style.width=newImageWidth+"px";
			$("articleImageIMG").style.width=newImageWidth+"px";
			$("articleImageIMG").style.height=imageHeight+"px";
			
		}
	}
	oldWindowWidth=newWindowWidth;
}

function initRun(){
	winr(false);
	Event.observe(window,"resize",winr,true);
}

function initInsideRun(){
	wininsider(false);
	Event.observe(window,"resize",wininsider,true);
}