_root = '';
_images2 = new Array();

function escapeData(str) {
	while (str.indexOf("&") != -1)
		str = str.replace("&", "::amp");
	return str;
}

function get(id) {
	return document.getElementById(id);	
}

function init() {
	
	preload('tab_about.png', 'tab_about_over.png', 'tab_about_selected.png', 'tab_about_over_selected.png',
			'tab_business.png', 'tab_business_over.png', 'tab_business_selected.png', 'tab_business_over_selected.png',
			'tab_clients.png', 'tab_clients_over.png', 'tab_clients_selected.png', 'tab_clients_over_selected.png',
			'tab_contact.png', 'tab_contact_over.png', 'tab_contact_selected.png', 'tab_contact_over_selected.png',
			'tab_home.png', 'tab_home_over.png', 'tab_home_selected.png', 'tab_home_over_selected.png',
			'tab_offer.png', 'tab_offer_over.png', 'tab_offer_selected.png', 'tab_offer_over_selected.png',
			'tab_sustainability.png', 'tab_sustainability_over.png', 'tab_sustainability_selected.png', 'tab_sustainability_over_selected.png',
			'tab_info.png', 'tab_info_over.png', 'tab_info_over_selected.png', 'tab_info_selected.png'
	);
	
	// Preload Kayako button rollovers
	dir = _root + 'support/themes/client_default/';
	
	_images2[0] = new Image();
	_images2[0].src = dir + 'orangebuttonbg.gif';
	
	_images2[1] = new Image();
	_images2[1].src = dir + 'orangebuttonbg_over.gif';
	
	_images2[2] = new Image();
	_images2[2].src = dir + 'yellowbuttonbg.gif';
	
	_images2[3] = new Image();
	_images2[3].src = dir + 'yellowbuttonbg_over.gif';
	
}

function set_root(r) {
	_root = r;
}

function unescapeData(str) {
	while (str.indexOf("::amp") != -1)
		str = str.replace("::amp", "&");
	return str;
}