var isMozilla; 

function initialize() {
	var objRef;
	dhtmlHistory.initialize();
	dhtmlHistory.addListener(handleHistoryChange);
	isMozilla = (document.all) ? 0 : 1;
	var initialLocation = dhtmlHistory.getCurrentLocation();
	if (isMozilla != 1) objRef = document.all('pageName');
	else objRef = document.getElementById('pageName');
	if (objRef.value == 1) contactsAjax.getPage("contactsskype", 2, true);
	else contactsAjax.getPage("contacts", 0, true);
}

function handleHistoryChange(newLocation, historyData) {
	updateUI(newLocation, historyData);                           
}

function updateUI(newLocation, historyData) {
	var pageValue = 1;
	var pageTitle = 0;
	var pageNum = newLocation.split(":")
	//alert(newLocation);
	if (newLocation == 'contacts:0') 
		contactsAjax.getPage("contacts", 0, false);
	else if (newLocation == 'contacts:1') 	
		contactsAjax.getPage("contactschat", 1, false);
	else if (newLocation == 'contacts:2') 	
		contactsAjax.getPage("contactsskype", 2, false);	
}
