var IE = document.all?true:false

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/layout/home_over.gif");
		sections_home_over = newImage("images/layout/sections_over.gif");
		links_home_over = newImage("images/layout/links_over.gif");
		about_home_over = newImage("images/layout/about_over.gif");
		contact_home_over = newImage("images/layout/contact_over.gif");
		preloadFlag = true;
	}
}

var myWidth = 0, myHeight = 0, myTotalHeight = 0, htmlheight = 0, alerta = 0;

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

function myResize(){
	var elem;
	heightGrabber();
	if(myWidth>630){
		elem = document.getElementById("stretchbar");
		elem.style.width = myWidth - (IE?380:400);
		elem = document.getElementById("jbsward");
		elem.style.width = myWidth - (IE?0:20);
		elem = document.getElementById("content");
		elem.style.width = myWidth - (IE?250:270);
		elem = document.getElementById("b_columns");
		elem.style.width = myWidth - (IE?0:20);
		elem = document.getElementById("footer");
		elem.style.width = myWidth - (IE?0:22);
		 
		if(!IE){
			document.body.style.height = htmlheight;
			elem = document.getElementById("b_columns");  
			elem.style.height = htmlheight - 158;
			elem = document.getElementById("left_bar");  
			elem.style.height = htmlheight - 158;
			elem = document.getElementById("content");  
			elem.style.height = htmlheight - 158; 
			elem = document.getElementById("right_bar");  
			elem.style.height = htmlheight - 158;
		}
	}	
}
