function login()
{ 
	if(document.getElementById("contactno").value!=""){	 
		xmlHttp=GetXmlHttpObject(loginResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("contact="+document.getElementById("contactno").value + "&password=" + document.getElementById("password").value + "&action=login")
		document.getElementById("accountProcessing").innerHTML="<h2>Verifying owner number and password</h2>"
	} 
} 

function loginResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if(xmlHttp.responseText.indexOf("OK")==0){
			clientDetails()
		}else{
			document.getElementById("accountProcessing").innerHTML="<h2>Owner Number or Password is incorrect</h2>"
		}
	} 
} 



function clientDetails()
{ 
	if(document.getElementById("contactno").value!=""){	 
		xmlHttp=GetXmlHttpObject(clientDetailsResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("action=clientDetails")
		document.getElementById("accountDetails").innerHTML="<h2>Please wait while we retrieve your records</h2>"
	} 
} 

function clientDetailsResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("rightcontent").style.display="none"
		document.getElementById("leftcontent").style.width="680px"
		document.getElementById("accountDetails").innerHTML=xmlHttp.responseText 
	} 
} 







function toolbar(myVal,myUnit)
{ 
	if(myVal!=""){	 
		xmlHttp=GetXmlHttpObject(toolbarResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ myVal + "&unit="+ myUnit + "&action=toolbar")
		document.getElementById("accountSelected").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function toolbarResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountSelected").innerHTML=xmlHttp.responseText 
		document.location.href = "#aToolBar"
	} 
} 



function strata(myVal)
{ 
	if(myVal!=""){	 
		xmlHttp=GetXmlHttpObject(strataResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ myVal + "&action=strata")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function strataResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountMoreDetails").innerHTML=xmlHttp.responseText 
		document.location.href = "#aMD"
	} 
} 


function yourdetails()
{ 
	xmlHttp=GetXmlHttpObject(strataResults)
	xmlHttp.open("POST", "strataaccounts.asp" , true)
	xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
	xmlHttp.send("action=yourdetails")
	document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
} 


function yourdetailsUPDATE()
{ 
	xmlHttp=GetXmlHttpObject(strataResults)
	xmlHttp.open("POST", "strataaccounts.asp" , true)
	xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
	xmlHttp.send("action=yourdetailsUPDATE")
	document.getElementById("accountMoreDetails").innerHTML="<a name='aMD'></a><h2>Please Wait</h2>"

} 


