﻿//Towns Listener -------------------------------------------------
function CandidateTownsListener(ErrorBoxID, oLoadingDiv, oForm, oLocPlaceholder, LocationBox)
{
	this.Form                = oForm;
    this.TownslistenerLoadingDiv = oLoadingDiv;
    this.Locplaceholder			 = oLocPlaceholder;    
    this.LocationBox			 = LocationBox;
    this.ErrorPopupID			 = ErrorBoxID;
}

CandidateTownsListener.prototype.recieveResponse = function(townsHTML)
{	
	this.TownslistenerLoadingDiv.style.display = "none";	
	if((townsHTML == "MATCH") )
	{		
		this.Form.submit();
	}
	else
	{
		holder = this.Locplaceholder;
		ErrorPopup = new CandidateErrorBox(this.ErrorPopupID, holder, townsHTML != "MATCH", townsHTML != "NONEFOUND", townsHTML, this.LocationBox);
		ErrorPopup.Display();
	}
}
//Towns Listener -------------------------------------------------