		function OnChangeDDLSource()
		{
			document.all("txtOtherSrcDesc").value = ""		
			document.all("txtRepName").value = ""
			document.all("txtRepCo").value = ""	
			
			var str = document.all("ddlSource").value
			if( str=="Sales Representative")
			{
				document.all("tblReg").rows[7].style.display = "block";
				document.all("tblReg").rows[8].style.display = "block";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, true)
				ValidatorEnable(rfvRepCo, true)
				ValidatorEnable(rfvOtherSrcDesc, false)
			}
			else if(str=="Other")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "block";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)
			}
			else if(str=="Through an associate")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "block";
				document.all("tblReg").rows[11].style.display = "block";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,true)
				ValidatorEnable(rfvAssocCo,true)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc,false)
			}
			else if(str=="Advertisement")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "block";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,true)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, false)
			}
			else if(str=="Convention")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "block";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,true)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, false)
			}
			else
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "block";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)	
			}
		}	
		function OnChangeDDLUserType()
		{
			document.all("txtLicNo").value = ""
			document.all("txtLicExpires").value = ""
			document.all("txtCompanyID").value = ""

			var str = document.all("ddlUserType").value
			if( str=="Other" || str=="")
			{
				document.all("tblReg").rows[17].style.display = "none";
				document.all("tblReg").rows[18].style.display = "none";
				document.all("tblReg").rows[19].style.display = "none";
				document.all("tblReg").rows[20].style.display = "none";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, false)
				ValidatorEnable(cvLicExpires, false)
				ValidatorEnable(rfvLicExpires, false)
				ValidatorEnable(rfvManage,false)
				ValidatorEnable(rfvSystem,false)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
			else if (str=="SAM Direct")
			{
				document.all("tblReg").rows[17].style.display = "block";
				document.all("tblReg").rows[18].style.display = "block";
				document.all("tblReg").rows[19].style.display = "block";
				document.all("tblReg").rows[20].style.display = "block";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, true)
				ValidatorEnable(cvLicExpires, true)
				ValidatorEnable(rfvLicExpires, true)
				ValidatorEnable(rfvManage,true)
				ValidatorEnable(rfvSystem,true)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
			else if (str=="SAM Exchange")
			{
				document.all("tblReg").rows[17].style.display = "block";
				document.all("tblReg").rows[18].style.display = "block";
				document.all("tblReg").rows[19].style.display = "block";
				document.all("tblReg").rows[20].style.display = "block";
				document.all("tblReg").rows[21].style.display = "block";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, true)
				ValidatorEnable(cvLicExpires, true)
				ValidatorEnable(rfvLicExpires, true)
				ValidatorEnable(rfvManage,true)
				ValidatorEnable(rfvSystem,true)
				ValidatorEnable(rfvFirstPromptDDL,true)
				ValidatorEnable(rfvCompanyID,false)
			}
			else
			{
				document.all("tblReg").rows[17].style.display = "none";
				document.all("tblReg").rows[18].style.display = "none";
				document.all("tblReg").rows[19].style.display = "none";
				document.all("tblReg").rows[20].style.display = "none";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, false)
				ValidatorEnable(cvLicExpires, false)
				ValidatorEnable(rfvLicExpires, false)
				ValidatorEnable(rfvManage,false)
				ValidatorEnable(rfvSystem,false)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
		}
		function OnChangeFirstPromptDDL()
		{
			var str = document.all("FirstPromptDDL").value
			if (str == "No") {
				document.all("tblReg").rows[22].style.display = "block"
				ValidatorEnable(rfvFirstPromptDDL,true)
			}
			else {
				document.all("tblReg").rows[22].style.display = "none"
				ValidatorEnable(rfvCompanyID,false)
				document.all("txtCompany").enabled = "true"
			}
		}	
		function init()
		{
			var str = document.all("ddlSource").value
			if( str=="Sales Representative")
			{
				document.all("tblReg").rows[7].style.display = "block";
				document.all("tblReg").rows[8].style.display = "block";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, true)
				ValidatorEnable(rfvRepCo, true)
				ValidatorEnable(rfvOtherSrcDesc, false)
			}
			else if(str=="Other")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "block";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)
			}
			else if(str=="Through an associate")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "block";
				document.all("tblReg").rows[11].style.display = "block";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,true)
				ValidatorEnable(rfvAssocCo,true)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)
			}
			else if(str=="Advertisement")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "block";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,true)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)
			}
			else if(str=="Convention")
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "none";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "block";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,true)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)
			}
			else
			{
				document.all("tblReg").rows[7].style.display = "none";
				document.all("tblReg").rows[8].style.display = "none";
				document.all("tblReg").rows[9].style.display = "block";
				document.all("tblReg").rows[10].style.display = "none";
				document.all("tblReg").rows[11].style.display = "none";
				document.all("tblReg").rows[12].style.display = "none";
				document.all("tblReg").rows[13].style.display = "none";
				document.all("tblReg").rows[14].style.display = "none";
				ValidatorEnable(rfvAssocName,false)
				ValidatorEnable(rfvAssocCo,false)
				ValidatorEnable(rfvAdv,false)
				ValidatorEnable(rfvConv,false)
				ValidatorEnable(rfvRepName, false)
				ValidatorEnable(rfvRepCo, false)
				ValidatorEnable(rfvOtherSrcDesc, true)	
			}
			str = document.all("ddlUserType").value
			if( str=="Other" || str=="")
			{
				document.all("tblReg").rows[17].style.display = "none";
				document.all("tblReg").rows[18].style.display = "none";
				document.all("tblReg").rows[19].style.display = "none";
				document.all("tblReg").rows[20].style.display = "none";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, false)
				ValidatorEnable(cvLicExpires, false)
				ValidatorEnable(rfvLicExpires, false)
				ValidatorEnable(rfvManage,false)
				ValidatorEnable(rfvSystem,false)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
			else if (str=="SAM Direct")
			{
				document.all("tblReg").rows[17].style.display = "block";
				document.all("tblReg").rows[18].style.display = "block";
				document.all("tblReg").rows[19].style.display = "block";
				document.all("tblReg").rows[20].style.display = "block";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, true)
				ValidatorEnable(cvLicExpires, true)
				ValidatorEnable(rfvLicExpires, true)
				ValidatorEnable(rfvManage,true)
				ValidatorEnable(rfvSystem,true)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
			else if (str=="SAM Exchange")
			{
				document.all("tblReg").rows[17].style.display = "block";
				document.all("tblReg").rows[18].style.display = "block";
				document.all("tblReg").rows[19].style.display = "block";
				document.all("tblReg").rows[20].style.display = "block";
				document.all("tblReg").rows[21].style.display = "block";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, true)
				ValidatorEnable(cvLicExpires, true)
				ValidatorEnable(rfvLicExpires, true)
				ValidatorEnable(rfvManage,true)
				ValidatorEnable(rfvSystem,true)
				ValidatorEnable(rfvFirstPromptDDL,true)
				ValidatorEnable(rfvCompanyID,false)
			}
			else
			{
				document.all("tblReg").rows[17].style.display = "none";
				document.all("tblReg").rows[18].style.display = "none";
				document.all("tblReg").rows[19].style.display = "none";
				document.all("tblReg").rows[20].style.display = "none";
				document.all("tblReg").rows[21].style.display = "none";
				document.all("tblReg").rows[22].style.display = "none";
				ValidatorEnable(rfvLicNo, false)
				ValidatorEnable(cvLicExpires, false)
				ValidatorEnable(rfvLicExpires, false)
				ValidatorEnable(rfvManage,false)
				ValidatorEnable(rfvSystem,false)
				ValidatorEnable(rfvFirstPromptDDL,false)
				ValidatorEnable(rfvCompanyID,false)
			}
			var str = document.all("FirstPromptDDL").value
			if (str == "No") {
				document.all("tblReg").rows[22].style.display = "block"
				ValidatorEnable(rfvFirstPromptDDL,true)
			}
			else {
				document.all("tblReg").rows[22].style.display = "none"
				ValidatorEnable(rfvCompanyID,false)
				document.all("txtCompanyID").value = ""
			}
		}
		function ToggleDiv(strName)
			{
				var strVisibility=new String();
				strVisibility=document.all(strName).style.display;
				document.all(strName).style.display=(strVisibility=="none")?"block":"none";
			}
		function MasterToggle()
			{
			//	ToggleDiv("divStanCols");
				ToggleDiv("divStanButton")
				ToggleDiv("divCustCols");
				ToggleDiv("divSearch2Details");
			}
		function AddRemoveAll(bAdd)
			{
				var strSource, strDest;
				if(bAdd)
				{
					strSource = "ColumnsL";
					strDest = "ColumnsR1";
				}
				else
				{
					strSource = "ColumnsR1";
					strDest = "ColumnsL";
				}
				for(var ii=0; ii<document.all(strDest).options.length; ii++)
					document.all(strDest).options.remove(ii);
				for(var ii=0; ii<document.all(strSource).options.length; ii++)
				{
					var opt = document.createElement("OPTION");
					document.all(strDest).options.add(opt);
					opt.text=document.all(strSource).options(ii).text;
				}				
				for(var ii=0; ii<document.all(strSource).options.length; ii++)					
					document.all(strSource).options.remove();	
			}
			function RemoveAll()
			{
			
			}
			//bAdd=true->Add, bAdd=false ->Remove
			function AddRemoveItems(bAdd)
			{
				var strSource, strDest;
				if(bAdd)
				{
					strSource = "ColumnsL";
					strDest = "ColumnsR1";
				}
				else
				{
					strSource = "ColumnsR1";
					strDest = "ColumnsL";
				}
				var ii;
				var str="", str2="";
				var aToRemove = new Array();
				var nLenSrc=document.all(strSource).options.length;
				aToRemove.length = nLenSrc;
				for(ii=0;ii<nLenSrc;ii++)
				{				
					//str+= " " + ii + " " + document.all(strSource).options(ii).selected;
					aToRemove[ii]="";
					if(document.all(strSource).options(ii).selected==true)
					{		
						var opt = document.createElement("OPTION");
						document.all(strDest).options.add(opt);
						opt.text=document.all(strSource).options(ii).text;
						aToRemove[ii] = opt.text;
					}
				}
				for(ii=0; ii<document.all(strDest).options.length; ii++)
				{
					for(jj=0; jj<document.all(strSource).options.length; jj++)
					{
						if(document.all(strSource).options(jj).text==document.all(strDest).options(ii).text)
							document.all(strSource).options.remove(jj);
					}
				}
				for(ii=0;ii<document.all(strSource).options.length; ii++)
					document.all(strSource).options(ii).selected=false;
				if(ii>0) document.all(strSource).options(0).selected=true;
			}			
			function OpenWin(strURL)
			{
				document.open(strURL, "newWin", "height=300,width=700,status=no,toolbar=no,menubar=no,location=no");
			}
			function FillAllPercentages()
			{
				
				var oColl=document.forms[0];
				var perc = parseFloat(oColl["txtPerc"].value)
				if(isNaN(perc))
				{
					alert('Enter a numeric value in the Percentage field if you want to apply that value to all the records.');
					return;
				}
				else if(perc>100 || perc<0)
				{
					alert('Enter a number less than 100 in the Percentage field if you want to apply that value to all the records.');
					return;
				}	
				
				for(var nCount=0; nCount<oColl.length; nCount++)
					if(oColl[nCount].id.substring(0,12)=='txtOfferPerc')
						oColl[nCount].value=perc;
			}
			function getScrollBottom(p_oElem){
				return p_oElem.scrollHeight - p_oElem.scrollTop - p_oElem.clientHeight;
			}
			function setScrollLeft() {
				document.all("tableDiv").scrollLeft = 0;
			}