<!--
	//**********************************************************************
	// 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 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
			if(form.elements[i].options) {
				if((element.indexOf('Req') != -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()	
			}
			else {
				if((element.indexOf('Req') != -1)&&(form.elements[i].value == '')) {
					if(element.indexOf('txtReq') != -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 enter ' + output + '.');
					form.elements[i].focus();
					return false;
				}//if()	
			}//if()
		}//for()
			
	}//checkRequired()

	
	

	
	//**********************************************************************
	// selectAll()
	// edited by:	Paul Jodoin
	// date:	02/13/02
	// purpose: selects all of the values in a multiple select box
	// rules:	full object name of select -- 
	//			ex: document.formName.selectName
	//**********************************************************************			
	function selectAll(listObj) {
			
		for (var i=0; i < listObj.length; i++) {  //select all of the items	on submit
			listObj.options[i].selected = true;
		}//next
				
	}//end function  
	
	//**********************************************************************
	// switchBox()
	// edited by:	Paul Jodoin
	// date:	02/13/02
	// purpose: moves values from one select box to another
	// rules:	name of the button pressed, full object name of select
	//			select source, full name of select target -- 
	//			ex: this, document.formName.selectName1, 
	//			document.formName.selectName2
	// dependencies: requires the checkBrowser() function
	//**********************************************************************			
	function switchBox(btn, listObj, targetObj)
		{
		
		var sBrowser = new String();
		var selectedItem;
		
		// grab the browser
		sBrowser = checkBrowser();
		
		// make sure something is selected		
		if(listObj.selectedIndex != -1) {
				
			// loop through once and send the items to the target
			for(var i =0;i < listObj.length;i++){
				if((listObj.options[i].selected) && (listObj.options[i].value != null)){
					selectedItem = listObj.options[i]; 
					targetObj.options[targetObj.length] = new Option(selectedItem.text, selectedItem.value);   //create new items in target select box
				}//end if
			}//next
			
			// clear the selected index	
			listObj.options[listObj.selectedIndex] = null;
				
			// be sure to do this last -- refresh Netscape 4 and less to resize select
			if((sBrowser.indexOf('nav')!=-1)&&(parseFloat(sBrowser)==4)) {
				history.go(0);
			}//end if 
					
		}//end if
						
	}//end function 
	
	//**********************************************************************
	// switchOne()
	// edited by:	Paul Jodoin
	// date:	02/15/02
	// purpose: moves values from one select box to another
	// rules:	name of the button pressed, full object name of select
	//			select source, full name of select target -- 
	//			ex: this, document.formName.selectName1, 
	//			document.formName.selectName2
	// dependencies: requires the checkBrowser() function
	//**********************************************************************			
	function switchOne(btn, listObj, targetObj)
		{
		
		var sBrowser = new String();
		var selectedItem;
		
		// grab the browser
		sBrowser = checkBrowser();
		
		// make sure something is selected		
		if((listObj.selectedIndex != -1)&&(targetObj.length == 0)) {
				
			// loop through once and send the items to the target
			for(var i=0;i < listObj.length;i++){
				if((listObj.options[i].selected) && (listObj.options[i].value != null)){
					selectedItem = listObj.options[i]; 
					targetObj.options[targetObj.length] = new Option(selectedItem.text, selectedItem.value);   //create new items in target select box
					break;
				}//end if
			}//next
			
			// clear the selected index
				
			listObj.options[i] = null;
			
			delSelected(listObj);
				
			// be sure to do this last -- refresh Netscape 4 and less to resize select
			if((sBrowser.indexOf('nav')!=-1)&&(parseFloat(sBrowser)==4)) {
				history.go(0);
			}//end if 
					
		}//end if
						
	}//end function 
				
	// 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 priceWin;
		var left;
		var top;
		var attr = new String();
				
		if(Nav4) {
			attr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=250,height=350,screenX=10,screenY=10';
		}
		else { 
			attr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=250,height=350,top=10,left=10';
		}//if()
		if((!Nav4)&&(!IE4)) {
			priceWin = window.open(url, 'priceWin', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=250,height=350');
		}
		else {	
			priceWin = window.open(url, 'priceWin', attr);
		}//if()
	}//end function	
	
	
	function popUp(url) {
		sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
		self.name = "mainWin";
		}//edn function
	
	
	//**********************************************************************
	// delSelected()
	// edited by:	Paul Jodoin
	// date:	02/13/02
	// purpose: deletes selected values from a select box
	// rules:	name of select -- ex: document.formName.selectName
	//**********************************************************************		
	function delSelected(listObj) {
		
		// loop through and delete	
		for( var i = listObj.length - 1; i >= 0; i-- ){
			if (listObj.options[i].selected == true) {
				listObj.options[i] = null;
			}//end if
		}//next
						
	}//end function
//-->	
