function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function checklowerbound(objTextField)
{
	num = objTextField.value;
	orignum = num;
	num = num.toString().replace(/\$|\,/g,'');
	while(''+num.charAt(0)==' ')num=num.substring(1,num.length);
	if(isNaN(num) || num == '')
	return 0 ;
	if (num <100000)
	{
		alert("Please Enter Year-End Client Assets amount above 100,000");
		//objTextField.focus();
	
	}

}

function formatCurrency(num) 
{
	var orignum;
	orignum = num;
	num = num.toString().replace(/\$|\,/g,'');
	while(''+num.charAt(0)==' ')num=num.substring(1,num.length);
	if(isNaN(num) || num == '')
	return orignum ;
	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 calcprofit(Revenue,Expenses,Profit)
{
	Revenue= Revenue.toString().replace(/\$|\,/g,'');
	Expenses= Expenses.toString().replace(/\$|\,/g,'');
	if(isNaN(Revenue))
		Revenue = 0 ; 
	if(isNaN(Expenses))
		Expenses= 0 ; 

	Profit = formatCurrency(Revenue - Expenses);
	return Profit;
}



function SubmitthisForm(sValue)
{
	document.survey.Navigation.value=sValue;
	//alert(document.survey.Navigation.value);
	if (checkForm())
	{
		document.survey.submit();
	}
}







function SelectDDBLforSpecialQuestion(objSelect)
{
//alert(objSelect.rval);

//alert(document.survey.XXX_txt_900.length);
//alert(document.survey.XXX_txt_900.options[1].value);
for(iCnt=0;iCnt<objSelect.length;iCnt++)
{
	//alert(document.survey.XXX_txt_900.options[iCnt].value);
	if(objSelect.options[iCnt].value == objSelect.rval)
	{
		objSelect.selectedIndex = iCnt;
	//	alert(iCnt);
	}
}
//document.survey.XXX_txt_900.value= 'hsbc';
}


function today_is() {

        var todays = "";
        var TODAY = new Date();
        var month = TODAY.getMonth();
        var year = TODAY.getFullYear();
        var day = TODAY.getDate();

        var months = new Array("January", "February", "March", "April", "May",
"June","July","August","September","October","November","December");

        todays = months[month]+" "+day+", "+year;
        document.write(todays);

}

function openWindow(url,w,h,x,y) {

	var win;
        

        win = window.open(url, "newWindow", "width=" + w + ",height=" + h +",directories=0,copyhistory=0,toolbar=0,location=0,status=0,menubar=1,scrollbars=1,resizable=1,screenX="+x+",screenY="+y+",left="+x+",top="+y);

}



function deleteCheck() {
	
	var nix;

	nix = confirm('Are You Sure?');

	if(nix == true) { document.DEL.submit(); }
	else { return; }


}

//
// function checkForm evaluates the form type from hidden field then calls the 
// appropriate form checking function. The called function submits the form 
// 

function checkForm() {

var type;
	var go;
	
	go = CheckOther();
	if(go == false) { return } 
	type = document.survey.check.value;
	//alert('in');
	if(type == 0)      { 

	go = checkBoth();

		if(go == false) { return } 
		else { document.survey.submit();}
	}

        else if(type == 1) { doYear();                                  }
        else if(type == 2) { go = checkBoth();overTen(go);              }
        else if(type == 3) { go = checkBoth();doTotals(go);             }
        else if(type == 4) { doEmployees();                             }
        else if(type == 5) { doMultiAdd();                              }
        else if(type == 6) { go = checkBoth();doWholeNumbers1(go);      }
        else if(type == 7) { go = checkBoth();doWholeNumbers2(go);      }
        else if(type == 8) { go = checkBoth();doMoney(go);              }
		else if(type == 9) { doMultiAddNew();              }
		else if(type == 10) { doEmployeesNew();                             }
        else if(type == 11) { go = checkBoth();doPartFraction(go);              }

	return;

}



function checkFormOriginal() {

	var type;
	var go;
	type = document.survey.check.value;
	//alert('in');
	if(type == 0)      { 

	go = checkBoth();

		if(go == false) { return } 
		else { document.survey.submit();}
	}

        else if(type == 1) { doYear();                                  }
        else if(type == 2) { go = checkBoth();overTen(go);              }
        else if(type == 3) { go = checkBoth();doTotals(go);             }
        else if(type == 4) { doEmployees();                             }
        else if(type == 5) { doMultiAdd();                              }
        else if(type == 6) { go = checkBoth();doWholeNumbers1(go);      }
        else if(type == 7) { go = checkBoth();doWholeNumbers2(go);      }
        else if(type == 8) { go = checkBoth();doMoney(go);              }
		else if(type == 9) { doMultiAddNew();              }

	return;
}


//Check whether the other boxes are properly filled
function CheckOther(go)
{


	var sExtraOtherName;
	var sOtherName;
	var sExtraOtherValue;
	var sOtherValue;
	var sOtherType;
	var objExtraOther
	var	objOther
	
	
	var iOtherArrayIndex;
	var AnsIdArray;

	
	
	

	if (document.survey.OtherArray.length > 2 )//Extra Other boxes are present
	{
		for (var iOtherArrayIndex = 2; iOtherArrayIndex < document.survey.OtherArray.length; iOtherArrayIndex++)  //Control Array
		{
			AnsIdArray = document.survey.OtherArray[iOtherArrayIndex].value.split(":")
//			alert(AnsIdArray[0]); // index 0 is the extra other answer text and 1 is the answer text
			for(var i = 4; i < document.survey.length; i++)  //loop to locate the extra other answer element
			{
				//alert(document.survey.elements[i].Other)
				objExtraOther = document.survey.elements[i];
//				alert(objExtraOther.name)
				sExtraOtherName  = document.survey.elements[i].name;
				sExtraOtherValue = document.survey.elements[i].value; 
				//	alert(sExtraOtherName);
				if(sExtraOtherName.match('_' + AnsIdArray[0]) != null) 
				{  
					for(var i = 4; i < document.survey.length; i++) //loop to locate the answer element associated with the other option
					{
						//alert(document.survey.elements[i].Other)
						sOtherName  = document.survey.elements[i].name;
						sOtherValue = document.survey.elements[i].value; 
						objOther = document.survey.elements[i];
						//	alert(sExtraOtherName);
				
						if(sOtherName.match('_' + AnsIdArray[1]) != null) 
						{  
							sOtherType = sOtherName.substring(4,7); /// chk,txt
							if (sOtherType == "txt") 
							{
								if(sOtherValue != "" && sExtraOtherValue == "")
								{
									alert(document.survey.ExtraOtherMesssage.value);
									objExtraOther.focus();
									return false;
								}
								if(sOtherValue == ""  && sExtraOtherValue != "")
								{
									alert(document.survey.OtherMesssage.value);
									objOther.focus();
									return false;
								}
							}
							if (sOtherType == "chk") 
							{
								if(objOther.checked && sExtraOtherValue == "")
								{
									alert(document.survey.ExtraOtherMesssage.value);
									objExtraOther.focus();
									return false;
								}
								if(!objOther.checked && sExtraOtherValue != "")
								{
									alert(document.survey.OtherMesssage.value);
									objOther.focus();
									return false;
								}
							}
							
							
						}
						if(sOtherValue.match('_' + AnsIdArray[1]) != null) /// for option button the name is in the value
						{  
							sOtherType = sOtherValue.substring(4,7); /// for option button the name is in the value
							
							if (sOtherType == "opt") 
							{
								if(objOther.checked && sExtraOtherValue == "")
								{
									alert(document.survey.ExtraOtherMesssage.value);
									objExtraOther.focus();
									return false;
								}
								if(!objOther.checked && sExtraOtherValue != "")
								{
									alert(document.survey.OtherMesssage.value);
									objOther.focus();
									return false;
								}
							}
							
						}
						
						
						
						
					}
				
					//if ((sExtraOtherValue == "") && (
					//alert(document.survey.SUR_otx_
					//alert(sExtraOtherName);
					//alert(sExtraOtherValue);
					//alert(document.survey.OtherArray.count)

				}
			}	
			

		}
	}
	
	
	
	
	
}

//
// Checks to see if you have input anything into a form before going off the page
// to view another question or graphs.
//

function AnswerFirst(tog,loc) {

        var myvalue;
        var answer;
        var msg1 = "Please press 'Save Answers' to view graphs";;
        var msg2 = "Please answer the question and press 'Save Answers' to view graphs";

        answer = 0;

        if(tog == true) { document.location = loc; }

        else {

        for(var i = 4; i < document.survey.length; i++) {

                myvalue = document.survey.elements[i].value;
                if(myvalue != "") { answer = 1; }
                }

        if(answer == 1) { alert(msg1); }
        else            { alert(msg2); }

        }
        return;
}


//
// Checks to see if you have input anything into a form before going off the page
// to view another question or graphs. Needs a true/false for previous answer and
// location of next page. All forms use this. See buttons on form.
//

function ReadySubmit(tog,loc) {

    var answered;
    var error;
    var location;
	var reg;
	var reg1;
	var myname;
	var myvalue;

	
    location = loc;

	reg   = /none|total/;
	reg1   = /\d+_\d+_\d+/;

    error = "Please hit the 'Save Answers' button to save your answers before you move on";


	if(tog == true) {  }

	else {
        answered = 0;

        for(var i = 4; i < document.survey.length; i++) {
		
		myname  = document.survey.elements[i].name;
		myvalue = document.survey.elements[i].value; 


        	if(document.survey.elements[i].value != null) {
	
			if(myvalue.match(reg1) != null) {  
				if(document.survey.elements[i].checked == true) {  answered++;}
                                else { }
				}
			
			else if(myvalue.match(/_none/) != null) { 

				if(document.survey.elements[i].checked == true) {  answered++;}
				else { }
			}

			else if(myvalue == "") { }

			else if(myname == "total") { }

			else if(myname.match(/\d+_\d+_total\d+/) != null) { answered++; }

			else { answered++; }


			}		
		}
	}

        if(answered > 0)  { alert(error); }
        else              { 
		//alert('submit');
		//survey.submit();
		document.location = location; 
		}

        return;
}




//
// Check form for None and other Data conflict. Warn and submit or allow other choice.
// See Type 2,6,7.
//

function checkBoth() {

	var reg;
	var reg1;
	var reg2;

	var answer;
	var cbox;
	var obox;
	var myname;
	var myvalue;
	var cboxname;
	var proceed;

	reg  = /\d+_\d+_none/g;
	reg = /SUR_non_\d+/;
	
	//reg1 = /\d+_\d+_\d+/; 
	
	reg1 = /SUR_txt_\d+/;
	reg1a = /SUR_chk_\d+/;
		
//	reg2 = /\d+_\d+_other/g;
	reg2 = /SUR_otr_\d+/;
	
	for (var i = 4; i < document.survey.length; i++) {
		
		myname  = document.survey.elements[i].name;
		myvalue = document.survey.elements[i].value;

		if(myname.match(reg) != null) {

			cboxname = i;
			if(document.survey.elements[i].checked == true) { cbox = "on"; }

		}

		else if(myname.match(reg1) != null || myname.match(reg1a) != null) { 
		
                        if(document.survey.elements[i].checked == true || myvalue.length > 0) { obox = "on"; }
			
		}
	

		else if (myname.match(reg2) != null)  { 
			if(myvalue != "" || myvalue != null || myvalue != " ") { 
				var leng;

				leng = myvalue.length;

				if(leng > 0) { answer = "on"; }
				else { }
			}
		}		
	}


	if((cbox == "on" && answer == "on") || (cbox == "on" && obox == "on")) {
	
	proceed = confirm("Checking None or Not Applicable will invalidate all other answers. Proceed?");
		
		if(proceed == true) { }

		else { document.survey.elements[cboxname].checked = false; }
	}	
	
	return proceed;

}



function NA_warn() {

	var toggle;
	var reg;
	var myname;
	var myvalue;
	var addme;
	
	reg   = /\d+_\d+_none/;
	addme = 0; 

	if(toggle == true) { }

	else { 

	for( var i = 4; i < document.survey.length;i++) {
	myname  = document.survey.elements[i].name;
	myvalue = document.survey.elements[i].value;	

	if(myname.match(reg) != null) {
 	
		if(document.survey.elements[i].checked == true && addme > 0) {

			toggle = confirm("All other answers will be disregarded by checking Not Applicable or None. Proceed?");
		
			if(toggle == true) { document.survey.elements[i].checked = true; }
			else { document.survey.elements[i].checked = false; }
		
				}
       		
			}	
		

	else { 
		if(document.survey.elements[i].checked == true) { addme++; }
		if(document.survey.elements[i].value != "") 	{ addme++; }
	
		}


	
    		}
	}

	return;
 
}


//
// Turns the none choice off when other input is chosen
// Currently not used 7/31/2001
//

function toggleNoneOff() {

	var reg;
	var matched;
	var myname;
	var mytype;

	reg = /\d_\d_none/;
	
	for(var i = 0; i < document.survey.length - 2; i++) {

	myname  = document.survey.elements[i].name;
	mytype  = document.survey.elements[i].type;
	
	if(mytype == "checkbox") {
	matched = myname.match(reg); 
	if(matched != null) { document.survey.elements[i].checked = false; } 
	
	} else { 
	matched = myname.match(reg);
        if(matched != null) { document.survey.elements[i].value = ""; }
		}	
	}
}

//
// Wipes all other data when the form choice none is picked
// Currently not used 7/31/2001 
//

function toggleNoneOn() {

	var matched;
	var myname;
	var myvalue;
	var reg;

	reg = /\d_\d_\d+/;

	for(var i = 0;i < document.survey.length - 2;i++) {

	myname  = document.survey.elements[i].name;
	matched = myname.match(reg);

	if(matched != null) { document.survey.elements[i].checked = false;}

	} 
}




//
// Error check to bound answers between 0.01(%) and 3.00(%) to prevent future data errors
// Currently in use 14 Nov 2003
//

function doPartFraction(go) {

	var erstring;
	var reg;
	var myvalue;
	var myname;
	var check;
	var reg2;
	var reg9;
	var reg9b;
	var hold;
	var othera;
	var reg10;
	var erstring2;
	var disperstring2;
	var arrNum;
	
	
	check  = go;
	othera = 0;

	reg  = /_none/;
	reg2 = /_other\b/;
	reg2b = /SUR_non_\d+/;
	reg3 = /SUR_\otr_\d+/;
	//reg9 = /SUR_txt_\d+/;
	reg9 = /SUR_\w+_\d+/;
	reg9b = /SUR_\otx_\d+/;
	
	reg10 = /XXX_\w+_\d+/;
	
	disperstring2 = 0;
	
	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}
	for(var i = 4;i < document.survey.length;i++) 
	{

	    myvalue  = document.survey.elements[i].value;
		myname   = document.survey.elements[i].name;
		
		arrNum    = myvalue.split("."); //split the value separating with "." to check if there is only one decimal point



		//RL Hack 10 Jun 2002
//		alert(myvalue);
		if(myname.match(reg10) != null)
		{
//			alert(myvalue);
			if(myvalue == "")
			{
				erstring2 = "Please fill in the name before rating";
			}
		}
		if(myname.match(reg9b) != null)
		{
			hold = i;
		}
		if(myname.match(reg9) != null && myname.match(reg9b) == null) 
		{
		
			if(myvalue != "") { disperstring2 = 1; }
			if(myname.match(reg2) != null) { hold = i; }
	
			if(myvalue > 3 || myvalue < 0.00) 
			{ 	
				if(myvalue == "") { continue; }
						
				else 
				{	
                	erstring = "Your values must be between 0.01 - 3.00";
				}
			}

			else if(myname.match(reg) != null) { continue;}

			//added additional logic to elimate the "." when comparing, as decimal validation is done differently
			else if(myvalue.toString().replace(/\./g,'').match(/\D/) != null || arrNum.length >=3) //first condition allows numbers and "." but the second checks if there is only one "."
//			else if(myvalue.match(/\D/) != null || arrNum.length >=3) //first condition allows numbers and "." but the second checks if there is only one "."
			{ 

				if(myname.match(reg2) != null ||  myname.match(reg2b) != null) { }
				//if(myname.match(reg2b) != null) { }
				else 
				{ 
					erstring = "Your values need to be numbers"; 
					//alert(myname);
					//alert(myvalue);
				}
			}

			else if(myname.match(reg3) != null) 
			{
                   if(myvalue != "") { othera = 1; }
                   else { continue; }
            }
		}	
	}
	if(erstring != null) { alert(erstring); }
	else if(disperstring2 == 1 && erstring2 != null) { alert(erstring2); }
	/////else if (othera == 1 && document.survey.elements[hold].value == "") {alert("Please describe Other category."); }

       ///// else if (othera == 0 && document.survey.elements[hold].value != "") {alert("Please rate Other category."); }

	else if(go == false) { }

	else { document.survey.submit();}	

	return;
	
	}

