var strNewThrobberImg = '<img src="images/smallgreythrober.gif" />';
var strNewThrobberAdminImg = '<img src="../../images/smallgreythrober.gif" />';
var strAjaxFileName = 'processAjax.inc.php?';

function fnAJXAddCCDtls(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addCCDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divCC'+intClientId, 'imgToggleCC'+intClientId);
						fnHideMsg('CC');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDelCCDtls(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&ccid="+intRecordId+"&act=delCCDtls&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divCC'+intClientId, 'imgToggleCC'+intClientId);
							fnHideMsg('CC');
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}



function fnAJXAddSEOSite(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addSEOSite&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divSEOS'+intClientId, 'imgToggleSEOS'+intClientId);
						fnHideMsg('SEO');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteSEOSite(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&ssid="+intRecordId+"&act=delSEOSite&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divSEOS'+intClientId, 'imgToggleSEOS'+intClientId);
							fnHideMsg('SEO');
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}


function fnAJXAddNote(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	//if ((intClientId > 0))
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divCN'+intClientId, 'imgToggleCN'+intClientId);
						fnHideMsg('NOTE');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteNote(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&nid="+intRecordId+"&act=delNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divCN'+intClientId, 'imgToggleCN'+intClientId);
							fnHideMsg('NOTE');
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXAddTT(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	//if ((intClientId > 0))
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addTT&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divTT'+intClientId, 'imgToggleTT'+intClientId);
						fnHideMsg('TT');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteTT(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&ttid="+intRecordId+"&act=delTT&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divTT'+intClientId, 'imgToggleTT'+intClientId);
							fnHideMsg('TT');
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXCredChrg(intSEOSoteId, intRecordId, resDivId,throbberDivId)
{
	if (intSEOSoteId > 0)
	{
		document.getElementById('hdnSiteId').value = intSEOSoteId;
		
		strArgs = "ssid="+intSEOSoteId+"&act=getPackDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						strReturnValues = xmlHTTP.responseText;
						
						var arrRtnVal = strReturnValues.split("_");
						document.getElementById('hdnPackId').value = arrRtnVal[0];
						document.getElementById('tdPackg').innerHTML = arrRtnVal[1];
						document.getElementById('txtChrgAmount').value = arrRtnVal[2];
						document.getElementById(throbberDivId).innerHTML = '';
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXAddAgentNote(intAgentId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intAgentId != ''))
	{
		strArgs = "aid="+intAgentId+"&iup="+intIsUpdt+"&act=addAgenNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggleAgent('divAN'+intAgentId, 'imgToggleAN'+intAgentId);
						fnAgentHideMsg('NOTE',intAgentId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteAgentNote(intAgentId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intAgentId != ''))
		{
			strArgs = "aid="+intAgentId+"&nid="+intRecordId+"&act=delAgenNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggleAgent('divAN'+intAgentId, 'imgToggleAN'+intAgentId);
							fnAgentHideMsg('NOTE',intAgentId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function OLD_fnAJXGetRecurBillDtls(intSEOPacSel, intBillTermId,intFreeMonths, intChrgType,resDivId,throbberDivId)
{
//	intSEOPacSel = document.getElementById('hdnPackSel').value;

	if ((intBillTermId != ''))
	{
		strArgs = "pid="+intSEOPacSel+"&btid="+intBillTermId+"&fm="+intFreeMonths+"&ct="+intChrgType+"&act=getRBDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						strReturnValues = xmlHTTP.responseText;
						
						var arrRtnVal = strReturnValues.split("_");
						document.getElementById('idRBD').innerHTML = arrRtnVal[0];
						document.getElementById('idRBA').innerHTML = '$'+arrRtnVal[1];
						document.getElementById(throbberDivId).innerHTML =  '';
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXGetRecurBillDtlsFE(intSEOPacSel, intBillTermId, resDivId,throbberDivId)
{
//	intSEOPacSel = document.getElementById('hdnPackSel').value;

	if ((intBillTermId != ''))
	{
		strArgs = "pid="+intSEOPacSel+"&btid="+intBillTermId+"&act=getRBDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						strReturnValues = xmlHTTP.responseText;
						
						var arrRtnVal = strReturnValues.split("_");
						document.getElementById('idRBD').innerHTML = arrRtnVal[0];
						document.getElementById('idRBA').innerHTML = '$'+arrRtnVal[1];
						document.getElementById(throbberDivId).innerHTML =  '';
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}


function fnAJXGetClntData(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addTT&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divTT'+intClientId, 'imgToggleTT'+intClientId);
						fnHideMsg('TT');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXGAADtls(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=getGAADtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divGAA'+intClientId, 'imgToggleGAA'+intClientId);
						fnHideMsg('GAA');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXAddVidComm(intVidId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intVidId != ''))
	{
		strArgs = "vid="+intVidId+"&iup="+intIsUpdt+"&act=addVidComm&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divComm'+intVidId, 'imgToggleComm'+intVidId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXLeadNote(intLeadId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intLeadId != ''))
	{
		strArgs = "lid="+intLeadId+"&iup="+intIsUpdt+"&act=addLeadNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divCN'+intLeadId, 'imgToggleCN'+intLeadId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteLeadNote(intLeadId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intLeadId != ''))
		{
			strArgs = "lid="+intLeadId+"&nid="+intRecordId+"&act=delLeadNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divCN'+intLeadId, 'imgToggleCN'+intLeadId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnGetAJXARClientState(intClientId, resDivId,throbberDivId)
{
	if ((intClientId > 0))
	{
		strArgs = "cid="+intClientId+"&act=getARClientState&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('idTRState').style.display = '';
						document.getElementById('idTDState').innerHTML = xmlHTTP.responseText;
						document.getElementById('hdnState').value = xmlHTTP.responseText;
						fnGetAJXARClientCity(intClientId, 'idTDMsg','idTDMsg');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnGetAJXARClientCity(intClientId, resDivId,throbberDivId)
{
	if ((intClientId > 0))
	{
		strArgs = "cid="+intClientId+"&act=getARClientCityDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('idTRCity').style.display = '';
						document.getElementById('idTDCity').innerHTML = xmlHTTP.responseText;
						document.getElementById('hdnCity').value = xmlHTTP.responseText;
						fnGetAJXARClientZipCodes(intClientId, 'idTDMsg','idTDMsg');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnGetAJXARClientZipCodes(intClientId, resDivId,throbberDivId)
{
	if ((intClientId > 0))
	{
		strArgs = "cid="+intClientId+"&act=getARClientZCDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('idTRZipCode').style.display = '';
						document.getElementById('idTDZipCode').innerHTML = xmlHTTP.responseText;
						fnGetAJXARClientARCustId(intClientId, 'idTDMsg','idTDMsg');
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnGetAJXARClientARCustId(intClientId, resDivId,throbberDivId)
{
	if ((intClientId > 0))
	{
		strArgs = "cid="+intClientId+"&act=getARClientCustId&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('hdnCustId').value = xmlHTTP.responseText;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnGetAJXGetAltosReport(intClientId, resDivId,throbberDivId)
{
	if ((intClientId > 0))
	{
		strArgs = '';
		
		strState	= document.getElementById('hdnState').value;
		strCity		= document.getElementById('hdnCity').value;
		strZipCode	= document.getElementById('lstARZipCodes').value;
		
		strChartType		= document.getElementById('lstChartType').value;
		strChartSize		= document.getElementById('lstChartSize').value;
		strHomeType			= document.getElementById('lstChartHomeType').value;
		strRollingAverage	= document.getElementById('lstRollingAverage').value;
		strQuartiles		= document.getElementById('lstQuartiles').value;
		strTimespan			= document.getElementById('lstTimespan').value;
		strCustomerId		= document.getElementById('hdnCustId').value;
		
		strArgs = strArgs + "cid="+intClientId;
		strArgs = strArgs + "&st="+strState;
		strArgs = strArgs + "&city="+strCity;
		strArgs = strArgs + "&zip="+strZipCode;
		strArgs = strArgs + "&charttype="+strChartType;
		strArgs = strArgs + "&chartsize="+strChartSize;
		strArgs = strArgs + "&hometype="+strHomeType;
		strArgs = strArgs + "&rollingaverage="+strRollingAverage;
		strArgs = strArgs + "&quartiles="+strQuartiles;
		strArgs = strArgs + "&timespan="+strTimespan;
		strArgs = strArgs + "&custid="+strCustomerId;
		
		strArgs = strArgs + "&act=getARReport";
		strArgs = strArgs + "&sesid="+Math.random();

		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
				    	document.getElementById('idTRChart').style.display = '';
				    	document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetDispostion(intLeadId, resDivId,throbberDivId)
{
	strDisposition = document.getElementById('lstDisposition'+intLeadId).value;
	if ((intLeadId > 0))
	{
		strArgs = "lid="+intLeadId+"&disp="+strDisposition+"&act=setDispo&sesid="+Math.random();

		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXSetLeadList(intLeadId, resDivId,throbberDivId)
{
	strLeadList = document.getElementById('lstLeadList'+intLeadId).value;
	if ((intLeadId > 0) && strLeadList != '0')
	{
		strArgs = "lid="+intLeadId+"&list="+strLeadList+"&act=setLeadList&sesid="+Math.random();

		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXAddPartnerNote(intPartnerId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intPartnerId != ''))
	{
		strArgs = "ospid="+intPartnerId+"&iup="+intIsUpdt+"&act=addOSPNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divCN'+intPartnerId, 'imgToggleCN'+intPartnerId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeletePartnerNote(intPartnerId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intPartnerId != ''))
		{
			strArgs = "ospid="+intPartnerId+"&nid="+intRecordId+"&act=delOSPNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divCN'+intPartnerId, 'imgToggleCN'+intPartnerId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXAddSEOTaskNote(intSEOTaskNoteId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intSEOTaskNoteId != ''))
	{
		strArgs = "tid="+intSEOTaskNoteId+"&iup="+intIsUpdt+"&act=addTaskNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divTN'+intSEOTaskNoteId, 'imgToggleTN'+intSEOTaskNoteId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteSEOTaskNote(intSEOTaskId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intSEOTaskId != ''))
		{
			strArgs = "tid="+intSEOTaskId+"&nid="+intRecordId+"&act=delTaskNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divTN'+intSEOTaskId, 'imgToggleTN'+intSEOTaskId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXGetClientSites(intClientId, intSiteId, strSiteComboSts,resDivId,throbberDivId)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&sid="+intSiteId+"&scs="+strSiteComboSts+"&act=getClientSite&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDClinSite').innerHTML = strString;
							document.getElementById('idTRClinSite').style.display = '';
						}
						else
						{
							document.getElementById('idTRClinSite').style.display = 'none';
						}
						if (intSiteId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXGetLeadListCount(strLeadListName,resDivId,throbberDivId)
{
	if ((strLeadListName != '0'))
	{
		strArgs = "lln="+strLeadListName+"&act=getLLCount&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('idTDLLC').innerHTML = strString;
						document.getElementById('idTLLC').style.display = '';
						document.getElementById('idTRKW').style.display = '';
						document.getElementById('idTRSV').style.display = '';
						document.getElementById('idTRCOMP').style.display = '';
						
						document.getElementById('txtKeyword').focus();
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		document.getElementById('idTLLC').style.display = 'none';
		document.getElementById('idTRKW').style.display = 'none';
		document.getElementById('idTRSV').style.display = 'none';
		document.getElementById('idTRCOMP').style.display = 'none';
		document.getElementById('lstLeadList').focus();
		return false;
	}
}

function fnAJXGetClientKWSites(intClientId, intSiteId, strSiteComboSts,resDivId,throbberDivId)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&sid="+intSiteId+"&scs="+strSiteComboSts+"&act=getClientSite&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDClinSite').innerHTML = strString;
							document.getElementById('idTRClinSite').style.display = '';
							delete arrAlertKWRRep['lstToMonth'];
							delete arrAlertKWRRep['lstFromMonth'];
							arrAlertKWRRep['lstClientSite'] = "Select Site";
							arrAlertKWRRep['lstToMonth'] = "Select From Month";
							arrAlertKWRRep['lstFromMonth'] = "Select To Month";
						}
						else
						{
							document.getElementById('idTRClinSite').style.display = 'none';
						}
						if (intSiteId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXMarkTaskComplete(intSEOTaskId, intSiteId,intTid, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		//if (confirm('Are you sure you want to set this task as complete?'))
		{		
			strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&tid="+intTid+"&act=setSEOTaskComp&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							window.opener.document.getElementById('idTDSEOTask'+intSEOTaskId).innerHTML = strString;
							window.opener.document.getElementById('btnMarkTaskComp'+intSEOTaskId).style.display = 'none';
window.opener.document.getElementById('lstSEOTaskStatus'+intSEOTaskId).style.display = 'none';
							window.opener.document.getElementById('btnMarkTaskReOpen'+intSEOTaskId).style.display = '';
							window.close();
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	if (window.opener.document.getElementById(throbberDivId))
			    	{
			    		window.opener.document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    	}
			    }
			}
			xmlHTTP.send("");
		}
	}
	else
	{
		return false;
	}
}

function fnAJXMarkTaskReopen(intSEOTaskId, intSiteId, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		if (confirm('Are you sure you want to reopen this task?'))
		{		
			strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&act=setSEOTaskReopen&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById('idTDSEOTask'+intSEOTaskId).innerHTML = strString;
							document.getElementById('btnMarkTaskComp'+intSEOTaskId).style.display = '';
document.getElementById('lstSEOTaskStatus'+intSEOTaskId).style.display = '';
							document.getElementById('btnMarkTaskReOpen'+intSEOTaskId).style.display = 'none';
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	if (document.getElementById(throbberDivId))
			    	{
			    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    	}
			    }
			}
			xmlHTTP.send("");
		}
	}
	else
	{
		return false;
	}		
}

function fnAJXGetClientTaskSites(intClientId, intSiteId, strSiteComboSts,resDivId,throbberDivId)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&sid="+intSiteId+"&scs="+strSiteComboSts+"&act=getTaskSite&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDClinSite').innerHTML = strString;
							document.getElementById('idTRClinSite').style.display = '';
							//document.getElementById('idTRTaskSts').style.display = '';
							//document.getElementById('btnSearch').style.display = '';
						}
						else
						{
							document.getElementById('idTRClinSite').style.display = 'none';
							//document.getElementById('idTRTaskSts').style.display = 'none';
							//document.getElementById('btnSearch').style.display = 'none';

						}
						if (intSiteId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}


function fnAJXGetClientTaskSitesAdmin(intClientId, intSiteId, strSiteComboSts,resDivId,throbberDivId)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&sid="+intSiteId+"&scs="+strSiteComboSts+"&act=getTaskSite&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDClinSite').innerHTML = strString;
							document.getElementById('idTRClinSite').style.display = '';
							document.getElementById('idTRTaskSts').style.display = '';
							document.getElementById('idTRAssignTo').style.display = '';
							document.getElementById('idTRBtn').style.display = '';
						}
						else
						{
							document.getElementById('idTRClinSite').style.display = 'none';
							document.getElementById('idTRTaskSts').style.display = 'none';
							document.getElementById('idTRAssignTo').style.display = 'none';
							document.getElementById('idTRBtn').style.display = 'none';

						}
						if (intSiteId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXGetSiteKeywords(intSiteId,resDivId,throbberDivId)
{
	if ((intSiteId != ''))
	{
		strArgs = "sid="+intSiteId+"&act=getSKeyWrds&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('taKw').value = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXAddAccLog(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addACCLOG&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divACCLOG'+intClientId, 'imgToggleACCLOG'+intClientId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteAccLog(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&alid="+intRecordId+"&act=delAccLog&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = strString;
							fnToggle('divACCLOG'+intClientId, 'imgToggleACCLOG'+intClientId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXAddCFU(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=addCFU&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divCF'+intClientId, 'imgToggleCF'+intClientId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteCFU(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&cfid="+intRecordId+"&act=delCFU&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = strString;
							fnToggle('divCF'+intClientId, 'imgToggleCF'+intClientId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXCCTransDtls(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=getCCTransDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divTL'+intClientId, 'imgToggleTL'+intClientId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetSEOSiteStatus(intSEOSiteId,strStatus,resDivId,throbberDivId)
{
	if ((intSEOSiteId != ''))
	{
		strArgs = "sid="+intSEOSiteId+"&status="+strStatus+"&act=setSEOSiteSts&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXMarkGoalDeleted(intGoalId,resDivId,throbberDivId)
{
	if ((intGoalId > 0))
	{
		strArgs = "gid="+intGoalId+"&act=setGoalSts&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
						if (strString == 'Yes')
						{
							document.getElementById('btnMarkDel'+intGoalId).style.display = 'none';
							document.getElementById('btnMarkActive'+intGoalId).style.display = '';
						}
						else if (strString == 'No')
						{
							document.getElementById('btnMarkDel'+intGoalId).style.display = '';
							document.getElementById('btnMarkActive'+intGoalId).style.display = 'none';
						}						
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXMarkProgRepDeleted(intProgRepId,resDivId,throbberDivId)
{
	if ((intProgRepId > 0))
	{
		strArgs = "prid="+intProgRepId+"&act=setProgRepSts&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
						if (strString == 'Yes')
						{
							document.getElementById('btnMarkDel'+intProgRepId).style.display = 'none';
							document.getElementById('btnMarkActive'+intProgRepId).style.display = '';
						}
						else if (strString == 'No')
						{
							document.getElementById('btnMarkDel'+intProgRepId).style.display = '';
							document.getElementById('btnMarkActive'+intProgRepId).style.display = 'none';
						}						
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXAddEPRNote(intReportId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intReportId != ''))
	{
		strArgs = "prid="+intReportId+"&iup="+intIsUpdt+"&act=addEPRFNote&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divEPR'+intReportId, 'imgToggleEPR'+intReportId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXDeleteEPRNote(intReportId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intReportId != ''))
		{
			strArgs = "prid="+intReportId+"&nid="+intRecordId+"&act=delEPRNote&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divEPR'+intReportId, 'imgToggleEPR'+intReportId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXGetRECRLeadListCount(strLeadListName,resDivId,throbberDivId)
{
	if ((strLeadListName != '0'))
	{
		strArgs = "lln="+strLeadListName+"&act=getRECRLLCount&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById('idTDLLC').innerHTML = strString;
						document.getElementById('idTLLC').style.display = '';
						document.getElementById('idTRKW').style.display = '';
						document.getElementById('idTRSV').style.display = '';
						document.getElementById('idTRCOMP').style.display = '';
						
						document.getElementById('txtKeyword').focus();
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		document.getElementById('idTLLC').style.display = 'none';
		document.getElementById('idTRKW').style.display = 'none';
		document.getElementById('idTRSV').style.display = 'none';
		document.getElementById('idTRCOMP').style.display = 'none';
		document.getElementById('lstLeadList').focus();
		return false;
	}
}

function fnAJXSetRECRLeadList(intLeadId, resDivId,throbberDivId)
{
	strLeadList = document.getElementById('lstLeadList'+intLeadId).value;
	if ((intLeadId > 0) && strLeadList != '0')
	{
		strArgs = "lid="+intLeadId+"&list="+strLeadList+"&act=setRECRLeadList&sesid="+Math.random();

		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXGetRecurBillDtls(intSEOPacSel, intBillTermId,intFreeMonths,intChrgType,intSiteId,resDivId,throbberDivId)
{
	if ((intBillTermId != ''))
	{
		strArgs = "pid="+intSEOPacSel+"&btid="+intBillTermId+"&fm="+intFreeMonths+"&ct="+intChrgType+"&ssid="+intSiteId+"&act=getRBDtls&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						strReturnValues = xmlHTTP.responseText;
						
						var arrRtnVal = strReturnValues.split("_");
						document.getElementById('idRBD').innerHTML = arrRtnVal[0];
						document.getElementById('idRBA').innerHTML = '$'+arrRtnVal[1];
						document.getElementById(throbberDivId).innerHTML =  '';
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXMarkKWFocused(intKWRankId,intSiteId,resDivId,throbberDivId)
{
	if ((intKWRankId > 0))
	{
		strArgs = "kwrid="+intKWRankId+"&sid="+intSiteId+"&act=setKWRFocus&sesid="+Math.random();
		
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						var arrRtnVal = strString.split("_");
						document.getElementById('idTDKP'+intKWRankId).className = arrRtnVal[1];
						document.getElementById(resDivId).innerHTML = arrRtnVal[0];
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXStartConsultMail(intLeadId,resDivId,throbberDivId)
{
	if ((intLeadId > 0))
	{
		strArgs = "lid="+intLeadId+"&act=setConMailStrt&sesid="+Math.random();
		
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXUpdUsedTopic(intTopicId,resDivId,throbberDivId)
{
	if ((intTopicId > 0))
	{
		
		strArgs = "tid="+intTopicId+"&act=setUpdUsedTopic&sesid="+Math.random();
		
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function()
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXMarkTaskReopenAdmin(intSEOTaskId, intSiteId, resDivId,throbberDivId, strEncTaskId, strNoteDivid)
{
	if ((intSEOTaskId != ''))
	{
		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&act=setSEOTaskReopen&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{

//document.getElementById('idTDSEOTask'+intSEOTaskId).innerHTML = strString;
						document.getElementById(resDivId).innerHTML = strString;

//document.getElementById('btnMarkTaskComp'+intSEOTaskId).style.display = '';
//document.getElementById('btnMarkTaskReOpen'+intSEOTaskId).style.display = 'none';
						fnAJXAddSEOTaskNote(strEncTaskId, strNoteDivid,strNoteDivid,0);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXMarkTaskCompleteAdmin(intSEOTaskId, intSiteId, resDivId,throbberDivId, strEncTaskId, strNoteDivid)
{
	if ((intSEOTaskId != ''))
	{
		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&act=setSEOTaskComp&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						//document.getElementById('idTDSEOTask'+intSEOTaskId).innerHTML = strString;

						document.getElementById(resDivId).innerHTML = strString;

//document.getElementById('btnMarkTaskComp'+intSEOTaskId).style.display = 'none';
//document.getElementById('btnMarkTaskReOpen'+intSEOTaskId).style.display = '';
						fnAJXAddSEOTaskNote(strEncTaskId, strNoteDivid,strNoteDivid,0);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetSEOTaskStatusAdmin(intSEOTaskId, intSiteId, strNewStatus, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&sts="+strNewStatus+"&act=setSEOTaskStatus&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetSEOTaskDeleted(intSEOTaskId, intSiteId, strNewStatus, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&sts="+strNewStatus+"&act=setSEOTaskDeleted&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetSEOTaskStatusOS(intSEOTaskId, intSiteId, strNewStatus, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&sts="+strNewStatus+"&act=setSEOTaskStatus&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = strString;
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXSetCliISFSts(intCurrSts,strClientId, resDivId,throbberDivId)
{
	if (intCurrSts != '')
	{
		strArgs = "sfid="+intCurrSts+"&cid="+strClientId+"&act=setISFStst&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					
					if (strString != "")
					{
						document.getElementById(resDivId).innerHTML = strString;					
					}	
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXSetCliISFClose(strClientId, resDivId,throbberDivId)
{
	if (strClientId != '')
	{
		strArgs = "cid="+strClientId+"&act=setCloseCSF&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					
					if (strString != "")
					{
						//document.getElementById(resDivId).innerHTML = strString;
						fnCloseWindow();
					}	
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXValidateFromTo(intFromDt, intToDt, resDivId,throbberDivId)
{
	if ((intFromDt != '') && (intToDt != ""))
	{
		strArgs = "FromDt="+intFromDt+"&ToDt="+intToDt+"&act=checkFromToDate&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					
					if (strString != "")
					{
						document.getElementById(resDivId).innerHTML = strString;
					
					}
					
					
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXGetClientSites1(intClientId, intSiteId, strSiteComboSts,resDivId,throbberDivId)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&sid="+intSiteId+"&scs="+strSiteComboSts+"&act=getClientSite1&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDClinSite').innerHTML = strString;
							document.getElementById('idTRClinSite').style.display = '';
						}
						else
						{
							document.getElementById('idTRClinSite').style.display = 'none';
						}
						if (intSiteId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXSetSEOTaskUpdate(intRecId, assignType, assignTo)
{
	if (intRecId != '' && assignType !="")
	{
		strArgs = "tid="+intRecId+"&assignType="+assignType+"&assignTo="+assignTo+"&act=setTaskUpdate&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					
					if (strString != "")
					{
						alert("Record updated successfully");
						//document.getElementById(resDivId).innerHTML = strString;
						//fnCloseWindow();
					}	
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJX_GetSEOSubtask(intItemId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intItemId != ''))
	{
		strArgs = "tid="+intItemId+"&iup="+intIsUpdt+"&act=getSEOSubtask&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divSubTask'+intItemId, 'imgToggleST'+intItemId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXDelSEOSubtask(intMainItemId, intSubItemId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intSubItemId != ''))
		{
			strArgs = "miid="+intMainItemId+"&tid="+intSubItemId+"&act=delSEOSubtask&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
							fnToggle('divSubTask'+intMainItemId, 'imgToggleST'+intMainItemId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXSetSEOTaskCompAdmin(intSEOTaskId, intSiteId,intTid, resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		//if (confirm('Are you sure you want to set this task as complete?'))
		{		
			strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&tid="+intTid+"&act=setSEOTaskCompAdmin&sesid="+Math.random();
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							window.opener.document.getElementById('idTDSEOTask'+intSEOTaskId).innerHTML = strString;
							window.opener.document.getElementById('btnMarkTaskComp'+intSEOTaskId).style.display = 'none';
							window.opener.document.getElementById('lstSEOTaskStatus'+intSEOTaskId).style.display = 'none';
							window.opener.document.getElementById('btnMarkTaskReOpen'+intSEOTaskId).style.display = '';
							window.close();
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	if (window.opener.document.getElementById(throbberDivId))
			    	{
			    		window.opener.document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    	}
			    }
			}
			xmlHTTP.send("");
		}
	}
	else
	{
		return false;
	}
}

function fnAJXDUpdateOSMaterial(intStatus, intMatId, resDivId,throbberDivId)
{
	if ((intMatId != ''))
	{
		strArgs = "statusid="+intStatus+"&mid="+intMatId+"&act=updMaterial&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						alert("Record Updated Successfully");
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXGetChkItem(intPackageId, intItemId, strItemComboSts,resDivId,throbberDivId)
{
	if ((intPackageId != ''))
	{
		strArgs = "pid="+intPackageId+"&itid="+intItemId+"&scs="+strItemComboSts+"&act=getChkItem&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if (strString.length  > 1)
						{							
							document.getElementById('idTDChklistItem').innerHTML = strString;
							document.getElementById('idTRChklistItem').style.display = '';
							//document.getElementById('idTRTaskSts').style.display = '';
							//document.getElementById('idTRAssignTo').style.display = '';
							//document.getElementById('idTRBtn').style.display = '';
						}
						else
						{
							document.getElementById('idTRChklistItem').style.display = 'none';
							//document.getElementById('idTRTaskSts').style.display = 'none';
							//document.getElementById('idTRAssignTo').style.display = 'none';
							//document.getElementById('idTRBtn').style.display = 'none';

						}
						if (intItemId == 0 && document.getElementById('idCheckListTbl'))
						{
							document.getElementById('idCheckListTbl').style.display = 'none';
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}		
}

function fnAJXAddWMD(intClientId, resDivId,throbberDivId,intIsUpdt)
{
	if ((intClientId != ''))
	{
		strArgs = "cid="+intClientId+"&iup="+intIsUpdt+"&act=getWMD&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						fnToggle('divWMD'+intClientId, 'imgToggleWMD'+intClientId);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnSetViewClient(intSEOTaskId,intStatus,resDivId,throbberDivId)
{
	if ((intSEOTaskId != ''))
	{
		if (document.getElementById('chkVisibleClt'+intSEOTaskId).checked == true)
		{
			intStatus = 1;
		}
		else
		{
			intStatus = 0;
		}	
		
		strArgs = "stid="+intSEOTaskId+"&intStatus="+intStatus+"&act=setUpdClientVisible&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						//document.getElementById(resDivId).innerHTML = strString;
						alert(strString);
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		//document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXSetCheckInOut(strCheckInOut, resDivId,throbberDivId)
{
	if ((strCheckInOut != ''))
	{
		strArgs = "checkInOut="+strCheckInOut+"&act=setCheckInOut&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						document.getElementById(resDivId).innerHTML = xmlHTTP.responseText;
						document.getElementById("clockInWarning").innerHTML = "";
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}

function fnAJXDeleteOrgTaskFile(intClientId, intRecordId, resDivId,throbberDivId)
{
	if (confirm('Are you sure you want to permanently delete this record?'))
	{	
		if ((intClientId != ''))
		{
			strArgs = "cid="+intClientId+"&tfid="+intRecordId+"&act=delORGTskFile&sesid="+Math.random();
//alert(strArgs);return;
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function() 
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "0")
						{
							document.getElementById(resDivId).innerHTML = strString;
							fnToggle('divCF'+intClientId, 'imgToggleCF'+intClientId);
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXUpdFreeMonth(intSiteId,resDivId,throbberDivId,status)
{
	if(confirm("Are you sure you want to do this?"))
	{
		if ((intSiteId > 0))
		{
			strArgs = "sid="+intSiteId+"&status="+status+"&act=setUpdFreeMonth&sesid="+Math.random();
			
			xmlHTTP = createXMLHttpObject();
			xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
			xmlHTTP.onreadystatechange=function()
			{
				if (xmlHTTP.readyState==4)
				{
					if (xmlHTTP.status == 200)
					{
						var strString = xmlHTTP.responseText;
						if (strString != "")
						{
							document.getElementById(resDivId).innerHTML = strString;
						}
					}
					else
					{
						alert('Error:AJAX request status = ' + xmlHTTP.status);
					}
			    }
			    else
			    {
			    	document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
			    }
			}
			xmlHTTP.send("");
		}
		else
		{
			return false;
		}
	}
}

function fnAJXSetSEOTaskStatusAdminNewCal(intSEOTaskId, intSiteId, strNewStatus, resDivId,throbberDivId, intChkDay, intChkTemp)
{
	if ((intSEOTaskId != ''))
	{

		strArgs = "stid="+intSEOTaskId+"&sid="+intSiteId+"&sts="+strNewStatus+"&chkDay="+intChkDay+"&chkTemp="+intChkTemp+"&act=setSEOTaskStatusNewCal&sesid="+Math.random();
		xmlHTTP = createXMLHttpObject();
		xmlHTTP.open("GET",strAjaxFileName+strArgs,true);
		xmlHTTP.onreadystatechange=function() 
		{
			if (xmlHTTP.readyState==4)
			{
				if (xmlHTTP.status == 200)
				{
					var strString = xmlHTTP.responseText;
					if (strString != "0")
					{
						if(strString == "subtasknotcomplete")
						{
							alert("You can not complete this task untill all subtasks are completed");
							//document.getElementById(resDivId).innerHTML = arrString;
							document.frmSeoCalendar.submit();
						}
						else
						{
							document.getElementById(resDivId).innerHTML = strString;
							
							document.frmSeoCalendar.submit();
						}
					}
				}
				else
				{
					alert('Error:AJAX request status = ' + xmlHTTP.status);
				}
		    }
		    else
		    {
		    	if (document.getElementById(throbberDivId))
		    	{
		    		document.getElementById(throbberDivId).innerHTML = strNewThrobberAdminImg;
		    	}
		    }
		}
		xmlHTTP.send("");
	}
	else
	{
		return false;
	}
}