google.load("language", "1");

function translate() {
var q = document.citysearch.city.value;

google.language.detect(q, function(detect){
	if(!detect.error && detect.language == "ar"){ // only translate if language is Arabic
		google.language.translate(q, "ar", "en", function(result) {
			if (!result.error) {
				document.citysearch.city.value = result.translation;
				setTimeout('document.citysearch.submit()', 500);
			} else {
				document.citysearch.submit();
			}
		});
		} else {
		document.citysearch.submit();
	}
});

}