//
// Check to see if value is in the range of 1-10
// Currently in use 7/31/2001
//

function overTen(go) {

	var erstring;
	var reg;
	var myvalue;
	var myname;
	var check;
	var reg2;
	var reg9;
	var reg9b;
	var hold;
	var othera;
	var reg10;
	var erstring2;
	var disperstring2;

	check  = go;
	othera = 0;

	reg  = /_none/;
	reg2 = /_other\b/;
	reg3 = /SUR_\otr_\d+/;
	//reg9 = /SUR_txt_\d+/;
	reg9 = /SUR_\w+_\d+/;
	reg9b = /SUR_\otx_\d+/;
	
	reg10 = /XXX_\w+_\d+/;
	
	disperstring2 = 0;
	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}

	for(var i = 4;i < document.survey.length;i++) 
	{

	    myvalue  = document.survey.elements[i].value;
		myname   = document.survey.elements[i].name;
		//RL Hack 10 Jun 2002
//		alert(myvalue);
		if(myname.match(reg10) != null)
		{
//			alert(myvalue);


			if(document.survey.elements[i].type == 'select-one' && document.survey.elements[i].selectedIndex <=0)
			{
				erstring2 = "Please select the name before rating";
			}

/*			if(myvalue == "") // No longer used as the text box was replaced with a ddlb
			{
				erstring2 = "Please fill in the name before rating";
			} */
		}
		if(myname.match(reg9b) != null)
		{
			hold = i;
		}
		if(myname.match(reg9) != null && myname.match(reg9b) == null) 
		{
		
			if(myvalue != "") { disperstring2 = 1; }
			if(myname.match(reg2) != null) { hold = i; }
	
			if(myvalue > 10 || myvalue < 1) 
			{ 	
				if(myvalue == "") { continue; }
						
				else 
				{	
                	erstring = "Your values must be between 1 - 10";
				}
			}

			else if(myname.match(reg) != null) { continue;}

		
			else if(myvalue.match(/\D/) != null) 
			{ 

				if(myname.match(reg2) != null) { }
				else 
				{ 
					erstring = "Your values need to be numbers"; 
					//alert(myvalue);
				}
			}

			else if(myname.match(reg3) != null) 
			{
                   if(myvalue != "") { othera = 1; }
                   else { continue; }
            }
		}	
	}
	if(erstring != null) { alert(erstring); }
	else if(disperstring2 == 1 && erstring2 != null) { alert(erstring2); }
	/////else if (othera == 1 && document.survey.elements[hold].value == "") {alert("Please describe Other category."); }

       ///// else if (othera == 0 && document.survey.elements[hold].value != "") {alert("Please rate Other category."); }

	else if(go == false) { }

	else { document.survey.submit();}	

	return;
	
	}

