/* #######################################

				IMAGE FIXING

####################################### */

var myWidth;
var myHeight;
var contentRemove = 450;

function getSize() {
  myWidth = 0;
  myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
}


function reFixImages(obj)
{
	getSize();
	fixImages();
}


function fixImages() {
	var images = document.body.getElementsByTagName("IMG");
	var maxWidth = myWidth-contentRemove;
	var fixcount=0;
	var nullcount=0;
	var wantalert=true;
	var badImgs = "";
	for(i=0; i<images.length; i++)
	{
		if(images[i].width > maxWidth || images[i].clientWidth>maxWidth)
		{
			fixcount = fixcount+1;
			var w = images[i].width
			var h = images[i].height
			var rat = maxWidth/w
			images[i].height = h*rat
			images[i].width = maxWidth
		}
	}
}

function onLoadSite()
{
	getSize();
	fixImages();
}