	// pop window
		function gp_popWindowA(inUrl) {
			//pop open window
			var vUrl = inUrl
			popA = window.open(vUrl,'popA','scrollbars=0,height=470,width=457,status=0,toolbar=0');
			popA.focus();
		}
	
	// set focus
		function gp_setFocus(inField) {
			//set focus to inField form field if valid
			//format:: [formName].[fieldName]
			var vField = inField
			if (vField==null || vField==''){vField="search.kw"}
			var aField = vField.split(".")
		
			//alert( document.forms[aField[0]].elements[aField[1]] )
		}
		
	// expand/contract
		function js_expandThis(vThis) {
			//input a text value for div and span tags to change/expand

			var vSpan = vThis
			var vDiv = document.getElementById(vThis.id +'_div');
					
			if (vSpan.innerHTML == '[+]'){
				vSpan.innerHTML = '[-]';
				vDiv.style.visibility = 'visible';
				vDiv.style.display = '';
			}
			else {
				vSpan.innerHTML = '[+]';	
				vDiv.style.visibility = 'hidden';				
				vDiv.style.display = 'none';			
			}
		}		
		
	//general functions
		function trim(inS){
			if (inS != null){inS = inS.replace(/^\s*|\s*$/g,'');}
			return inS;
			}
	
		function ltrim(inS){
		    if (inS != null){inS = inS.replace(/^\s*/g,'');}
			return inS;
			}
	
		function rtrim(str){
		    if (inS != null){inS = inS.replace(/\s*$/g,'');}
			return inS;
			}
			
		function closeDiv(inId){
			vDiv = document.getElementById(inId)
			if (vDiv!=null){
				vDiv.style.display	= 'none';
			}
		}					
					
		function inputFocus(inThis){
			//onfocus clear or if not default then select all
			if (inThis.value == inThis.defaultValue){
				inThis.value = "";
				inThis.style.color = "#000000";
			}
			inThis.select();
		}
		
		function inputBlur(inThis){
			//on blur change back to default if not changed
			if (inThis.value == ""){
				inThis.value = inThis.defaultValue;
				inThis.style.color = "#C0C0C0";
			}
			else {
				inThis.style.color = "#000000";
			}
		}
	
		function getThisY(inThis){
			//use for objects not events
			var returnValue = inThis.offsetTop;
			while((inThis = inThis.offsetParent) != null){
				returnValue += inThis.offsetTop;
			}
			return returnValue;
		}

		function getThisX(inThis){
			//use for objects not events
			var returnValue = inThis.offsetLeft;
			while((inThis = inThis.offsetParent) != null){
				returnValue += inThis.offsetLeft;
			}
			return returnValue;
		}
		
		function setCookie(c_name,value,expiredays){
			var exdate = new Date();
			exdate.setDate(exdate.getDate()+expiredays);
			document.cookie = c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}

		function getCookie(c_name){
			if (document.cookie.length>0){
				c_start=document.cookie.indexOf(c_name + "=")
				  if (c_start!=-1){ 
					    c_start=c_start + c_name.length+1 
					    c_end=document.cookie.indexOf(";",c_start)
					    if (c_end==-1) c_end=document.cookie.length
					    return unescape(document.cookie.substring(c_start,c_end))
				    } 
			}
			return ""
		}
	
		function queryString(inGet) {
			var vGet = trim(inGet);
			if (vGet!=''){
				var qs = window.location.search.substring(1);
				var aQs = qs.split("&");
				var vReturn='';
				for (i=0;i<aQs.length;i++) {
					vQs = aQs[i].split("=");
					if (vQs[0]==vGet){vReturn = vQs[1]; break;}
				}
			}
			return vReturn;
		}	
			
	function gp_changeOpener(vUrl){
		//change url of opener and then return focus to spawned window
		//effectively layers spawn on top of opener
		if (vUrl.length>0){
			window.opener.location.href = vUrl;
			window.opener.focus();
			window.focus();
		}
	}

	function gp_addDDL(vObj,vText,vValue){
		//add a drop down item to vObj with text and value provided.  
		var vExist = false;
		
		vValue = vValue +'';

		for (i=0; i<vObj.options.length; i++){
			if (vObj.options[i].value==vValue){vExist=true}
		}
		
		if (vExist==false){
			var vOpt = document.createElement('option');
			vOpt.text = vText;
			vOpt.value = vValue;
			try {vObj.add(vOpt, null)}
			catch(ex) {vObj.add(vOpt)} // IE only
		}
	}
	
	function gp_rmvDDL(vObj,vValue){
		//remove drop down list item with value of value
		vValue =vValue+'';
		
		for (i=0; i<vObj.options.length; i++){
			if (vObj.options[i].value==vValue){vObj.remove(i)}
		}
	}
	
	function gp_setRadio(vRad, vValue) {
		var i;
		vValue = vValue+'';
		for(var i = 0; i < vRad.length; i++) {
			vRad[i].checked = false;
			if(vRad[i].value==vValue){vRad[i].checked = true;}
		}
	}
	
	

