function addEvent(obj, evType, fn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

setCountrySelect = function() {
	var oCountryList = document.getElementById("countryList");
	var oLeftCol = document.getElementById('leftColumn');
	var oLi = oCountryList.getElementsByTagName("li");

	var newCountryForm = document.createElement('form');
	newCountryForm.setAttribute('method', 'post');
	newCountryForm.setAttribute('id', 'frmothercountry');
	newCountryForm.setAttribute('name', 'frmothercountry');
	newCountryForm.setAttribute('action', '/');
	oLeftCol.appendChild(newCountryForm);
	
	var newCountrySelect = document.createElement('select');
	newCountrySelect.setAttribute('name', 'country');
	newCountryForm.appendChild(newCountrySelect);
		
	var oOptionDefault = document.createElement("option");
	oOptionDefault.innerHTML = "Select your location";
	oOptionDefault.value = "00";
	newCountrySelect.appendChild(oOptionDefault);
		
	var newCountrySubmit = document.createElement('input');
	newCountrySubmit.setAttribute('class', 'btn');
	newCountrySubmit.setAttribute('type', 'submit');
	newCountryForm.appendChild(newCountrySubmit);

	newCountrySubmit.className = 'btn';
	newCountrySubmit.value = 'Go';

	oCountryList.style.display = "none";

	for(var i=0; i < oLi.length; i++) {
		var oOption = document.createElement("option");
		oOption.innerHTML = oLi[i].firstChild.innerHTML;
		oOption.value = oLi[i].firstChild.href;
		newCountrySelect.appendChild(oOption);
	}
}

addEvent(window, "load", setCountrySelect);