//
// Check to see if a year is essentially valid in a range of 1900 - 2002
// Currently used 7/31/2001
//

function doYear() {
	
	var myvalue;
	
	var myname;
	
	var reg;
	var reg9;	
	var error = 0;

	reg = /^19\d\d|^200[0|1|2|3|4|5|6|7|8|9]/;

	reg9 = /SUR_txt_\d+/;
	
	//alert('on');
	for(var i = 4; i < document.survey.length; i++) {
	
		myvalue = document.survey.elements[i].value;
		
		myname  = document.survey.elements[i].name;	

		if(myname.match(reg9) != null) 
		{
		if(myvalue.match(reg) != null) {
			continue;
		}

		else {
			if(myvalue == "" || myvalue == 0 || myvalue == "null") {
			document.survey.elements[i].value = "";
			}

			else if(myvalue.match(/\D/) != null) { error++; 
			//alert(myvalue);
						
			}

			else { error++; 
			//alert(myvalue);
			}			
		}	
		
		}
	}


	if(error > 0) { alert("Please choose a year between 1900-2009"); }
	else {  document.survey.submit(); }

	return;
}
//New Multi Add Hack - RL 7 June 2002

function doMultiAddNew() {

	var total1  = 0;
	var total2  = 0;	
	var total3  = 0;
	var utotal1 = 0;
	var utotal2 = 0;
	var utotal3 = 0;

	var isneg1;
	var isneg2;
	var isneg3;

	var reg1;
	var reg2;
	var reg3;
	var reg4;
	var reg5;
	var reg6;

	var myvalue;
	var myname;

	var pass  = 0;
	var seen4 = 0;
	var seen5 = 0;
	var seen6 = 0;


	var error    = "Please enter only numbers with/without comma separation.";	
	var is_error = 0;

	//reg1 = /\d+_\d+_total1/;
	
	reg1 = /SUR_txt_2785/;
	reg2 = /SUR_txt_2796/;
	reg3 = /SUR_txt_2795/;
	
	//reg2 = /\d+_\d+_total2/;
	//reg3 = /\d+_\d+_total3/;
//	reg4 = /\d+_\d+_1[0|3]/;
	
	reg4a = /SUR_txt_2783/;
	reg4b = /SUR_txt_2784/;
	
	//reg5 = /\d+_\d+_1[1|4]/;
	
	reg5a = /SUR_txt_2791/;
	reg5b = /SUR_txt_2793/;
	
	
	//reg6 = /\d+_\d+_1[2|5]/;
	reg6a = /SUR_txt_2792/;
	reg6b = /SUR_txt_2794/;
	
	
	reg7 = /\d+_\d+_1|2|3|4|5|6|7|8|9]$/;
