
function doGet(sURL) {
	var http = null;
	try {
		http = new XMLHttpRequest();
		http.overrideMimeType("text/xml");
	} catch(err) {  // for IE
		http = new ActiveXObject( "Microsoft.XMLHTTP" );
	}
    http.open( "GET", sURL, false );	// Execute the request
    http.send(null);					
    return http.responseText;			// Return the text
}

// get the entire querystring
function get_qs() {
	var loc = window.location
	var parts = String(loc).split('?')				// Split on '?'
	if (parts.length < 2) { return null; } // If no args, return null
	else { return parts[1] }
}

// parse out the name-value pairs from location string
function get_args() {

	var name_vals = {}
	var qs = get_qs()
	if ( qs == null ) { return name_vals; } // If no args, return
	
	parts = qs.split('&')					// Now split args into individual name=val string
	for (var i=0; i< parts.length; i++) {
		nv   = parts[i].split('=')
		name = nv[0]
		if (nv.length > 1) { val = nv[1] }
		else               { val = null  }
		name_vals[name] = val
	}
	return name_vals
}

function mainmenuover(el, id) {
	// Change the style of the table cell on mouse over
	menuitemover(el)
	
	if(id) {
		// Position dropdown menu below item, left-aligned
		var dd = document.getElementById(id)
		var crds = coords(el)
		dd.style.left = crds.x - 1
		dd.style.top  = crds.y + 25
		
		// Display the dropdown menu
		submenuover(id);
	}
}

function mainmenuout(el, id) {
	// Modify menu item display and hide submenu
	menuitemout(el) 
	if(id) { submenuout(id); }
}


function submenuover(id) {
	document.getElementById(id).style.visibility='visible'
}

function submenuout(id) {
	document.getElementById(id).style.visibility='hidden'
}

function menuitemover(el) {
	// change color of item when mouseover
	el.style.backgroundColor="#FFE0E0";
	el.style.color="#000000"; 
	el.style.cursor="hand";
}

function menuitemout(el) { 
	// change color of item when mouseout
	// A bold font style signals the currently selected menu
	if (el.style.fontWeight == 'bold') {
		el.style.backgroundColor="#FFFFFF"; 
		el.style.color="#000000";
	} else {
		el.style.backgroundColor="#800000"; 
		el.style.color="#FFFFE0"; 
	}
}

function coords(el) {
	var crds = { x: 0, y: 0 };
	while (el) {
		crds.x += el.offsetLeft;
		crds.y += el.offsetTop;
		el = el.offsetParent;
	}
	return crds
}

//function domove(el){
//	var db = document.getElementById('id_debug')
//	var crds = coords(el)
//	db.innerText="Coords: (x:" + crds.x + ", y:" + crds.y + ")";
//	db.innerText="Coords: (" + event.clientX + ", " + event.clientY + ")";
//}

