function popDenyBox2(){
	var approved = getCheckedValue('approved');
	if(!approved){
		document.forms[0].task_note.value = 'Denial Reason(s):\n';	
	}
}

function popDenyBox(val){
	var txt = document.forms[0].task_note.value = 'Denial Reason(s):\n';	
	var reasons = document.forms[0]['denial_reason[]'];
	for (var i = 0; i < reasons.length; i++) {
		if (reasons[i].checked){
			txt = txt + '\n' + reasons[i].value;
		}
	}
	document.forms[0].task_note.value = txt;
	return null;
}



function setFocus (name){
	document.forms[0][name].focus();
	if(document.forms[0][name].type == 'text'){
		document.forms[0][name].select();
	}
}

function gup(name,url){
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	// if(url == '') url = window.location.href;
	var results = regex.exec(url);
	if( results == null )
		return "";
	else
		return results[1];
}

function popWin (url,size) {
	var prospect_id = gup('p',url);	
	var width = screen.width;
	var height = screen.height;
	switch(size){
		case 'landscape_short':
			var myWidth = width * .8;
			var myHeight = height * .5;
			break;			
		case 'landscape_medium':
			var myWidth = width * .8;
			var myHeight = height * .75;
			break;			
		case 'tiny':
			var myWidth = width * .2;
			var myHeight = height * .2;
			break;
		case 'tiny_wide':
			var myWidth = width * .75;
			var myHeight = height * .2;
			break;
		case 'small':
			var myWidth = width * .4;
			var myHeight = height * .4;
			break;
		case 'medsm':
			var myWidth = width * .4;
			var myHeight = height * .6;		
			break;
		case 'med':
			var myWidth = width * .6;
			var myHeight = height * .6;		
			break;
		case 'full':
			var myWidth = width * .8;
			var myHeight = height * .8;
			break;
		case 'max':
			var myWidth = width * 1;
			var myHeight = height * 1;
			break;
		default:
			var myWidth = 770;
			var myHeight = 550;
			break;
	}	
	var myScrollbars = 'yes';
	var myTop = 50;
	var myLeft = 50;
	var myMenubar = 'no';
	var myResize = 'yes';
	window.open (url, "","width="+myWidth+",height="+myHeight+",scrollbars="+myScrollbars+",top="+myTop+",left="+myLeft+",menubar="+myMenubar+",resizable="+myResize+",bgcolor=#ffffff");	
}



function OpenMail(to, cc, msgsub, msgbody){
	for(i = 0; i < arguments.length; i++){
		if(arguments[i] == ''){
			arguments[i] = ' ';
		}
	}
	if(arguments.length > 2){
		location.href = "mailto:" + to + "?cc=" + cc + "&subject=" + msgsub + "&body=" + msgbody;
	}else{
		location.href = "mailto:" + to + "?cc=" + cc;
	}
	return false;
}


function refreshAnalysis(section) {
	window.opener.location.href = '../../frontoffice/analysis.php?s=' + section;
	if (window.opener.progressWindow) {
		window.opener.progressWindow.close()
	} 
	window.close();
}

function refreshQueueManager(tab) {
	window.opener.location.href = 'prospects.php?tab=' + tab;
	if (window.opener.progressWindow) {
		window.opener.progressWindow.close()
	} 
	window.close();
}

function refreshParent(page, x) {
	//alert(page);
	window.opener.location.href = page;
	if (window.opener.progressWindow) {
		window.opener.progressWindow.close()
	}
	if(x != 0){
		window.close();
	}
}

function refreshTheParent(x) {
	window.opener.location.href = window.opener.location.href;
	if (window.opener.progressWindow) {
		window.opener.progressWindow.close()
	}
	if(x != 0){
		window.close();
	}
}

function refreshParentFrame(page) {
	window.parent.location.href = page;
}

function shiftFocus (name){
	document.form[name].focus();
	if(document.form[name].type == 'text'){
		document.form[name].select();
	}
}

function cleanCur (foo) {
	foo = foo.replace("$", "");  
	foo = foo.replace(",", "");  
	foo = foo * 1;  	
	return foo;
}

