//***************************************
var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){

	var page_request = false

	if (window.XMLHttpRequest){ // if Mozilla, Safari etc

		page_request = new XMLHttpRequest()

	}else if (window.ActiveXObject){ // if IE

		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		}

		catch (e){

			try {
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}

			catch (e){}
		}
	}else{
		return false
	}

	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid)
	}

	page_request.open('GET', url, true)
	page_request.send(null)
}

function loadpage(page_request, containerid){

	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(containerid).innerHTML=page_request.responseText
	}
}

//***************************************
function TableRowChangeColor(tableRow, highLight) {
	if (highLight) {
		tableRow.style.backgroundColor = '#ffcc99';
		document.body.style.cursor = 'pointer';
	}else{
		tableRow.style.backgroundColor = '#ffffff';
		document.body.style.cursor = 'default';
	}
}
function TableRowDoNav(theUrl) {
	document.location.href = theUrl;
}

//***************************************
function rogToggleRowBeingEdited(theLayer, tableRow) {
	/* theLayer = div to hide or show */
	/* tableRow = row from table where selection is made */
	var e = document.getElementById(theLayer);
	if(	e.style.display		== "block"){
		e.style.display		= "none";
		e.style.visibility	= "hidden";
		tableRow.style.backgroundColor = '#ffffff';

	}else{
		e.style.display		= "block";
		e.style.visibility	= "visible";
		tableRow.style.backgroundColor = '#cccccc';
	}
}


//***************************************
function rogBoxLimiter(theForm,theField,theLabel,theLimiter,theMethod){
	var cnt = theLimiter;
	var tex = theField.value;
	var len = tex.length;

	if(len > cnt){
			tex = tex.substring(0,cnt);
			theField.value = tex;
			return false;
	}

	if (theMethod == "CountBackward"){
		document.getElementById(theLabel.name).innerHTML = cnt-len;
	}else if (theMethod == "CountForward"){
		document.getElementById(theLabel.name).innerHTML = len + " of " + cnt;
	}
}

//***************************************
function rogToggleStartsHidden(eID){
	var e = document.getElementById(eID);
	if(	e.style.display		== "block"){
		e.style.display		= "none";
		e.style.visibility	= "hidden";
	}else{
		e.style.display		= "block";
		e.style.visibility	= "visible";
	}
}
function rogToggleStartsVisible(eID){
	var e = document.getElementById(eID);
	if(	e.style.display		== "none"){
		e.style.display		= "block";
		e.style.visibility	= "visible";
	}else{
		e.style.display		= "none";
		e.style.visibility	= "hidden";
	}
}
function rogToggleStartsHideMe(eID){
	var e = document.getElementById(eID);
	e.style.display		= "none";
	e.style.visibility	= "hidden";
}
function rogToggleStartsShowMe(eID){
	var e = document.getElementById(eID);
	e.style.display		= "block";
	e.style.visibility	= "visible";
}


//***************************************
function RogeeBI400x300(url){
	rbiWin1 = window.open(url,'RogeeBI400','WIDTH=400,height=300,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0');
	rbiWin1.focus();
}

function RogeeBI640x480(url){
	rbiWin2 = window.open(url,'RogeeBI650','WIDTH=640,height=480,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0');
	rbiWin2.focus();
}

function RogeeBI800x640(url) {
	rbiWin3 = window.open(url,"RogeeBI800","WIDTH=800,height=640,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0");
	rbiWin3.focus();
}

function RogeeBI980x720(url) {
	rbiWin4 = window.open(url,"RogeeBI980","WIDTH=980,height=720,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0");
	rbiWin4.focus();
}

function RogeeBI1028x768(url) {
	rbiWin4 = window.open(url,"RogeeBI1028","WIDTH=1028,height=768,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0");
	rbiWin4.focus();
}

