<!--
	// --------------------------------------------------------------
	// Spawn a New Window, pass in a url
	// --------------------------------------------------------------

	function open_window(url) {
		newwin = window.open(url,"win",'toolbar=1,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=350');
	}
	
	
	// this function will be modified to call the openDialog function
	function openWindow(url) {
		var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4))
		var IE4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
		// One object tracks the current modal dialog opened from this window.
		window.name = 'main';
		var popupWindow;
		var left;
		var top;
		var attr = new String();
				
		if(Nav4) {
			attr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars=1,width=520,height=450,screenX=10,screenY=10';
		}
		else { 
			attr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars=1,width=520,height=450,top=10,left=10';
		}//if()
		if((!Nav4)&&(!IE4)) {
			popupWindow = window.open(url, 'popupWindow', 'toolbar=0,location=0,resizable=1,directories=0,status=0,menubar=0,scrollbars=1,width=520,height=500');
		}
		else {	
			popupWindow = window.open(url, 'popupWindow', attr);
		}//if()
	}//end function	
	
	
	
	
	
	//**********************************************************************
	// checkRequired()
	// author:	Paul Jodoin
	// date:	9/04/01, 6/14/02
	// purpose: Checks a form for required values
	// rules:	all spaces denoted with _ 
	//			must use a full description to define the missing field.	
	// mods:	added support for select list
	//**********************************************************************
	function checkRequired(form) {
		
		var i;
		var x;
		var validate;
		var element = new String();
		var field = new String();
		var output = new String();
		var spcArr = new Array();
			
		// initialize
		output = '';
			
		for(i = 0; i < form.elements.length; i++) {
			element = form.elements[i].name;
			// check for the existence of the options array
			
			switch(form.elements[i].type) {
				case 'select-one':
					if((element.indexOf('selReq') != -1)&&(form.elements[i].options[form.elements[i].selectedIndex].value == '')) {
						if(element.indexOf('selReq') != -1) {
							field = element.substr(6, element.length - 6);
						}
						spcArr = field.split('_');
						if(spcArr.length) {
							for(x = 0; x < spcArr.length; x++) {
								output += spcArr[x] + ' ';
							}//for()
							output = output.slice(0, output.length - 1);
						}
						else {
							output = field;
						}//if()
						alert('Please select ' + output + '.');
						form.elements[i].focus();
						return false;
					}//if()	
					break;
				case 'text':
					if((element.indexOf('txtReq') != -1)&&(form.elements[i].value == '')) {
						field = element.substr(6, element.length - 6);
						spcArr = field.split('_');
						if(spcArr.length) {
							for(x = 0; x < spcArr.length; x++) {
								output += spcArr[x] + ' ';
							}//for()
							output = output.slice(0, output.length - 1);
						}
						else {
							output = field;
						}//if()
						alert('Please enter ' + output + '.');
						form.elements[i].focus();
						return false;
					}//if()	
					break;
				case 'textarea':
					if((element.indexOf('txtReq') != -1)&&(form.elements[i].value == '')) {
						field = element.substr(6, element.length - 6);
						spcArr = field.split('_');
						if(spcArr.length) {
							for(x = 0; x < spcArr.length; x++) {
								output += spcArr[x] + ' ';
							}//for()
							output = output.slice(0, output.length - 1);
						}
						else {
							output = field;
						}//if()
						alert('Please enter ' + output + '.');
						form.elements[i].focus();
						return false;
					}//if()	
					break;
				case 'radio':
					if(element.indexOf('radReq') != -1) {
						validate = true;
						if(form.elements[element].length > 0) {
							for(x=0;x<form.elements[element].length;x++) {
								if(form.elements[element][x].checked == true) {
									validate = false;
								}//if()
							}//for()
						}
						else {
							if(form.elements[i].checked == true) {
								validate = false;
							}//if()
						}//if()
						if(validate == true) {
							field = element.substr(6, element.length - 6);
							spcArr = field.split('_');
							if(spcArr.length) {
								for(x = 0; x < spcArr.length; x++) {
									output += spcArr[x] + ' ';
								}//for()
								output = output.slice(0, output.length - 1);
							}
							else {
								output = field;
							}//if()
							alert('Please select a ' + output + '.');
							form.elements[i].focus();
							return false;
						}//if()
					}//if()	
					break;
				case 'checkbox':
					if(element.indexOf('chkReq') != -1) {
						validate = true;
						if(form.elements[element].length > 0) {
							for(x=0;x<form.elements[element].length;x++) {
								if(form.elements[element][x].checked == true) {
									validate = false;
								}//if()
							}//for()
						}
						else {
							if(form.elements[i].checked == true) {
								validate = false;
							}//if()
						}//if()
						if(validate == true) {
							field = element.substr(6, element.length - 6);
							spcArr = field.split('_');
							if(spcArr.length) {
								for(x = 0; x < spcArr.length; x++) {
									output += spcArr[x] + ' ';
								}//for()
								output = output.slice(0, output.length - 1);
							}
							else {
								output = field;
							}//if()
							alert('Please select a ' + output + '.');
							form.elements[i].focus();
							return false;
						}//if()
					}//if()	
					break;
				default:
					break;
			}//switch()
		}//for()
			
	}//checkRequired()

	
	
	

	
	/////////////////////////////////////////////
	/* 
	swap select box value functionality
	modifications by: Paul Jodoin, Paul Morin
	*/
	/////////////////////////////////////////////
			
	function changeSelection(dropObj, multObj, qstring) {
			
		var strSelect = new String();	//the country select
		var strTemp = new String();		//the state or province
		
		//set these
		strTemp = '';		
		strSelect = dropObj.options[dropObj.selectedIndex].value;	
		
		//reset the length
		multObj.length = 0;
		for (var i=0; i < arrCategory.length - 1; i++) {	
						
			if(arrCategory[i][0] == strSelect) {
				
				//during the loop, if the temp string is different from the state name, add the state name
				if(strTemp != arrCategory[i][1]) {
			
					strTemp = arrCategory[i][1];	
					//only add to the list if the length of the state is greater than 0					
					if(strTemp.length > 0){
						multObj.options[multObj.length] = new Option(strTemp, strTemp);
					}//if()
					
				}//if()
						
			}//end if
					
		}//next
		
	}// end function 
	
//-->