//**************************
// BEGIN FORMAT FUNCTIONS **
//**************************

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
		if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num);
//	return (((sign)?'':'-') + '$' + num + '.' + cents);	
}

function formatCurrency2(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);	
}

function formatPhone(num){
	return num;
}

function cleanPhone(num){
	var nums = /[^\d]/g;
	return num.replace(nums, "");
}



function formatPercentage(num) {
	return num;
}

//************************
// END FORMAT FUNCTIONS **
//************************

//**************************************
// BEGIN FUNCTIONS FOR FILLING A FORM **
//**************************************

	function fillForm(vals,keys){
		vals = vals.split('^@');
		keys = keys.split('^@');
		for(i = 0; i < keys.length; i++){
			try{
				switch(document.getElementById(keys[i]).alt){
					case 'cash':
						document.getElementById(keys[i]).value = formatCurrency2(vals[i]);
					break;
					case 'phone':
						document.getElementById(keys[i]).value = formatPhone(vals[i]);
					break;
					case 'percentage':
						document.getElementById(keys[i]).value = formatPercentage(vals[i]);
					break;
					default:
						document.getElementById(keys[i]).value = vals[i];
					break;
				}
			}catch(err){
			}
		}
	}

//************************************
// END FUNCTIONS FOR FILLING A FORM **
//************************************

//*********************************************
// BEGIN FUNCTIONS FOR MULTIPLE SELECT BOXES **
//*********************************************

