function ChangeMap(region) {
	document.NZMap.src = '/Images/dealers/' + region;
}
function populatedealers(region) {
	document.getElementById('DealerCityOutput').innerHTML = '';
	document.getElementById('DealerDetailsOutput').innerHTML = '';
	document.getElementById('CompanyDetailsOutput').innerHTML = '';
	document.getElementById('dealerlist-divider').className = '';
	//ajax.requestFile = '/include/inc_dealers_region_return.cfm?region='+region;	// Specifying which file to get
	ajax.requestFile = '/include/inc_dealers_city_return.cfm?region='+region;	// Specifying which file to get
	ajax.onCompletion = populatedealerhtml;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}


function populatedealerhtml () {
	var obj = document.getElementById('DealerOutput');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
function populatedealerdetails(dealerid) {
	ajax.requestFile = '/include/inc_dealer_return.cfm?dealerid='+dealerid;	// Specifying which file to get
	ajax.onCompletion = populatedealerdetailshtml;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}
function populatedealersincity(cityname) {
	document.getElementById('CompanyDetailsOutput').innerHTML = '';
	document.getElementById('DealerDetailsOutput').innerHTML = '';
	ajax.requestFile = '/include/inc_dealers_from_city_return.cfm?cityname='+cityname;	// Specifying which file to get
	ajax.onCompletion = populatedealersincityhtml;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}
function populatedealerdetailshtml () {
	
	document.getElementById('dealerlist-divider').className = 'dealerlist-divider';
	var obj = document.getElementById('DealerDetailsOutput');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function populatedealersincityhtml () {
	
	document.getElementById('dealerlist-divider').className = 'dealerlist-divider';
	var obj = document.getElementById('DealerCityOutput');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function populatecompanydetails(companyid) {
	document.getElementById('CompanyDetailsOutput').innerHTML = '';
	document.getElementById('DealerDetailsOutput').innerHTML = '';
	ajax.requestFile = '/include/inc_company_return.cfm?companyid='+companyid;	// Specifying which file to get
	ajax.onCompletion = populatecompanydetailshtml;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}
function populatecompanydetailshtml () {
	document.getElementById('dealerlist-divider').className = 'dealerlist-divider';
	var obj2 = document.getElementById('DealerDetailsOutput');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}




function ChangeCurrentRegion(region) {
	document.getElementById('CurrentDealerRegion').innerHTML = '<span class="dealer-heading-text"">' + region + ' </span>';
	populatedealers(region);
	
}

function ActivateBranchName () {
	document.getElementById('branchtable-initial').style.visibility='hidden';
	document.getElementById('branchtable').style.visibility='visible';
}

function ChangeCurrentLinkRegion(region) {
	document.getElementById('CurrentLinkRegion').innerHTML = '<div class="dealer-heading-text"">' + region + ' Links</div>';
	populatelinks(region);
	
}

function ActivateBranchName () {
	document.getElementById('branchtable-initial').style.visibility='hidden';
	document.getElementById('branchtable').style.visibility='visible';
}