//	reg7 = /SUR_txt_\d+/	
	

	for(var i = 4; i < document.survey.length; i++) {
		//alert(i);
		myname  = document.survey.elements[i].name;	
		myvalue = document.survey.elements[i].value;
		myvalue = myvalue.toString().replace(/\$|\,/g,'');
			
		if(myname.match(reg1) != null) {
			utotal1 = document.survey.elements[i].value;
				//alert(utotal1);
		}
	
		else if(myname.match(reg2) != null) {
			utotal2 = document.survey.elements[i].value;
		}
	
		else if(myname.match(reg3) != null) {
			utotal3 = document.survey.elements[i].value;
		}

		else if((myname.match(reg4a) != null) || (myname.match(reg4b)) != null) { 

			if(myvalue.match(/[^-\d+|\d+|\d+\.\d+]/) != null) {
					
			is_error++;
			//document.survey.elements[i].value = "0";
			}
			else { 

				if(seen4 == 0) { total1 += Number(myvalue); }

	
				else {
					if(Number(total1) < Number(myvalue)) {
                                        total1 = Number(myvalue) - Number(total1);
                                        isneg1 = 1;
					}
					else { total1 = total1 - Number(myvalue); }

				}

			seen4++;	

			total1 = total1.toString();
                        if(total1.match(/\D/) != null) {

                        var regg = /(\d+)\.(\d\d)/;
                        var all  = new Array();
                        all      = total1.match(regg);
                        all[2]   = all[2].substr(0,2);
                        total1   = all[1]+"."+all[2];
                        total1   = Number(total1);

                                }

			if(isneg1 == 1) { total1 = -total1; }

			}
		}

		else if((myname.match(reg5a) != null) || (myname.match(reg5b) != null)) { 
			
			if(myvalue.match(/[^-\d+|\d+|\d+\.\d+]/) != null) { 
			

			is_error++;
			//document.survey.elements[i].value = "0";
			
			}

                        else { 

			if(seen5 == 0) { total2 += Number(myvalue); }
	
			else { 

				if(Number(total2) < Number(myvalue)) {

	                        total2 = Number(myvalue) - Number(total2);
                	        total2 = Number(total2);
                        	isneg2 = 1;
                                }
				else 
				{ total2 = total2 - Number(myvalue); }
	
				

			}
			seen5++;
			
			total2 = total2.toString();
                        if(total2.match(/\D/) != null) {

                        var regg = /(\d+)\.(\d\d)/;
                        var all  = new Array();
                        all      = total2.match(regg);
                        all[2]   = all[2].substr(0,2);
                        total2   = all[1]+"."+all[2];
                        total2   = Number(total2);

                                }

			if(isneg2 == 1) { total2 = -total2; } 

			}
		}
		
		else if((myname.match(reg6a) != null) || (myname.match(reg6b) != null)) {
			
			if(myvalue.match(/[^-\d+/|\d+|\d+\.\d+]/) != null) { 
			is_error++;
			

			//document.survey.elements[i].value = "0";
			}


                        else {
	 
			if(seen6 == 0) { total3 += Number(myvalue); }

			else { 
			   	if(Number(total3) < Number(myvalue)) {
        	                total3 = Number(myvalue) - Number(total3);
                        	isneg3 = 1;
                                }
				else { total3 -= Number(myvalue); }					
			}

			seen6++;

			total3 = total3.toString();
			if(total3.match(/\D/) != null) {

			var regg = /(\d+)\.(\d\d)/;
			var all  = new Array();
 			all      = total3.match(regg);
			all[2]   = all[2].substr(0,2);
			total3   = all[1]+"."+all[2];
			total3   = Number(total3);

				}

			if(isneg3 == 1) { total3 = -total3; }

			}
		}

		else if(myname.match(reg7) != null) {
			
			if(myvalue.match(/[^-\d|\d+|\d+\.\d+]/) != null) {
			is_error++;
			pass++;
			//document.survey.elements[i].value = "0";
			}
		}
	}




	for(var i = 4; i < document.survey.length; i++) {
		//alert(i);
		myname  = document.survey.elements[i].name;	
		myvalue = document.survey.elements[i].value;

		if(myname.match(reg1) != null) {
			document.survey.elements[i].value = total1;
				//alert(utotal1);
		}
	
		else if(myname.match(reg2) != null) {
			document.survey.elements[i].value = total2;
		}
	
		else if(myname.match(reg3) != null) {
			document.survey.elements[i].value = total3;
		}
	}


	if(is_error > 0) { alert(error); }

	//if(total1 != utotal1) { alert("Your total in column 1 doesn't add up."); pass = 1; }
	//if(total2 != utotal2) { alert("Your total in column 2 doesn't add up."); pass = 1; }
	//if(total3 != utotal3) { alert("Your total in column 3 doesn't add up."); pass = 1; }


	if(pass == 0) { document.survey.submit(); }
	
	return;

}