function addOption(selectbox,text,value ){
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function removeOption(listbox,i){
	listbox.remove(i);
}

function addOption_list(start,end){
	var formField = eval("document.form."+start);
	var formFieldLen = eval("document.form."+start+".options.length");
	var formFieldEnd = eval("document.form."+end);
	for(i=formFieldLen-1;i>=0;i--)	{
		if(formField[i].selected){
			addOption(formFieldEnd, formField[i].text, formField[i].value);
			removeOption(formField,i);
		}
	}
}


function move_all_Option(start,end){
	var formField = eval("document.form."+start);
	var formFieldLen = eval("document.form."+start+".options.length");
	var formFieldEnd = eval("document.form."+end);
	for(i=formFieldLen-1;i>=0;i--){
		addOption(formFieldEnd, formField[i].text, formField[i].value);
	}
	removeAllOptions(start);
}



function removeAllOptions(field){
	var formFieldLen = eval("document.form."+field+".options.length");
	var formField = eval("document.form."+field);
	var i;
	for(i=formFieldLen-1;i>=0;i--){
		formField.remove(i);
	}
}

function updateSelected(form,varname){
	document.form.selUsers.value = '';
	var s = form.elements[varname];
	var su = new Array()
	for (var i = 0; i < s.length; i++) {
		su[i] = s[i].value;
	}
	document.form.selUsers.value = su;
}

//*******************************************
//* END FUNCTIONS FOR MULTIPLE SELECT BOXES *
//*******************************************

//**********************************
//* BEGIN FUNCTIONS FOR CHECKBOXES *
//**********************************

function Hide(el_id){
	try{
		document.getElementById(el_id).style.display = 'none';
	}catch(err){
		//alert(err);
	}
}

function Show(el_id){
	try{
		document.getElementById(el_id).style.display = '';
	}catch(err){
		//alert(err);
	}
}

function hideShow(el_id) {
	try{
		document.getElementById(el_id).style.display = (document.getElementById(el_id).style.display == 'none') ? Show(el_id) : Hide(el_id);
	}catch(err){
		//alert(err);
	}
}

function toggleCheckBox(el_id){
	if(document.getElementById(el_id).checked){
		document.getElementById(el_id).checked = false;
	}else{
		document.getElementById(el_id).checked = true;
	}
}

function checkBox(el_id){
	document.getElementById(el_id).checked = true;
}

function unCheckBox(el_id){
	document.getElementById(el_id).checked = false;
}

function checkRadio(el_id){
	document.getElementById(el_id).checked = true;
}

function unCheckRadio(el_id){
	document.getElementById(el_id).checked = false;
}

function unCheckAll(x, y, z){
	var yvars = y.split(',');
	var zvars = z.split(',');
	try{
		for(i = 0; i < yvars.length; i++){
			document.getElementById("box"+yvars[i]).checked = false;
		}
		for(i = 0; i < zvars.length; i++){
			document.getElementById("pbox"+zvars[i]).checked = false;
		}
	}catch(err){
	}
}

function toggleAll(el_id, x){
	var vars = x.split(',');
	if(document.getElementById(el_id).checked){
		for(i = 0; i < vars.length; i++){
			document.getElementById(vars[i]).checked = true;
		}
	}else{
		for(i = 0; i < vars.length; i++){
			document.getElementById(vars[i]).checked = false;
		}
	}
}

//********************************
//* END FUNCTIONS FOR CHECKBOXES *
//********************************

//************************
//* BEGIN AJAX FUNCTIONS *
//************************

function handleHttpResponse(el_id, httpid){
	if(httpid){
		http = httpid;
	}
	if(http.readyState == 1){
    	document.getElementById(el_id).innerHTML = 'Loading...';
    	//document.getElementById(el_id).innerHTML = "<img src='http://68.178.118.238/usl/images/loading.gif'>";
	}
	if (http.readyState == 4){
		if(http.status==200){
			var results = http.responseText;
			document.getElementById(el_id).innerHTML = results;
		}
	}
}
       
function requestClaimLead(url, p_id){
	var answer = confirm("Are you sure you want to claim this lead?");
	var el_id = 'divSalesRep'+p_id;
	if (answer){
		document.getElementById('divClear'+p_id).innerHTML = '<div id="'+el_id+'"></div>';
		http.open("GET", url, true);
		http.onreadystatechange = function(){
		handleHttpResponse(el_id);
		}
		http.send(null);
	}else{
		// Do nothing
	}
}

function assignProduct(url){
	var answer = confirm("Are you sure you want to make assignment?");
	var el_id = 'divMsg';
	if (answer){
		document.getElementById('divClear').innerHTML = '<div id="'+el_id+'"></div>';
		http.open("GET", url, true);
		http.onreadystatechange = function(){
		handleHttpResponse(el_id);
		}
		http.send(null);
	}else{
		// Do nothing
	}
}

function requestMakeHybrid(url, p_id){
	var answer = confirm("Are you sure you want to make this a hybrid file?");
	var el_id = 'divHybrid'+p_id;
	if (answer){
		document.getElementById('divHybridClear'+p_id).innerHTML = '<div id="'+el_id+'"></div>';
		http.open("GET", url, true);		
		http.onreadystatechange = function(){
		handleHttpResponse(el_id);
		}
		http.send(null);
	}else{
		// Do nothing
	}
}

function getUserList(url){
	//var answer = confirm("Are you sure you want to pick this user?");
	var answer = true;
	var el_id = 'divUsers';
	if (answer){
		document.getElementById(el_id+'Clear').innerHTML = '<div id="'+el_id+'"></div>';
		http.open("GET", url, true);		
		http.onreadystatechange = function(){
		handleHttpResponse(el_id);
		}
		http.send(null);
	}else{
		// Do nothing
	}
}

function loadDist(url, id){
	var httpid = getHTTPObject(); // We create the HTTP Object
	//alert(url);
	var el_id = 'divDist2'+id;
	document.getElementById('divDist'+id).innerHTML = '<div id="'+el_id+'"></div>';
	httpid.open("GET", url, true);
	httpid.onreadystatechange = function(){
	handleHttpResponse(el_id, httpid);
	}
	httpid.send(null);
}

function processRating(url, el_id){
	//alert(el_id);
	//alert(url);
	//var answer = confirm("Are you sure you want to submit this rating?");
	var answer = true;
	var nel_id = 'divRating'+el_id;
	if (answer){
		document.getElementById(el_id).innerHTML = '<div id="'+nel_id+'"></div>';
		http.open("GET", url, true);
		http.onreadystatechange = function(){
		handleHttpResponse(nel_id);
		}
		http.send(null);
	}else{
		// Do nothing
	}
}

function getHTTPObject(){
	var xmlhttp;
	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
	}else if (window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (!xmlhttp){
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	}
	return xmlhttp;
}

var http = getHTTPObject(); // We create the HTTP Object

//**********************
//* END AJAX FUNCTIONS *
//**********************



/*
function refreshConsole(file, queue) {
	window.opener.location.href = '<?=HTTPS?>/backoffice/processing_console.php?f=' + file + '&q=' + queue;
	if (window.opener.progressWindow) {
		window.opener.progressWindow.close()
	} 
	window.close();
}
*/

//****************************
// BEGIN HINT BOX FUNCTIONS **
//****************************

var horizontal_offset="9px" //horizontal offset of hint box from anchor link
var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
	if (whichedge=="rightedge"){
		var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
		edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
	} else {
		var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
	}
	return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
	if ((ie||ns6) && document.getElementById("hintbox")){
		dropmenuobj=document.getElementById("hintbox")
		dropmenuobj.innerHTML=menucontents
		dropmenuobj.style.left=dropmenuobj.style.top=-500
		if (tipwidth!=""){
			dropmenuobj.widthobj=dropmenuobj.style
			dropmenuobj.widthobj.width=tipwidth
		}
	dropmenuobj.x=getposOffset(obj, "left")
	dropmenuobj.y=getposOffset(obj, "top")
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
	dropmenuobj.style.visibility="visible"
	obj.onmouseout=hidetip
	}
}

