// by Paul@YellowPencil.com and Scott@YellowPencil.com
// feel free to delete all comments except for the above credit

function setTall() {
	if (document.getElementById) {
		// the divs array contains references to each column's div element.  
		// Replace 'center' 'right' and 'left' with your own.  
		// Or remove the last one entirely if you've got 2 columns.  Or add another if you've got 4!
		var divs = new Array(document.getElementById('navigation'), document.getElementById('content'));
		
		// Let's determine the maximum height out of all columns specified
		var maxHeight = 0;
		var divI = -1;
    for (var i = 0; i < divs.length; i++) {
    if (divs[i].offsetHeight > maxHeight)  {
    maxHeight = divs[i].offsetHeight;
    divI = i;
    }
    }
    
		
		// Let's set all columns to that maximum height
		for (var i = 0; i < divs.length; i++) {
			if (divI == i)
			   break;
			divs[i].style.height = maxHeight + 'px';

			// Now, if the browser's in standards-compliant mode, the height property
			// sets the height excluding padding, so we figure the padding out by subtracting the
			// old maxHeight from the new offsetHeight, and compensate!  So it works in Safari AND in IE 5.x
			if (divs[i].offsetHeight > maxHeight) {
				divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
			}
		}
	}
}

window.onload = function() {
	//alert("hello");
	//document.getElementById('right').style.height = "1600px";
	setTall();
}

window.onresize = function() {
	setTall();
}

function MM_preloadImages() 
   { 
      //v3.0
      var d=document; 

      if(d.images)
      { 
         if(!d.MM_p)
            d.MM_p=new Array();
    
         var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
         for(i=0; i<a.length; i++)
         {
            if (a[i].indexOf("#")!=0)
            {
               d.MM_p[j]=new Image; 
               d.MM_p[j++].src=a[i];
            }
         }
      }
   }
   
   function swapImage(element, src) {
   	element.old_src = element.src;
   	element.src = src;
   }
   
   function swapBack(element) {
   	element.src = element.old_src;
}