//
// Performs a totals check on 3 columns of data
// Currently used 7/31/2001
//

function doMultiAdd() {

	var total1  = 0;
	var total2  = 0;	
	var total3  = 0;
	var utotal1 = 0;
	var utotal2 = 0;
	var utotal3 = 0;

	var isneg1;
	var isneg2;
	var isneg3;

	var reg1;
	var reg2;
	var reg3;
	var reg4;
	var reg5;
	var reg6;

	var myvalue;
	var myname;

	var pass  = 0;
	var seen4 = 0;
	var seen5 = 0;
	var seen6 = 0;


	var error    = "Please enter only numbers without comma separation.";	
	var is_error = 0;

	reg1 = /\d+_\d+_total1/;
	reg2 = /\d+_\d+_total2/;
	reg3 = /\d+_\d+_total3/;
	reg4 = /\d+_\d+_1[0|3]/;
	reg5 = /\d+_\d+_1[1|4]/;
	reg6 = /\d+_\d+_1[2|5]/;
	reg7 = /\d+_\d+_1|2|3|4|5|6|7|8|9]$/;	
	

	for(var i = 4; i < document.survey.length; i++) {

		myname  = document.survey.elements[i].name;	
		myvalue = document.survey.elements[i].value;

		if(myname.match(reg1) != null) {
			utotal1 = document.survey.elements[i].value;
		}
	
		else if(myname.match(reg2) != null) {
			utotal2 = document.survey.elements[i].value;
		}
	
		else if(myname.match(reg3) != null) {
			utotal3 = document.survey.elements[i].value;
		}

		else if(myname.match(reg4) != null) { 

			if(myvalue.match(/[^-\d+|\d+|\d+\.\d+]/) != null) {
			is_error++;
			//document.survey.elements[i].value = "0";
			}
			else { 

				if(seen4 == 0) { total1 += Number(myvalue); }

	
				else {
					if(Number(total1) < Number(myvalue)) {
                                        total1 = Number(myvalue) - Number(total1);
                                        isneg1 = 1;
					}
					else { total1 = total1 - Number(myvalue); }

				}

			seen4++;	

			total1 = total1.toString();
                        if(total1.match(/\D/) != null) {

                        var regg = /(\d+)\.(\d\d)/;
                        var all  = new Array();
                        all      = total1.match(regg);
                        all[2]   = all[2].substr(0,2);
                        total1   = all[1]+"."+all[2];
                        total1   = Number(total1);

                                }

			if(isneg1 == 1) { total1 = -total1; }

			}
		}

		else if(myname.match(reg5) != null) { 
			
			if(myvalue.match(/[^-\d+|\d+|\d+\.\d+]/) != null) { 
			is_error++;
			//document.survey.elements[i].value = "0";
			
			}

                        else { 

			if(seen5 == 0) { total2 += Number(myvalue); }
	
			else { 

				if(Number(total2) < Number(myvalue)) {

	                        total2 = Number(myvalue) - Number(total2);
                	        total2 = Number(total2);
                        	isneg2 = 1;
                                }
				else 
				{ total2 = total2 - Number(myvalue); }
	
				

			}
			seen5++;
			
			total2 = total2.toString();
                        if(total2.match(/\D/) != null) {

                        var regg = /(\d+)\.(\d\d)/;
                        var all  = new Array();
                        all      = total2.match(regg);
                        all[2]   = all[2].substr(0,2);
                        total2   = all[1]+"."+all[2];
                        total2   = Number(total2);

                                }

			if(isneg2 == 1) { total2 = -total2; } 

			}
		}
		
		else if(myname.match(reg6) != null) {
			
			if(myvalue.match(/[^-\d+/|\d+|\d+\.\d+]/) != null) { 
			is_error++;
			//document.survey.elements[i].value = "0";
			}


                        else {
	 
			if(seen6 == 0) { total3 += Number(myvalue); }

			else { 
			   	if(Number(total3) < Number(myvalue)) {
        	                total3 = Number(myvalue) - Number(total3);
                        	isneg3 = 1;
                                }
				else { total3 -= Number(myvalue); }					
			}

			seen6++;

			total3 = total3.toString();
			if(total3.match(/\D/) != null) {

			var regg = /(\d+)\.(\d\d)/;
			var all  = new Array();
 			all      = total3.match(regg);
			all[2]   = all[2].substr(0,2);
			total3   = all[1]+"."+all[2];
			total3   = Number(total3);

				}

			if(isneg3 == 1) { total3 = -total3; }

			}
		}

		else if(myname.match(reg7) != null) {
			
			if(myvalue.match(/[^-\d|\d+|\d+\.\d+]/) != null) {
			is_error++;
			pass++;
			//document.survey.elements[i].value = "0";
			}
		}
	}


	if(is_error > 0) { alert(error); }

	if(total1 != utotal1) { alert("Your total in column 1 doesn't add up."); pass = 1; }
	if(total2 != utotal2) { alert("Your total in column 2 doesn't add up."); pass = 1; }
	if(total3 != utotal3) { alert("Your total in column 3 doesn't add up."); pass = 1; }


	if(pass == 0) { document.survey.submit(); }
	
	return;

}


