// JavaScript Document

//DataTable_oddrow
//DataTable_evenrow

var browser = navigator.appName;
if(browser == "Netscape"){
displayString = "table-row";
} else {
displayString = "block";
}



function RowOn(rowid,rowstyle) {
if (document.getElementById("Row_"+rowid+"a") || document.getElementById("Row_"+rowid+"b")) {	
	document.getElementById("Row_"+rowid+"a").className='DataTable_HighlightRow';
	document.getElementById("Row_"+rowid+"b").className='DataTable_HighlightRow';
	} else {
	document.getElementById("Row_"+rowid).className='DataTable_HighlightRow';
	}
}

function RowOff(rowid,rowstyle) {
if (document.getElementById("Row_"+rowid+"a") || document.getElementById("Row_"+rowid+"b")) {	
	document.getElementById("Row_"+rowid+"a").className='DataTable_'+rowstyle+'row';
	document.getElementById("Row_"+rowid+"b").className='DataTable_'+rowstyle+'row';
	} else {
	document.getElementById("Row_"+rowid).className='DataTable_'+rowstyle+'row';
	}
}

function ShowHideDataRow(rowid) {
	if (document.getElementById("Row_"+rowid+"b").style.display!='none') {
	document.getElementById('DTC_'+rowid).src=document.getElementById('DTC_'+rowid).src.replace('open','closed');
	document.getElementById('DTC_'+rowid).alt='Show';	
	document.getElementById('DTC_'+rowid).title='Show';	
	document.getElementById("Row_"+rowid+"b").style.display='none';
	} else {
	document.getElementById('DTC_'+rowid).src=document.getElementById('DTC_'+rowid).src.replace('closed','open');
	document.getElementById('DTC_'+rowid).alt='Hide';	
	document.getElementById('DTC_'+rowid).title='Hide';	
	document.getElementById("Row_"+rowid+"b").style.display=displayString;		
	}
}



function confirmDelete(etitle) {
var agree=confirm("Are you sure you wish to delete the record: "+etitle+"?");
if (agree)
	return true ;
else
	return false ;
}


function blockshow(rowid,blockid) {
document.getElementById("block"+blockid+"_"+rowid).style.visibility='visible';
}

function blockhide(rowid,blockid) {
document.getElementById("block"+blockid+"_"+rowid).style.visibility='hidden';
}

function SendAjaxQuery(EventString,QueryPage,ResponseBlock) {
				if (window.XMLHttpRequest)
				{
					req = new XMLHttpRequest();
				} 
				else if (window.ActiveXObject) 
				{
					try {
						req = new ActiveXObject("Msxml2.XMLHTTP");
					} catch (e)
					{
						try {
							req = new ActiveXObject("Microsoft.XMLHTTP");
						} catch (e) {}
					}
					}
		
				req.onreadystatechange = function()
				{ 
					if(req.readyState == 4)
					{
						if(req.status == 200)
						{
							TableContent = req.responseText;	
							ResponseBlock.innerHTML=TableContent;
					}	
						else	
						{

							TableContent = "Error: returned status code " + req.status + " " + req.statusText;
							ResponseBlock.innerHTML=TableContent ;
						}	
					} 
				}; 
				
				
				req.open("POST", QueryPage, true); 
				req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");       
				req.send(EventString); 






}



