var IMAGE_PATH = 'fleetmanagement/img/';
var SERVLET_PATH = 'fleetmanagement/';


Ext.newDate = function(time) {
    return new Date(time);
};


function endLoadingMessage() {
	Ext.get('loading').fadeOut({remove: true, duration:.25});
}

function loadMapsWithId( mapDivId) {
	mapApi = document.getElementById('mapApi').value;
	mapview = document.getElementById('viewType').value;
	loadMapsOnDiv(mapApi,mapview, mapDivId);	
}




function zoomLocation(lat,lng,zoomLevel) {
	map.setCenterAndZoom(new LatLonPoint(lat, lng), zoomLevel);
}



function getHTTPObject() { 
	if (typeof XMLHttpRequest != 'undefined') {
		return new XMLHttpRequest();
	} 
	try { 
		return new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch (e) {
		try {
			return new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
		}
	} 
	return false;
}


function getParsedText(xmlText) {
	try { //Internet Explorer
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = "false";
		xmlDoc.loadXML(xmlText);
		return xmlDoc;
	} catch(e) {
		try { //Firefox, Mozilla, Opera, etc.
			parser = new DOMParser();
			xmlDoc = parser.parseFromString(xmlText, "text/xml");
			return xmlDoc;
		} catch(e) {
			alert(e.message);
			return false;
		}
	}
}

function debug   (log_txt) {
    if (window.console != undefined) {
        console.log(log_txt);
    }
}