//
// Counts employees Survey 1
// Used 7/25/2001
//


function doEmployeesNew() {
	
	var employees;
	var reg1;
	var reg2;
	var regTP;
	var regIR;
	var regFA;
	var total = 0;
	var myvalue;
	var myname;
	var matched;
	var matched2;
	var baddata;
	var hold;
	var holda;
	var holdindex;

	var index = document.survey.length - 1;
	

//	reg1 = /\d+_\d+_total\d+/;
	reg1    = /\d+_\d+_total\d/;
	
	//reg2 = /\d+_\d+_\d+/;
	reg2 = /SUR_txt_\d+/;
	
	
	//reg3 = /_other\w+/;	
	reg3 = /SUR_otr_\d+/;
	
	
	//reg4 = /_other\b/;
	reg4 = /SUR_otx_\d+/;
	
	//text box names displaying partner count in various surveys
	regTP = /SUR_txt_227/;
	regIR =/SUR_txt_2153/;
	regFA = /SUR_txt_3285/;
	
//		reg9 = /SUR_txt_\d+/;
//reg9 = /SUR_\w+_\d+/;
	//reg  = /_none/;
	//reg2 = /_other\b/;
	//reg3 = /_other\w+/;
	//reg9 = /SUR_txt_\d+/;
	//reg9 = /SUR_\w+_\d+/;
//	reg1    = /\d+_\d+_total\d/;
	
	
	

	hold    = 0;
	holda   = 0;
	baddata = 0;

	for(var i = 4; i < document.survey.length; i++) {

		myvalue = document.survey.elements[i].value;	
		myname  = document.survey.elements[i].name;
		
		matched  = myname.match(reg2)
		matched2 = myname.match(reg3);
		
		//for atleast one partner validation
		if(myname.match(regTP) != null) 
		{ 
			iPartners = myvalue;
		}
		if(myname.match(regIR) != null) 
		{ 
			iPartners = myvalue;
		}
		if(myname.match(regFA) != null) 
		{ 
			iPartners = myvalue;
		}
		//hold = 0;
		if(myname.match(reg4) != null) { 
			if(myvalue != "") { hold = 1; holdindex = i }
		} 

		if(matched != null) { 
			
			if(myvalue.match(/\D/)) {
			        
				  var support;
				  var modcheck;
					
				  support = myvalue;	
				  support = support.toString();
                       
				  if(support.match(/\./) != null) {

				  var regg  = /(\d+)?\.(\d+)/;
                        	  var all   = new Array();
                        	  all       = support.match(regg);
						
					  if(all != null) {
					  all[0]   = Number(all[0]);
					  modcheck = all[0] % 0.5; 
					 
					  if(modcheck != 0)  {
					  alert("Please use multiples of 0.5");
					  baddata = 1;
					  }


					  else {		
				
	               	                  support   =  all[0];
                        		  support   =  Number(support);
			 		  total     += Number(support);						
					  }	


				} else { alert("Please enter a number"); }
			}

		else { alert("Numbers only please"); }
			

			} else 
				{ total += Number(myvalue); } 
		}

		else if(matched2 != null) {
			holda = i;		
			if(myvalue.match(/\D/)) {
	
                                  var support;

                                  support = myvalue;
                                  support = support.toString();

                                  if(support.match(/\./) != null) {

                                  var regg  = /(\d+)?\.(\d+)/;
                                  var all   = new Array();
                                  all       = support.match(regg);

					  if(all != null) {
                                          all[0]   = Number(all[0]);
                                          modcheck = all[0] % 0.5;

                                          if(modcheck != 0)  {
                                          alert("Please use multiples of 0.5");
                                          baddata = 1;
                                          }


                                          else {
                                          support   =  all[0];
                                          support   =  Number(support);
                                          total     += Number(support);
					  }
							

                                          } else { alert("Please enter a number"); }
                                  }

                                else { alert("Numbers only please"); }


                        } else
                                { total += Number(myvalue); }
		}
	}

	employees = document.survey.elements[index].value;

	if(employees != total) { alert("Please check the totals!"); }

	else if(baddata > 0) {  }
	else if(iPartners != null  && iPartners < 1)
	{
		alert('Please enter at least one Partner');
	}
	/////else if(hold == 1 && document.survey.elements[holdindex].value == "")           { alert("Please rate other category."); }

        /////else if(document.survey.elements[holda].value != ""  && hold == 0)      { alert("Please describe other category."); }

	else { 
	if (total > 0)
	{
		document.survey.elements[index].value = total;
	}
	else
	{
		document.survey.elements[index].value = ""
	}
	document.survey.submit();}
}


