/* Browser/platform checkers */
if (navigator.userAgent.indexOf('MSIE') != -1)
{
	var isIE = true;
	var isNS = false;
	var isMoz = false;	
} 
else if (navigator.userAgent.indexOf('Netscape') != -1)
{
		var isNS = true;
		var isIE = false;
		var isMoz = false;		
} else if (navigator.userAgent.indexOf('Mozilla') != -1)
{
		var isNS = false;
		var isIE = false;
		var isMoz = true;		
}

var isWin = navigator.userAgent.indexOf("Win") != -1;
var isMac = navigator.userAgent.indexOf("Mac") != -1;
var isUnix = navigator.userAgent.indexOf("X11") != -1;

/* Make a combo variable to identify */
var iBPmix = 0;
if (isWin)
{
	if (isIE)
	{
		iBPmix = 1;
	}
	if (isNS)
	{
		iBPmix = 2;
	}
	if (isMoz)
	{
		iBPmix = 5;
	}
}
if (isMac)
{
	if (isIE)
	{
		iBPmix = 3;
	}
	if (isNS)
	{
		iBPmix = 4;
	}
	if (isMoz)
	{
		iBPmix = 6;
	}
}

function showBig(picname, caption)
{
	var winID = window.open('/showpic.asp?pic=' + picname + '&cap=' + caption, 'bigpic', 'width=100,height=100,scrollbars=no,resizable=yes');
}

function showBigNoCap(picname)
{
	var winID = window.open('/showpic.asp?pic=' + picname, 'bigpic', 'width=100,height=100,scrollbars=no,resizable=yes');
}

function showBigNonGal(pageID, picNum)
{
	var winID = window.open('/showpic.asp?pid=' + pageID + '&pnum=' + picNum, 'bigpic', 'width=100,height=100,scrollbars=no,resizable=yes');
}

function showPopUp( page)
{
	var popUp = window.open( page, 'popup', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizeable=1,width=350,height=250');
}

function checkrequired( formname) {

	var pass=0, box=0, theForm;
	theForm = document.forms[formname];

	if (document.images) {
		for (i=0; i < theForm.length; i++) {
			var tempobj=theForm.elements[i];
			if (tempobj.name.substring(0,1) == "*") {
						
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&
				tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
				tempobj.selectedIndex==0)) {
					pass=1;
					break;
	      }
	    } 
		}
		
		if (pass==1) {		
			shortFieldName=tempobj.name.substring(1,30).toUpperCase();
			alert("Please make sure the "+shortFieldName+" field is properly filled in.");
			tempobj.focus();
		} else {
			theForm.submit();
		}
	}			
}

function process_imgs_links( img, caption) {
	if (isNS) { // handle NS		
		document.bigimg.src = img;
		document.bigimg.alt = caption;
	} else if (isIE) { //handle IE
		document.bigimg.src = img;				
		document.bigimg.alt = caption;
	} else { // Handle Mozilla		
		document.getElementById("bigimg").src = img;		
		document.getElementById("bigimg").alt = caption;
	}									
}
function setFocusOn( sform, sfield) {
	var sForm = document.forms[sform];
	sForm.elements[sfield].focus();
}