monthNames = new Array(11);
monthNames[0] = 'January';
monthNames[1] = 'February';
monthNames[2] = 'March';
monthNames[3] = 'April';
monthNames[4] = 'May';
monthNames[5] = 'June';
monthNames[6] = 'July';
monthNames[7] = 'August';
monthNames[8] = 'September';
monthNames[9] = 'October';
monthNames[10] = 'November';
monthNames[11] = 'December';
ClientDate = new Date();
day = ClientDate.getDate();
switch (day){
	case 1:
		day=day+"st";
		break;
	case 2:
		day=day+"nd";
		break;
	case 3:
		day=day+"rd";
		break;
	case 21:
		day=day+"st";
		break;
	case 22:
		day=day+"nd";
		break;
	case 23:
		day=day+"rd";
		break;
	case 31:
		day=day+"st";
		break;
	default:
		day=day+"th";
		break;
}
month = ClientDate.getMonth();
year = ClientDate.getYear();
hours = ClientDate.getHours();
minutes = ClientDate.getMinutes();
if (minutes<10) minutes='0'+minutes;
//format date output
ClientDate='<b>'+day+' '+monthNames[month]+' '+year+'</b>';

var browser=(navigator.appName.indexOf("Netscape")!=-1)?(0):(1); //IE or NN?
//var randomName=new Array("rainbow1","rainbow2","rainbow3","rainbow4","rainbow5","rainbow6");
var rnd=Math.round(Math.random()*5)+1;
var rndimg="<img src='images/rainbow"+rnd+".jpg' width='170' height='130' border='0'\/>"



function tom1() {
window.open("http://www.tomslaw.com","MackayInfo","width=780,height=580,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");
}
function automated1() {
window.open("http://www.fisma.org/automated_documentation/","AutomatedInfo","width=600,height=580,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");
}
function capital1() {
window.open("http://www.beerandpartners.com/contact1.htm","CapitalInfo","width=700,height=650,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");
}
function defop() {
window.open("region.definitions.php","RegionDefInfo","width=700,height=580,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");	
}
function openPopUp(src) {
window.open(src,"ImagePopUp","width=727,height=580,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");	
}
function EmailToFriend(src) {
window.open(src,"Friend","width=600,height=475,status=0,toolbar=0,menubar=0,location=no,resizable=no,scrollbars=yes");	
}

	// File list routines
	function doChangeAll(form, state) {
		alert(state);
		for (var i = 0; i < form.elements.length; i++) {
			var e = form.elements[i];
			if (e.name != 'check_all' && e.type == 'checkbox')
				e.checked = state;
		}
	}
	function ChangeAll(form, state) {
		for (var i = 0; i < form.elements.length; i++) {
			var e = form.elements[i];
			if (e.name != 'check_all' && e.type == 'checkbox')
				e.checked = state;
		}
	}


	function doSelectAll(form) {
		ChangeAll(form, form.elements('check_all').checked);
	}

	function SelectAll(form) {
	ChangeAll(form, form.elements('check_all').checked);
	}
	
	function syncSelected(form, element) {
		var checkAll = form.elements['check_all'];
		if (element.checked) {
			var allChecked = true;
			for (var i = 0; i < form.elements.length; i++) {
				var e = form.elements[i];
				if (e.name != 'check_all' && e.type == 'checkbox' && !e.checked) {
					allChecked = false;
					break;
				}
			}
			checkAll.checked = allChecked;
		}
		else {
			if (checkAll.checked)
				checkAll.checked = false;
		}
	}

	function do_DeleteSingleFile(form, element, confirmMessage) {
		if (confirm(confirmMessage)) {
			doChangeAll(form, false);
			element.checked = true;
			form.elements['event'].value = 'DeleteFiles';
			form.submit();
		}
	}

	function do_checkSelected(form, event, message) {
		for (var i = 0; i < form.elements.length; i++) {
			var e = form.elements[i];
			if (e.name != 'check_all' && e.type == 'checkbox' && e.checked) {
				if (confirm('Are you sure?')) {
				form.elements['event'].value = event;
				form.submit();
				return;
				}
				else {
				return;
				}
			}
		}
		alert(message);
	}


function makePopUp1(src) {
window.open(src,"ImagePopUp","width=600,height=480,status=0,toolbar=0,menubar=0,location=no,resizable=yes,scrollbars=yes");	
}
var Wheight='500';
var Wwidth='600';
function makePopUp(src) {
window.open(src+'&enteredEvent=center',"ImagePopUp","width="+Wwidth+",height="+Wheight+",status=0,toolbar=0,menubar=0,location=no,resizable=yes,scrollbars=yes");
}
function GoToOpenerUlr(obj,src) {
obj.document.location=src;
obj.focus();
}
function chloc(htt,event) {
a=document.location.toString().split(':/\/');
s=a[1].split('&enteredEvent=');
if (htt) {
	if (s[1]!='undefined') {
	  document.location='http:/\/'+s[0]+'&enteredEvent='+event;
	  }
	  else {
      document.location='http:/\/'+a[1]+'&enteredEvent='+event;
	  }
  }
  else {
	if (s[1]!='undefined') {
	  document.location='https:/\/'+s[0];
	  }
	  else {
      document.location='https:/\/'+a[1];
	  }
  }
}
function eventHandler() {
a=document.location.toString().split('&enteredEvent=');
if (a[1]=='SuccessfulUpdate') {
window.opener.document.location.reload();
window.opener.focus();
window.close();
}
if (a[1]=='compdetails') {
window.opener.document.location=document.forms.document.compdetails.value;
chloc(0);
window.opener.focus();
}
if (a[1]=='compdocs') {
window.opener.document.location=document.forms.document.compdocs.value;
chloc(0);
window.opener.focus();
}
if (a[1]=='center') {
if (document.layers) {
  widthobj='innerWidth';
  heightobj='innerHeight';
  }
  else {
  widthobj='screen.width';
  heightobj='screen.height';
  }
x=eval("window."+widthobj+"/2-Wwidth/2");
y=eval("window."+heightobj+"/2-Wheight/2");
window.moveTo(x,y);
}
}
function loading(obj) {
if (document.layers) {
obj.submit();
}
else {
document.all['con'].style.visibility='hidden';
document.all['con'].style.position='absolute';
document.all['load'].style.visibility='visible';
}
}