function doEmployees() {
	
	var employees;
	var reg1;
	var reg2;
	var total = 0;
	var myvalue;
	var myname;
	var matched;
	var matched2;
	var baddata;
	var hold;
	var holda;
	var holdindex;

	var index = document.survey.length - 1;
	

//	reg1 = /\d+_\d+_total\d+/;
	reg1    = /\d+_\d+_total\d/;
	
	//reg2 = /\d+_\d+_\d+/;
	reg2 = /SUR_txt_\d+/;
	
	
	//reg3 = /_other\w+/;	
	reg3 = /SUR_otr_\d+/;
	
	
	//reg4 = /_other\b/;
	reg4 = /SUR_otx_\d+/;
	
	
	
//		reg9 = /SUR_txt_\d+/;
//reg9 = /SUR_\w+_\d+/;
	//reg  = /_none/;
	//reg2 = /_other\b/;
	//reg3 = /_other\w+/;
	//reg9 = /SUR_txt_\d+/;
	//reg9 = /SUR_\w+_\d+/;
//	reg1    = /\d+_\d+_total\d/;
	
	
	

	hold    = 0;
	holda   = 0;
	baddata = 0;

	for(var i = 4; i < document.survey.length; i++) {

		myvalue = document.survey.elements[i].value;	
		myname  = document.survey.elements[i].name;
		
		matched  = myname.match(reg2)
		matched2 = myname.match(reg3);
		//hold = 0;
		if(myname.match(reg4) != null) { 
			if(myvalue != "") { hold = 1; holdindex = i }
		} 

		if(matched != null) { 
			
			if(myvalue.match(/\D/)) {
			        
				  var support;
				  var modcheck;
					
				  support = myvalue;	
				  support = support.toString();
                       
				  if(support.match(/\./) != null) {

				  var regg  = /(\d+)?\.(\d+)/;
                        	  var all   = new Array();
                        	  all       = support.match(regg);
						
					  if(all != null) {
					  all[0]   = Number(all[0]);
					  modcheck = all[0] % 0.5; 
					 
					  if(modcheck != 0)  {
					  alert("Please use multiples of 0.5");
					  baddata = 1;
					  }


					  else {		
				
	               	                  support   =  all[0];
                        		  support   =  Number(support);
			 		  total     += Number(support);						
					  }	


				} else { alert("Please enter a number"); }
			}

		else { alert("Numbers only please"); }
			

			} else 
				{ total += Number(myvalue); } 
		}

		else if(matched2 != null) {
			holda = i;		
			if(myvalue.match(/\D/)) {
	
                                  var support;

                                  support = myvalue;
                                  support = support.toString();

                                  if(support.match(/\./) != null) {

                                  var regg  = /(\d+)?\.(\d+)/;
                                  var all   = new Array();
                                  all       = support.match(regg);

					  if(all != null) {
                                          all[0]   = Number(all[0]);
                                          modcheck = all[0] % 0.5;

                                          if(modcheck != 0)  {
                                          alert("Please use multiples of 0.5");
                                          baddata = 1;
                                          }


                                          else {
                                          support   =  all[0];
                                          support   =  Number(support);
                                          total     += Number(support);
					  }
							

                                          } else { alert("Please enter a number"); }
                                  }

                                else { alert("Numbers only please"); }


                        } else
                                { total += Number(myvalue); }
		}
	}

	employees = document.survey.elements[index].value;

	if(employees != total) { alert("Please check the totals!"); }

	else if(baddata > 0) {  }

	/////else if(hold == 1 && document.survey.elements[holdindex].value == "")           { alert("Please rate other category."); }

        /////else if(document.survey.elements[holda].value != ""  && hold == 0)      { alert("Please describe other category."); }

	else { document.survey.elements[index].value = total;document.survey.submit();}
}



function doWholeNumbers1(go) {

        var myvalue;
        var myname;
        var matched;
	var reg;
	var reg1;
        var index;
	var checked;
	var hold;
	var holda;

	checked = go;
	matched = 0;
	hold    = 0;
	holda   = 0;

	index   = document.survey.length - 1;
	reg     = /\./;
	////reg1    =/\_other\b/;
	reg1    = /SUR_otx_\d+/;

	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}

        for(var i = 4; i < document.survey.length - 1; i++) {
        
	        myvalue = document.survey.elements[i].value;
                myname  = document.survey.elements[i].name;


		if(myname.match(reg1) != null) { if(myvalue != "") { hold = 1; } 
		}		
		
		if(myname.match(/SUR_otr_\d+/) != null) { 
			if(myvalue != "") { holda = 1; }
		}

		if(myvalue.match(/\D/) != null) {

			if(myname.match(reg1) != null) { }
			else if(myname.match('Navigation') != null) { }
			
			else if (myvalue == "" || myvalue == null || myvalue == 0) { continue; }
			
			else { 
			////alert(myname);
			matched++; }
		}
	}
		
	
        if(matched > 0) { alert("Please enter whole numbers"); }

        else if(checked == false) { }

	/////else if(hold == 1 && holda == 0) {alert("Please rate Other category");}

	/////else if(holda == 1 && hold == 0) {alert("Please describe Other category");}

	else { document.survey.submit(); }
	
	return;	
}