function yourdetailsSAVE()
{ 

	if(document.getElementById("YDPassword").value != document.getElementById("YDPasswordVerify").value){
		if(document.getElementById("YDPassword").value.length < 5){
			alert("Password needs to be atleast 5 characters long")
			return false;		
		}
		alert("Passwords do not match, please re-type and try again")
		return false;
	}

		myVals = "action=yourdetailsSAVE"
		xmlHttp=GetXmlHttpObject(strataResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		myVals = myVals + "&YDContact=" + document.getElementById("YDContact").value

		myVals = myVals + "&YDTitle_OLD=" + document.getElementById("YDTitleOLD").value
		myVals = myVals + "&YDTitle_NEW=" + document.getElementById("YDTitle").value

		myVals = myVals + "&YDName_OLD=" + document.getElementById("YDNameOLD").value
		myVals = myVals + "&YDName_NEW=" + document.getElementById("YDName").value

		myVals = myVals + "&YDSurname_OLD=" + document.getElementById("YDSurnameOLD").value
		myVals = myVals + "&YDSurname_NEW=" + document.getElementById("YDSurname").value

		myVals = myVals + "&YDCompany_OLD=" + document.getElementById("YDCompanyOLD").value
		myVals = myVals + "&YDCompany_NEW=" + document.getElementById("YDCompany").value

		myVals = myVals + "&YDPostalPreStreet_OLD=" + document.getElementById("YDPostalPreStreetOLD").value
		myVals = myVals + "&YDPostalPreStreet_NEW=" + document.getElementById("YDPostalPreStreet").value


		myVals = myVals + "&YDPostalStreetNo_OLD=" + document.getElementById("YDPostalStreetNoOLD").value
		myVals = myVals + "&YDPostalStreetNo_NEW=" + document.getElementById("YDPostalStreetNo").value

		myVals = myVals + "&YDPostalStreet_OLD=" + document.getElementById("YDPostalStreetOLD").value
		myVals = myVals + "&YDPostalStreet_NEW=" + document.getElementById("YDPostalStreet").value

		myVals = myVals + "&YDPostalSuburb_OLD=" + document.getElementById("YDPostalSuburbOLD").value
		myVals = myVals + "&YDPostalSuburb_NEW=" + document.getElementById("YDPostalSuburb").value

		myVals = myVals + "&YDPostalState_OLD=" + document.getElementById("YDPostalStateOLD").value
		myVals = myVals + "&YDPostalState_NEW=" + document.getElementById("YDPostalState").value

		myVals = myVals + "&YDPostalCode_OLD=" + document.getElementById("YDPostalCodeOLD").value
		myVals = myVals + "&YDPostalCode_NEW=" + document.getElementById("YDPostalCode").value

		myVals = myVals + "&YDPostalCountry_OLD=" + document.getElementById("YDPostalCountryOLD").value
		myVals = myVals + "&YDPostalCountry_NEW=" + document.getElementById("YDPostalCountry").value


		myVals = myVals + "&YDWorkPhone_OLD=" + document.getElementById("YDWorkPhoneOLD").value
		myVals = myVals + "&YDWorkPhone_NEW=" + document.getElementById("YDWorkPhone").value

		myVals = myVals + "&YDHomePhone_OLD=" + document.getElementById("YDHomePhoneOLD").value
		myVals = myVals + "&YDHomePhone_NEW=" + document.getElementById("YDHomePhone").value

		myVals = myVals + "&YDSilent_OLD=" + document.getElementById("YDSilentOLD").value
		myVals = myVals + "&YDSilent_NEW=" + document.getElementById("YDSilent").value

		myVals = myVals + "&YDFax_OLD=" + document.getElementById("YDFaxOLD").value
		myVals = myVals + "&YDFax_NEW=" + document.getElementById("YDFax").value

		myVals = myVals + "&YDMobile_OLD=" + document.getElementById("YDMobileOLD").value
		myVals = myVals + "&YDMobile_NEW=" + document.getElementById("YDMobile").value

		myVals = myVals + "&YDEmail_OLD=" + document.getElementById("YDEmailOLD").value
		myVals = myVals + "&YDEmail_NEW=" + document.getElementById("YDEmail").value

		myVals = myVals + "&YDLevy_by_Post_OLD=" + document.getElementById("YDLevyInPostOLD").value
		myVals = myVals + "&YDLevy_by_Post_NEW=" + document.getElementById("YDLevyInPost").value

		myVals = myVals + "&YDCorres_by_Post_OLD=" + document.getElementById("YDCorrespondenceInPostOLD").value
		myVals = myVals + "&YDCorres_by_Post_NEW=" + document.getElementById("YDCorrespondenceInPost").value
	
		myVals = myVals + "&YDPassword=" + document.getElementById("YDPassword").value
		myVals = myVals + "&YDPasswordVerify=" + document.getElementById("YDPasswordVerify").value
		myVals = myVals + "&YDRequestedBy=" + document.getElementById("YDRequest").value
		myVals = myVals + "&YDRequestedByNumber=" + document.getElementById("YDRequestPhone").value
		myVals = myVals + "&YDComments=" + document.getElementById("YDComments").value


		xmlHttp.send(myVals)
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
} 







function invoices(strata,unit)
{ 
	if(strata!="" && unit!=""){	 
		xmlHttp=GetXmlHttpObject(invoicesResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ strata + "&unit="+ unit + "&action=invoices")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function invoicesResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountMoreDetails").innerHTML=xmlHttp.responseText 
	} 
} 


function paid(strata,unit)
{ 
	if(strata!="" && unit!=""){	 
		xmlHttp=GetXmlHttpObject(invoicesResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ strata + "&unit="+ unit + "&action=paid")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please wait, this may take a few seconds</h2>"
	} 
} 


function manager(myVal,myUnit)
{ 
	if(myVal!=""){	 
		xmlHttp=GetXmlHttpObject(managerResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ myVal + "&unit="+ myUnit + "&action=manager")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function managerResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountMoreDetails").innerHTML=xmlHttp.responseText 
	} 
} 


function upmeeting(myVal)
{ 
	if(myVal!=""){	 
		xmlHttp=GetXmlHttpObject(upmeetingResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ myVal + "&action=upmeeting")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function upmeetingResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountMoreDetails").innerHTML=xmlHttp.responseText 
	} 
} 



function pastmeeting(myVal)
{ 
	if(myVal!=""){	 
		xmlHttp=GetXmlHttpObject(pastmeetingResults)
		xmlHttp.open("POST", "strataaccounts.asp" , true)
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8' ); 
		xmlHttp.send("strata="+ myVal + "&action=pastmeeting")
		document.getElementById("accountMoreDetails").innerHTML="<h2>Please Wait</h2>"
	} 
} 

function pastmeetingResults() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("accountMoreDetails").innerHTML=xmlHttp.responseText 
	} 
} 