function hidetip(e){
	dropmenuobj.style.visibility="hidden"
	dropmenuobj.style.left="-500px"
}

function createhintbox(){
	var divblock=document.createElement("div")
	divblock.setAttribute("id", "hintbox")
	document.body.appendChild(divblock)
}



if (window.addEventListener)
	window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
	window.attachEvent("onload", createhintbox)
else if (document.getElementById)
	window.onload=createhintbox

//**************************
// END HINT BOX FUNCTIONS **
//**************************


//**********************************
// BEGIN DRAG POPUP BOX FUNCTIONS **
//**********************************

function styledPopupOpen(el_id, el_id2){
	document.getElementById(el_id2).style.top = getDivPosition(el_id).y+"px";
	document.getElementById(el_id2).style.left = getDivPosition(el_id).x+"px";
	document.getElementById(el_id2).style.display="block";
	document.onmousedown = selectmouse;
	document.onmouseup = new Function("isdrag=false");
}

function movemouse(e){
	var nn6 = document.getElementById &&! document.all;
	if( isdrag ) {
		dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
		dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
		return false;
	}
}

function selectmouse(e, el_id){
	var nn6 = document.getElementById &&! document.all;
	var fobj       = nn6 ? e.target : event.srcElement;
	var topelement = nn6 ? "HTML" : "BODY";

	while (fobj.tagName != topelement && fobj.className != "dragme"){
		fobj = nn6 ? fobj.parentNode : fobj.parentElement;
	}

	if (fobj.className=="dragme"){
		isdrag = true;
		dobj = document.getElementById(el_id);
		tx = parseInt(dobj.style.left+0);
		ty = parseInt(dobj.style.top+0);
		x = nn6 ? e.clientX : event.clientX;
		y = nn6 ? e.clientY : event.clientY;
		document.onmousemove=movemouse;
		return false;
	}
}

function styledPopupClose(el_id){
	document.getElementById(el_id).style.display = "none";
}

function DivPosition_getPageOffsetLeft (el){
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null){
		ol += el.offsetLeft;
	}
	return ol;
}
function DivPosition_getWindowOffsetLeft (el){
	return DivPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
}	
function DivPosition_getPageOffsetTop (el){
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null){
		ot += el.offsetTop;
	}
	return ot;
}
function DivPosition_getWindowOffsetTop (el){
	return DivPosition_getPageOffsetTop(el)-document.body.scrollTop;
}
	
