function get_xmlHTTP_object() {
	var xml_http;
	try {	//IE
		xml_http = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e) {	//other browsers
		xml_http = new XMLHttpRequest();
	}
	return xml_http;
}

function RenamePagingText(sTableName) {
	var oTbl = document.getElementById(sTableName);
	var oPagerRow;
	var oControls;
	var oControl;
	var x;
	
	if (oTbl.rows.length > 0) {
		oPagerRow = oTbl.rows.item(oTbl.rows.length - 1);
		oControls = oPagerRow.cells[0].childNodes;
		for(x=0;x < oControls.length; x++){
			if (oControls[x].innerHTML) {
				if (oControls[x].innerHTML != '...') {
					if (x < oControls.length - 1) {
						oControls[x].innerHTML = 'Page ' + oControls[x].innerHTML + '  |  ';
					}
					else {
						oControls[x].innerHTML = 'Page ' + oControls[x].innerHTML;
					}
				}
				else {
					if (x < oControls.length - 1) {
						oControls[x].innerHTML = oControls[x].innerHTML + '  |  ';
					}
				}
			}
		}		
	}
}
	
function CheckOtherHowDidYouHear() {	
	var dlHowDidYouHear = document.getElementById('dlHowDidYouHear');
	var txtOtherHowDidYouHear = document.getElementById('txtOtherHowDidYouHear');
	
	if (dlHowDidYouHear) {
		if (dlHowDidYouHear.value == 'Other') {
			txtOtherHowDidYouHear.style.display = '';
			
		}
		else {
			txtOtherHowDidYouHear.style.display = 'none';
		}
	}
}

//toggle display for elements on the page
//flag:	is the flag to display true or false
//element_string: comma-delimited list of elements to display or hide based on flag
function toggleDisplay(flag, element_string) {
	//get elements from element string
	var elements = element_string.split(',');
	//set display = 'block' if it should be shown, otherwise display = 'none'
	var display = (flag) ? 'block' : 'none';
	//loop through requested elements to show or hide
	for (index = 0; index < elements.length; index++) {			
	
		if (document.getElementById(elements[index]) != null) {
			//set the display to block or none
			document.getElementById(elements[index]).style.display = display;
		}
	}
}

//used on calce control to collapse panels
function switchCollapse(pre,id){
	var i=0;
	var i2=0;
	var i3='';
	if (pre=='calc'){i2=11;}else{i2=6;}
	for (i=1;i<=i2;i++)
	{
		if(i<10){i3='0'+i}else{i3=i}
		//document.getElementById(pre+i3).className='calcHidden';
		document.getElementById(pre+i3).style.display='none';
		document.getElementById(pre+'Header'+i3).style.fontWeight='normal';		
	}

	if (document.getElementById(pre+id).style.display='none') 
		{
		//document.getElementById(pre+id).className='calcShow';
		document.getElementById(pre+id).style.display='inline';
		document.getElementById(pre+'Header'+id).style.fontWeight='bold';
		}			
	else
		//{document.getElementById(pre+id).className='calcHidden';}	
		{document.getElementById(pre+id).style.display='none';
		document.getElementById(pre+'Header'+id).style.fontWeight='';}
}