function doWholeNumbers2(go) {

        var myvalue;
        var myname;
        var matched;
        var reg;
        var reg1;
        var index;
	var total  = 0;
	var utotal = 0;
	var checked;
	var hold;
	var holda;
	
	checked = go;
	hold    = 0;
	holda   = 0;

	matched = 0;
        reg     = /\./;
	reg2 = /SUR_txt_\d+/;
	//reg1    = /\d+_\d+_total\d/;
	reg1    = 	/SUR_tot_\d+/;
	
	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}
	
	
        for(var i = 4; i < document.survey.length; i++) {

                myvalue = document.survey.elements[i].value;
                myname  = document.survey.elements[i].name;
//alert(myname);
		if(myname.match(/SUR_otx_\d+/) != null) { 
		
			if(myvalue != "") { hold = 1; }
                }

                if(myname.match(/SUR_otr_\d+/) != null) {
                        if(myvalue != "") { holda = 1; }
                }


         //		if(myvalue.match(/\D/) != null && myname.match('Navigation') == null && myname.match(/SUR_otx_\d+/) == null) {
		 		if(myvalue.match(/\D/) != null && myname.match(reg2) != null ) {
                matched++;
				
                document.survey.elements[i].value = "";
                }
		//else if(myname.match('Navigation') != null) {  }
		//else if(myname.match(/SUR_otx_\d+/) != null) { }
		else if(myname.match(reg2) != null) { total += Number(myvalue);}		
		else if(myname.match(reg1) != null) {
			utotal = document.survey.elements[i].value;
		}
		//else { total += Number(myvalue); }
        }

	if(matched > 0)  { 
	alert("Please use only whole numbers");
	
	  }

        else if(utotal != total) { alert("Please check totals"); }
 
	/////else if(hold == 1 && holda == 0) { alert("Please rate Other category"); }

	/////else if(holda == 1 && hold == 0) { alert("Please describe Other category"); }

	else if(checked == false) { } 

 

       else { document.survey.submit(); }
	
	return;
}


function doTotals(go) {

	var new_total = 0;
	var myname;
	var myvalue;
	var reg;
	var reg1;
	var reg2;
	var reg9;
	var error = 0;
	var code = new Array();	
	var erstring = '';
	var answered = 0;
	var already;
	var checked;
	var othera;
	var other;
	var totindex;

	other   = 0;
	othera  = 0;
	checked = go;

	code = ["","Please use only numbers\n", "Your total is more than 100%\n","Your total is less than 100%\n"];
//	code = ["","","","","","",""]

	//reg  = /\d+_\d+_\d+/;
	reg = /SUR_txt_\d+/;
	
//	reg1 = /\d+_\d+_other\w+/;
	reg1 = /SUR_otr_\d+/;
	reg2 = /SUR_otx_\d+/;
	//reg2 = /_other\b/;
	
	
	reg9 = /YYY_tot_\d+/; // total text box


	

	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}

	for(var i = 4; i < document.survey.length; i++) {
		
		myname  = document.survey.elements[i].name;
		myvalue = document.survey.elements[i].value;
		
		
		if(myname.match(reg9) != null) {
			 totindex = i; 

		}

		
		//
		if(myname.match(reg9) == null) {
			//alert(myvalue);
		//
		if(myname.match(reg2) != null) {
			if(myvalue != "") {  other = 1; }		

		}

		if(myname.match(reg) != null) {

			if(myvalue.match(/\D/) != null) {
                        error = 1;

			already = erstring.match(code[error]);

			if(already == null) { erstring += code[error]; }
			answered++;
                	}

			if(myvalue.match(/\d/) != null) {  

			new_total += Number(myvalue);

			answered++;

				if(new_total > 100) {
				new_total = new_total - myvalue;
				error = 2;
				already = erstring.match(code[error]);
                                if(already == null) { erstring += code[error]; }
				}
			}
		}
	
		else if(myname.match(reg1) != null) {

			if(myvalue.match(/\D/) != null) {
			myvalue = 0;
                        error = 1;
			already = erstring.match(code[error]);
                        if(already == null) { erstring += code[error]; }
			answered++;
                	}

			if(myvalue != "") {  othera = 1; }

			new_total = new_total + Number(myvalue);
			answered++;
			if(new_total > 100) {
				new_total = new_total - Number(myvalue);
				error = 2;
				already = erstring.match(code[error]);

                      	if(already == null) { erstring += code[error]; }
				}
			}
			
			//
				}		
				//
			
		}





	//alert(totindex);
//	alert(answered);
	if(answered > 1) { 
	document.survey.elements[totindex].value = new_total; 
	//alert('in');
	}
		
	if(error == 0) { 

		if(answered == 0 && new_total > 1) { document.survey.elements[totindex].value = ""; document.survey.submit(); }
		
		/////else if(other == 1 && othera == 0)      { alert("Please rate other category."); }

                /////else if(othera == 1 && other == 0)      { alert("Please describe other category."); }
	
		else if(answered >= 1 && new_total < 100) { error = 3; erstring +=code[error];  alert(erstring);}
	
		else { document.survey.submit(); }
	}	

	else if(checked == false) { }

	else { alert(erstring);}

	return;
}


function doMoney(go) {

	var money;
	var myvalue;
	var myname;
	var error;
	var reg;
	var reg9;
	var mon;
	var dollar;
	var cent;
	var checked;

	checked = go;

	mon = new Array();

	reg  = /[a-zA-Z\-\\\/\*\+\?\(\)\,]/; 
	
	reg9 = /SUR_txt_\d+/;
	
	error = 0;
	
	if(go) //Added this check so that when "Not Applicable" is checked it will not do any further validation but just submit the form RL 16 Feb 2004
	{
		document.survey.submit()	
		return true;
	}
	
	for(var i = 4; i < document.survey.length; i++) {

		myvalue = document.survey.elements[i].value;
		myname  = document.survey.elements[i].name;

		if(myvalue.match(reg) != null) 
		{
		
			//if(myvalue.match(/\d+\.\d\d\b/) != null || myvalue.match(/_none/) != null) { }
//			if(myname.match(/Navigation/) != null || myvalue.match(/SUR_non_\d+/) != null) { 
			if(myname.match(reg9) != null ) { 
			//}

			//else { 
			
			//alert(myvalue);
			//alert(myname);

			document.survey.elements[i].value = ""; error++;}
			
		}

		else {

		mon    = myvalue.split(".");
		dollar = mon[0];
		
		if(mon[1]){ cent = mon[1].substring(0,2); }
		else { cent = ".00";}
	

		if(cent == ".00") { money = dollar + cent; }
		else { money = dollar + "." + cent; }

		if(money == ".00") { money = "";}

		document.survey.elements[i].value = money;

		}
	}

	if(error > 0) { alert("Please use only numbers without comma separation"); }


	else if(checked == false) { }

	else { document.survey.submit(); }
	
	return;

}


