//
// This function will take two Div Elements and set the height of the div equal.
//     It will retry 3 times to handle the case when changing the smaller div element
//     causes the larger one to grow.
//
//     The Div Elements must have an ID and they can be passed in any the order.
//     IHN Tech Support Team 01.06.2010 
function setDevHeightEqual(DivId_1,DivId_2) {
	var Div_Element1, Div_Element2, All_Divs;	
	var ElementHeight_1 = 0; var ElementHeight_2 = 0;

	// Search all the div Elements for the two of interest. 
	All_Divs = document.getElementsByTagName("div");
	for(var i=0; i < All_Divs.length;i++){ 
		if(new RegExp(DivId_1).test(All_Divs[i].id) ){
			Div_Element1 = All_Divs[i];	
		}
		else if (new RegExp(DivId_2).test(All_Divs[i].id) ){
			Div_Element2 = All_Divs[i];	
		}
	}
	if(!Div_Element1 ) {		// False
		document.write("<p>"+ DivId_1+" was Not Found! </p");
		return;
	}
	if(!Div_Element2 ) {		// False
		document.write("<p>"+DivId_2 +" was Not Found! </p");
		return;
	}

	// Alrighty then, adjust the height or the smaller div element
	// Try 5 times to get right for the case the larger changes because of the smaller increasing.
	for(var j=0; j < 5; j++){ 
		MaxHeight_1 = getElementHeight(Div_Element1);
		MaxHeight_2 = getElementHeight(Div_Element2);

		if(MaxHeight_1 > MaxHeight_2) {
			Div_Element2.style.height=MaxHeight_1 + 'px'; 
		}
		else if (MaxHeight_2 > MaxHeight_1) {
			Div_Element1.style.height=MaxHeight_2 + 'px'; 
		}
		else if (MaxHeight_2 == MaxHeight_1) {
			return;
		}
	}
}
function getElementHeight(Element) {
	if(Element.offsetHeight){ 
		return Element.offsetHeight;
	}
    else if(Element.style.pixelHeight){ 
		return  Element.style.pixelHeight;
    } 
	return 0;
}

// Java Document
function browser() {
	alert("Browser: "+ browserString() );
}
function cookies() {	
	alert("Cookies Enabled: " + navigator.cookieEnabled);
}
function browserString() {
	var browserName = ["unknown","MSIE","FireFox","Safari","Opera","Konqueror"];
	return browserName[browserIndex()];
}
// Quick function to test for Internet Explorer.
function isIE() { if(browserIndex == 1) return true; else return false; }
	
// Look for Firefox, AppleWebKit, or MISE in the user agent string.
function browserIndex() {
	var UserAgent = navigator.userAgent;
	if     (UserAgent.indexOf("MSIE") > 0)        return 1;
	else if(UserAgent.indexOf("Firefox") > 0)     return 2;
	else if(UserAgent.indexOf("Safari") > 0)      return 3;
	else if(UserAgent.indexOf("Opera") > 0)       return 4;
	else if(UserAgent.indexOf("Konqueror") > 0)   return 5;
	else                                          return 0;
}

function show_coords(event)  {
  x=event.clientX
  y=event.clientY
  alert("X coords: " + x + ", Y coords: " + y)
}
