	function setProfsID( feildname, id, checked )
	{			
		//alert(feildname+"-"+id+"-"+checked) 
		var f=document.profSelected;
		var val;
		var returnval="";
		
		if( checked==false || checked=="false" ){
			val=f.profsID.value;
			//alert(val);
			list=val.split(",");
			//alert(list.length+"\n"+list[0]);
		for( i=0 ; i<list.length ; i++){
				if(list[i]!=id ){
					if(returnval.length>0)
						returnval=returnval+","+list[i];
					else
						returnval=list[i];
				}
			}
			//alert(returnval);
			f.profsID.value=returnval;
		}
		else{
			if(f.profsID.value.length>0)
				f.profsID.value+=","+id;
			else
				f.profsID.value+=id;
		}
		//alert(f.profsID.value);
	}

	function submitForm(thisForm)
	{
		thisForm.submit();
	}
	
	function orderProfsTable(form) { 
		var index=form.order_option.selectedIndex;
		if (form.order_option.options[index].value != "-1") {
			setFieldDesc(form.order_option.options[index].text, form.order_option.options[index].value.substring(form.order_option.options[index].value.indexOf("=") + 1));
			location = form.order_option.options[index].value;
		}
	}
	
	function setFieldDesc(desc, id) {
     //alert(id);
    if (window.parent.offerForm != null)
    {
    	window.parent.offerForm.fieldDesc.value = desc;
		window.parent.offerForm.fieldID.value = id;
	}
	if (window.parent.replyForm != null)
    {
    	window.parent.replyForm.fieldDesc.value = desc;
		window.parent.replyForm.fieldID.value = id;
	}

}
	