function getDivPosition(Divname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if(document.getElementById){
		use_gebi=true;
	}else if(document.all){
		use_css=true;
	}else if(document.layers){
		use_layers=true;
	}
	// Logic to find position
 	if (use_gebi && document.all){
		//alert('gebi and doc all');
		x=DivPosition_getPageOffsetLeft(document.all[Divname]);
		y=DivPosition_getPageOffsetTop(document.all[Divname]);
	}else if (use_gebi){
		//alert('gebi');		
		var o=document.getElementById(Divname);
		x=DivPosition_getPageOffsetLeft(o);
		y=DivPosition_getPageOffsetTop(o);
	}else if (use_css){
		//alert('use_css');		
		x=DivPosition_getPageOffsetLeft(document.all[Divname]);
		y=DivPosition_getPageOffsetTop(document.all[Divname]);
	}else if(use_layers){
		//alert('layers');		
		var found=0;
		for (var i=0; i<document.Divs.length; i++){
			if (document.Divs[i].name==Divname){
				found=1; break;
			}
		}
		if(found==0){
			coordinates.x=0; coordinates.y=0; return coordinates;
		}
		x=document.Divs[i].x;
		y=document.Divs[i].y;
	}else{
		//alert('none');
		coordinates.x=0; coordinates.y=0; return coordinates;
	}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
}

function getPosition(e){
	e = e || window.event;
	var cursor = {x:0, y:0};
	if (e.pageX || e.pageY) {
		cursor.x = e.pageX;
		cursor.y = e.pageY;
	}else{
		cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
        cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
	}
	return cursor;
}
//********************************
// END DRAG POPUP BOX FUNCTIONS **
//********************************

function fillQuickText(content,fname,formname,ftype){
	if(ftype == 'rte'){
		enableDesignMode(fname, content, 0);
	}else{
		document.getElementById(fname).value = content;
	}
}

function validateForm(x){
	var field;
	var errors = new Array();
	switch (x){
		case 'branch':
			field = 'name';
			if(document.getElementById(field).value.length < 2){
				errors[errors.length++] = "the branch name must be at least 2 characters long";
			}

			field = 'phone';
			if(!validPhone(document.getElementById(field).value)){
				errors[errors.length++] = "please enter a valid 10 digit phone number";
			}
		break;

		case 'bank_user':
			field = 'first_name';
			if(document.getElementById(field).value.length < 2){
				errors[errors.length++] = "please enter a first name";
			}

			field = 'last_name';
			if(document.getElementById(field).value.length < 2){
				errors[errors.length++] = "please enter a last name";
			}

			field = 'phone_work';
			if(document.getElementById(field).value){
				if(!validPhone(document.getElementById(field).value)){
					errors[errors.length++] = "please enter a valid 10 digit work phone number";
				}
			}

			field = 'phone_cell';
			if(document.getElementById(field).value){
				if(!validPhone(document.getElementById(field).value)){
					errors[errors.length++] = "please enter a valid 10 digit cell phone number";
				}
			}
		break;

		default:
			// nothing to do
		break;
	}
	return errors;
}

function validPhone(num){
	num = cleanPhone(num);
	if(num.length < 10){
		return false;
	}else{
		return num;
	}
}

/******************** NEW AJAX *************************/
function processAjax(url, parameters, height, clearDiv){
	//alert(url+" "+parameters+" "+height);
	try{
		if(!height){
			height = 0;
		}
		if(!clearDiv){
			clearDiv = 'divClear';
		}
		document.getElementById('ContainerBO').style.filter = 'alpha (opacity=100)';
		document.getElementById('ContainerBO').style.opacity = '1';
		document.getElementById('divAjaxPop').style.display = 'none';
	
		document.getElementById('divAjaxPop').style.height = parseInt(height)+'px';
		document.getElementById('div_errors').style.display = 'none';
		document.getElementById('div_errors').innerHTML = '';
	
		if(url != 'cancel'){
			var el_id = 'divMsg';
			document.getElementById(clearDiv).innerHTML = '<div id="'+el_id+'"></div>';
			if(parameters == 'formGet'){
				http.open("GET", url, true);
				http.onreadystatechange = function(){
				handleHttpResponse(el_id);
				}
				http.send(null);
			}else{
				http.open('POST', url, true);
				http.onreadystatechange = function(){
				handleHttpResponse(el_id);
				}
				http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				http.setRequestHeader("Content-length", parameters.length);
				http.setRequestHeader("Connection", "close");
				http.send(parameters);
			}
		}
	}catch(error){
		alert("catch "+error);
	}
}

