var myOffsetH = 500;
var myOffsetW = 740;
var minTop = 0;
var minLeft = 0;
function ieSetup() { window.onresize = reBox; }
function reBox() {
	var TheCheat = document.getElementById('cheater');
	var TheCBox = document.getElementById('truC');
	var RealSizeH = TheCheat.offsetHeight;
	var RealSizeW = TheCheat.offsetWidth;
	var RealCSizeH = TheCBox.offsetHeight;
	var RealCSizeW = TheCBox.offsetWidth;
	myOffsetH = RealSizeH;
	myOffsetH = RealSizeW;
	var TheMiddle = (RealSizeW / 2);	
	document.getElementById('leftBar').style.height = RealSizeH-184+"px";
	document.getElementById('rightBar').style.height = RealSizeH-184+"px";
	document.getElementById('CFrame').style.height = RealSizeH-184+"px";
	document.getElementById('rightBar').style.left = RealSizeW-190+"px"; 
	document.getElementById('CFrame').style.width = RealSizeW-191-191+"px";
	document.getElementById('CFrame').style.left = 191+"px";
	// document.getElementById('truC').style.width = RealSizeW-201-201+"px";	
}
// starting main contetnt grabber
var M_contentJax
function doM_Content(DocID) { 
	M_contentJax=GetXmlHttpObject();
	var url="CMS/apps/_content.cfm";
	url=url+"?docid="+DocID;
	url=url+"&randInt="+Math.random();
	M_contentJax.onreadystatechange=doContentView;
	M_contentJax.open("GET",url,true);
	M_contentJax.send(null);
}
function doI_Content(DocID,ItemID) { 
	M_contentJax=GetXmlHttpObject();
	var url="CMS/apps/UGalDataReturn.cfm";
	url=url+"?docid="+DocID+"&id="+ItemID+"&randInt="+Math.random();
	M_contentJax.onreadystatechange=doContentView;
	M_contentJax.open("GET",url,true);
	M_contentJax.send(null);
}
function loadContent(thisLink) {
	M_contentJax=GetXmlHttpObject();
	M_contentJax.onreadystatechange=doContentView;
	M_contentJax.open("GET",thisLink,true);
	M_contentJax.send(null);
}
var newwin;
function launchWin(winurl,winname,winfeatures){
		thisFList = "location=1,status=1,scrollbars=1,resizable=1,height=600,width=800";
         newwin = window.open(winurl,winname,thisFList);
         setTimeout('newwin.focus();',250);        
 }
function doContentView() { 
	if (M_contentJax.readyState==4) { 
//	document.getElementById("M_Content").style.background="#FFFFFF";
	
		if (M_contentJax.responseText.indexOf('<!--imamap-->') > -1) {
			timedLoad();
		} else if (M_contentJax.responseText.indexOf('<!--imaOpenTable-->') > -1) {
			setmyDate();
			ShowDay();
		} else if (M_contentJax.responseText.indexOf('<!--imalink-->') > -1) { 
			linkArr = M_contentJax.responseText.split('~');
			if (linkArr[2] == 1) { window.parent.location= linkArr[1]; // window.open(linkArr[1],'_blank');    // launchWin(linkArr[1],'popUp');
			} else if (linkArr[2] == 0) { window.parent.location="loadContent(linkArr[1])" // loadContent(linkArr[1]);
			}
		} else {
			document.getElementById("truC").innerHTML=M_contentJax.responseText;
		
		}
	}
}
// check that AJAX is possible and define an AJAX object.
function GetXmlHttpObject() {
	var MyAjax=null;
	try {
  		// Firefox, Opera 8.0+, Safari
  		MyAjax=new XMLHttpRequest();
  	}
	catch (e) {
  		// Internet Explorer
  		try { MyAjax=new ActiveXObject("Msxml2.XMLHTTP"); }
  		catch (e) { MyAjax=new ActiveXObject("Microsoft.XMLHTTP"); }
  	}
	return MyAjax;
} 
var hottColor="#EEEEEE";
var baseColor="#EEEEEE";
var overColor="#FFFFFF";
var txtOnCol="#851d1c";
var txtOffCol="#000000";
var txtHotCol="#579493";
var idone = null;
// older and 'bit' rollover action
function doMe(myDiv){
	if(idone != myDiv){
		myDiv.style.background=overColor;
		myDiv.style.color=txtOnCol;
	}
}
function undoMe(myDiv){
	if(idone != myDiv){
		myDiv.style.background=baseColor;
		myDiv.style.color=txtOffCol;
	}
}
// Photogallery large image open script.
var imageJax
function placePhoto(DocID,myID) {	

	imageJax=GetXmlHttpObject();
	var url="CMS/apps/PGalDataReturn.cfm";
	url=url+"?docid="+DocID;
	url=url+"&id="+myID;
	url=url+"&randInt="+Math.random();
	imageJax.onreadystatechange=doImageView;
	imageJax.open("GET",url,true);
	imageJax.send(null);
	
	var TheCheat = document.getElementById('cheater');
	var RealSizeH = TheCheat.offsetHeight;
	var RealSizeW = TheCheat.offsetWidth;
	document.getElementById('spareDiv1').style.width = RealSizeW+"px";
	document.getElementById('spareDiv1').style.height = RealSizeH+"px";
	document.getElementById('spareDiv1').style.background = "#eeeeee";
	document.getElementById('spareDiv1').style.filter = "alpha(opacity=50)";
	document.getElementById('spareDiv1').style.KHTMLOpacity = ".50";
	document.getElementById('spareDiv1').style.MozOpacity = ".50";
	document.getElementById('spareDiv1').style.opacity = ".50";
	document.getElementById('spareDiv1').style.zIndex = "1001";
	document.getElementById('spareDiv2').style.zIndex = "1002";
		document.getElementById('spareDiv1').style.left = minLeft+"px";
		document.getElementById('spareDiv2').style.left = minLeft+"px";
		document.getElementById('spareDiv1').style.top = 10+"px";
		document.getElementById('spareDiv2').style.top = "20px";
	//	document.getElementById('spareDiv2').style.background = "#000000";
	document.getElementById('spareDiv2').style.height = RealSizeH-200+"px";
	document.getElementById('spareDiv2').style.width = RealSizeW-200+"px";
	
	
}
function doImageView() { 
	if (imageJax.readyState==4) { 
	document.getElementById('spareDiv2').innerHTML = imageJax.responseText;
	}
}
// Hide Photo.<div></div>
function hidePhoto() {	
	document.getElementById('spareDiv1').style.width = "1px";
	document.getElementById('spareDiv2').style.width = "1px";
	document.getElementById('spareDiv1').style.height = "1px";
	document.getElementById('spareDiv2').style.height = "1px";
	document.getElementById('spareDiv1').style.background = "#579493";	
//	document.getElementById('spareDiv2').style.background = "#579493";
	document.getElementById('spareDiv1').innerHTML = "&nbsp;";
	document.getElementById('spareDiv2').innerHTML = "&nbsp;";
	document.getElementById('spareDiv1').style.top = "1px";
	document.getElementById('spareDiv2').style.top = "1px";
	document.getElementById('spareDiv1').style.left = "1px";
	document.getElementById('spareDiv2').style.left = "1px";
}




