function openAutoCoverageLevels() { window.open('auto_coverage_levels.php', 'auto_coverage_levels', 'width=800,height=375,toolbar=no,menubar=no,left=295,top=50,screenX=200,screenY=250'); return false; }
function openSICFinder() { window.open('sicfinder.php', 'sicfinder', 'width=550,height=190,toolbar=no,menubar=no,left=395,top=200,screenX=200,screenY=250'); return false; }
function saveSICCode() { window.opener.__main.sicCode.value = document.__main.sicCode.value; window.close(); }

function checkMoveCursor(source, target, maxLength) { 
	var noSpace = source.value; source.value = noSpace.replace( /\s/g, '' );
	if (source.value.length == maxLength) { target.focus(); }
}

function getDocObj(elem,parent) {
    if (document.layers) {
        if (parent) { return "document."+parent+".document."+elem; }
        else { return "document."+elem; }
    }
    else if (document.all){ return "document.all."+ elem; }
    else if (document.getElementById) { return "document.getElementById('"+elem+"')"; }
}

// Browser Display of Table Row
function bdtr() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("msie") != -1) { return 'block'; } else { return 'table-row'; }
}

// Ajax Routines
function GetXmlHttpObject() {

	var xmlHttp = null;
	try {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp = new XMLHttpRequest();
	}
	catch ( e ) {
	  // Internet Explorer
		try {
	    	xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
		}
	  	catch ( e ) {
	    	xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
	    }
	}
	
	if ( xmlHttp == null ) {
	  	var serverScript = "logajaxerror.php";
		var x = new Image();
		x.src = serverScript;
	}
	
	return xmlHttp;
	
}