function loadAjaxPopup(url, section, params, anchor){
	var paramsArr = params.split(",");
	try{
		var del_id = 'divMsg';
		//document.getElementById('divAjaxPop').innerHTML = "<div id='"+del_id+"'></div>";
		http.open("GET", url, true);
		http.onreadystatechange = function(){
		handleHttpResponse('divAjaxPop');
		}
		http.send(null);

		//alert(section + " " + height + " " + el_id + " " + el_val);
		document.getElementById('ContainerBO').style.filter = 'alpha (opacity=50)';
		document.getElementById('ContainerBO').style.opacity = '.50';
		document.getElementById('divAjaxPop').style.display = '';
		//document.getElementById('div_'+section).style.top = parseInt(getAnchorWindowPosition(anchor).y) + parseInt(height) + 'px';
		document.getElementById('divAjaxPop').style.top = parseInt(paramsArr[0])+'px';
		document.getElementById('divAjaxPop').style.left = parseInt(paramsArr[1])+'px';
		document.getElementById('divAjaxPop').style.width = parseInt(paramsArr[2])+'px';
		document.getElementById('divAjaxPop').style.height = parseInt(paramsArr[3])+'px';
	}catch(error){
		//alert("catch "+error);
	}
}

function get(obj, url, section, height, clearDiv){
	var poststr;
	var theReturn = '';
	var errors = new Array();
	var started = false;
	try{
		errors = validateForm(section);
		for(i = 0; i < obj.length; i++){
			//alert(obj.elements[i].id);
			if(obj.elements[i].id){
				if(started){
					poststr = poststr + "&" + obj.elements[i].id + "=" + encodeURI( document.getElementById(obj.elements[i].id).value.replace('&', '{ANDCHAR}') );
				}else{
					poststr = obj.elements[i].id + "=" + encodeURI( document.getElementById(obj.elements[i].id).value.replace('&', '{ANDCHAR}') );
					started = true;
				}
				//alert(poststr);
			}
		}
		if(!errors.length){
			for(i = 0; i < obj.length; i++){
				//alert(obj.elements[i].id);
				if(obj.elements[i].id){
					if(obj.elements[i].type != 'hidden'){
						document.getElementById(obj.elements[i].id).value = '';
					}
				}
			}
		}
	}catch(error){
		alert("catch "+error);
	}
	//alert(errors);
	if(errors.length){
		theNum = errors.length * 25;
		document.getElementById('divAjaxPop').style.height = theNum + parseInt(height) + 'px';
		document.getElementById('div_errors').style.display = '';
		for(i = 0; i < errors.length; i++){
			theReturn = theReturn + "<li>" + errors[i] + "</li>";
		}
		document.getElementById('div_errors').innerHTML = "<div style='margin-left:15px;margin-top:5px;text-align:left;'>" + theReturn + "</div>";
	}else{
		processAjax(url, poststr, 0, clearDiv);
	}
}

function ajaxDelete(prompt, url){
	var answer = confirm(prompt);
	if (answer){
		processAjax(url, 'formGet');
	}else{
		// Do nothing
	}
}

/*
function clearDate(n) {
	var value = document.form[n].value;
	if(value == 'mm/dd/yyyy') 
		document.form[n].value = '';
	if(value == 'mm/yy') 
		document.form[n].value = '';

	document.form[n].focus();
	document.form[n].select();	
}


function calculateSplitTotal(){
	var pf = document.forms[0].amount_pf.value;
	pf = pf.toString().replace(/\$|\,/g,'');
	if(isNaN(pf))
		pf = 0;
	var ef = document.forms[0].amount_ef.value;
	ef = ef.toString().replace(/\$|\,/g,'');
	if(isNaN(ef))
		ef = 0;

	pf = pf * 1;
	ef = ef * 1;
	
	var total_amount = 0;
	total_amount = formatCurrency2(pf + ef);
	document.forms[0].total_amount.value = total_amount;
}

*/

/* RATING FUNCTIONS */

function submitScore(x, y, z){
	alert(x+" "+y+" "+z);
}
