/**
 * Change the source of the image using the image element's id
 * and the source of the new image.
 */
function changeImage(ele, src){
	obj = document.getElementById(ele);
	obj.src = src;
}

/**
 * Change the source of the image using the image element's id
 * and the source of the new image.
 */
function over(img, overImage) {
    img.src = overImage;
}

/**
 * Get an element of the DOM by it's ID
 */
function byId(id){
	return document.getElementById(id);
}

function showDealerInformation(region, subregion){	
	// CREATE A NEW REGION DIV WITH THE INFORMATION FROM THE CLICKED REGION
	//......................................................................
	var regionDiv = document.createElement('div');
	regionDiv.innerHTML = byId('region_' + region).innerHTML;
	
	
	// DO THE SAME WITH THE SUBREGION
	//...............................
	var subregionDiv = document.createElement('div');
	subregionDiv.innerHTML = byId('subregion_' + subregion).innerHTML;	
	
	// CREATE A NEW DIV WITH THE DATA FROM THE REGION AND SUBREGION
	//.............................................................
	var newDiv = document.createElement('div');
	newDiv.appendChild(subregionDiv);		
	newDiv.appendChild(document.createElement('hr'));
	newDiv.appendChild(regionDiv);	
	
	// ADD THE NEW DIV INFO TO THE DEALER INFO
	//........................................
	var infoDiv = byId('dealerInformation');
	infoDiv.innerHTML = newDiv.innerHTML;
}