function setHomePage(){
	}

function sendMail(n2,d2,e2,s2,b2){
	if(s2 == '') s2 = ' ';
	var r2 = 'mailto:' + n2 + '@' + d2 + '.' + e2 + '?subject=' + s2 + '&body=' + b2;
	document.location.href = r2;
	}

function newWindow(linkURL,n,w,h){
	LeftPosition = 0;
	TopPosition = 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=yes,toolbar=yes,menubar=yes,status=yes,location=yes';
	if (n != "FullScreen") {
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? ((screen.height-h)/2) - 40 : 0;
		if (n == "MinMax") {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		else if (n == "NoScroll") {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		else {
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no,directories=no,toolbar=no,menubar=no,status=no,location=no';
			n = "";
			}
		}
	else {
		var h = (screen.availHeight - 152).toString();
		var w = (screen.availWidth - 10).toString();
		settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=no,toolbar=yes,menubar=yes,status=yes,location=no';
	}
	var win = null;
	linkURL = linkURL + '.htm';
	win = window.open(linkURL,n,settings)
	if(win.window.focus){win.window.focus();}
		}

function openURL(subName,domainName,tldName){
	LeftPosition = 0;
	TopPosition = 0;
	var h = (screen.availHeight - 152).toString();
	var w = (screen.availWidth - 10).toString();
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes,directories=no,toolbar=yes,menubar=yes,status=yes,location=no';
	var win = null;
	win = window.open('http://' + subName + '.' + domainName + '.' + tldName,"Title",settings)
	if(win.window.focus){win.window.focus();}
	}

function makeArray(n){
    this.length = n;
    for (i=1;i<=n;i++){
        this[i]=0;
    }
    return this;
}

function displayDate(){
    var this_month = new makeArray(12);
    this_month[0]  = "January";
    this_month[1]  = "February";
    this_month[2]  = "March";
    this_month[3]  = "April";
    this_month[4]  = "May";
    this_month[5]  = "June";
    this_month[6]  = "July";
    this_month[7]  = "August";
    this_month[8]  = "September"; 
    this_month[9]  = "October";
    this_month[10] = "November";
    this_month[11] = "December";
    var today = new Date();
    var day   = today.getDate();
    var month = today.getMonth();
    var year  = today.getYear();
	var hours = today.getHours();
	var minutes = today.getMinutes();
	var seconds = today.getSeconds();
    if (year < 1900){
        year += 1900;
    }
	if (day < 10){
	    return(this_month[month]+" "+"0"+day+", "+year);
	}
	else {
	    return(this_month[month]+" "+day+", "+year);
	}
}

function confirmYesNo(courseID,sch)
	{
		var UcourseID = courseID.toUpperCase();
		if (sch == "Y")
			{
				fullcourseID = ('training/' + courseID);
				newWindow(fullcourseID,'FullScreen','','');
			}
		else {
				var userChoice = confirm('There are no sessions currently scheduled for course "' + UcourseID + '". If there is sufficient interest, we will hold a special session. If you are interested, please contact us.\n\nClick [ OK ] to view the course details or [ Cancel ] to return.');
			}
		if (userChoice == true)
			{
				fullcourseID = ('training/' + courseID);
				newWindow(fullcourseID,'FullScreen','','');
			}
	}

function clock() {
	if (!document.layers && !document.all) return;
		var digital = new Date();
		var hours = digital.getHours();
		var minutes = digital.getMinutes();
		var seconds = digital.getSeconds();
		var amOrPm = "AM";
	if (hours > 11) amOrPm = "PM";
<!--	if (hours > 12) hours = hours - 12; //-->
	if (hours == 0) hours = 12;
	if (hours <= 9) hours = " " + hours;
	if (minutes <= 9) minutes = "0" + minutes;
	if (seconds <= 9) seconds = "0" + seconds;
		dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
	if (document.layers) {
		document.layers.pendule.document.write(dispTime);
		document.layers.pendule.document.close();
		}
	else
		if (document.all)
		pendule.innerHTML = dispTime;
		setTimeout("clock()", 1000);
	}

function swapImage() {
	var i,theObj,j=0,swapArray=new Array,oldArray=document.swapImgData;
	for (i=0; i < (swapImage.arguments.length-2); i+=3) {
		theObj = eval(swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1])
		if (theObj != null) {
			swapArray[j++] = theObj;
			swapArray[j++] = (oldArray==null || oldArray[j-1]!=theObj)?theObj.src:oldArray[j];
			theObj.src = swapImage.arguments[i+2];
		}
	}
	document.swapImgData = swapArray;
}

function swapImgRestore() {
	if (document.swapImgData != null)
	for (var i=0; i<(document.swapImgData.length-1); i+=2)
		document.swapImgData[i].src = document.swapImgData[i+1];
}

function swapTextIn(b,e) {
	var url = 'bios/' + b + '.htm';
	document.bioframe.location.href = url;
	document.pform.pformfield.value = e;
}

function swapPhoto() {
	var p,theObject,q=0,swapPArray=new Array,oldPArray=document.swapPhotoData;
	for (p=0; p < (swapPhoto.arguments.length-2); p+=3) {
		theObject = eval(swapPhoto.arguments[(navigator.appName == 'Netscape')?p:p+1])
		if (theObject != null) {
			swapPArray[q++] = theObject;
			swapPArray[q++] = (oldPArray==null || oldPArray[q-1]!=theObject)?theObject.src:oldPArray[n];
			theObject.src = swapPhoto.arguments[p+2];
		}
	}
	document.swapPhotoData = swapPArray;
}

function showHide(childObj){
      var dom = document.all[childObj].style;
      if (dom.display == 'none') {
          dom.display = '';
      } else {
          dom.display = 'none';
      }
    }

function sendInstructor() {
	if (document.pform.pformfield.value == "info") {
		alert('You have not selected an Instructor. The email will be sent to ' + document.pform.pformfield.value + '@' + 'peaceofficeracademy' + '.' + 'com.');
	}
	sendMail(document.pform.pformfield.value,'peaceofficeracademy','com','Website%20Contact','');
}
