function ShowPreview (id)
{
	div = document.getElementById('Preview_' + id);
	if (div)
	{
		if (div.style.display == 'none')
		{
			div.style.display = 'block';
		}
		else
		{
			div.style.display = 'none';
		}
	}	
}

function HidePreview(id)
{
	div = document.getElementById('Preview_' + id);
	
	if (div)
	{
		div.style.display = 'none';
	}
}

function map(id, key)
{
	if (key==1) {
		var obj = document.getElementById( id ).className = "passage_map show";
	}
	else {
		var obj = document.getElementById( id ).className = "passage_map";
		var main_text = document.getElementById("id").className="";
	}
}
function page_print(id)
{			
	var obj = document.getElementById("contacts_print_list");
	var main_text = document.getElementById("id").className="print_vertion";
	if (obj) {
		var maps = obj.getElementsByTagName("LI");
		if (maps) {
			for (var i = 0; i < maps.length; i++) {
				maps[i].className="contacts_print";
			}					
		}
		var map = document.getElementById("contacts_print_" + id);
		if (map) map.className="contacts_print show";
		var popup = document.getElementById("map_" + id).className="passage_map";
		print();
	}
}

function trim(s) {
	return rtrim(ltrim(s));
} // end function

function ltrim(s) {
	return s.replace(/^\s+/, ''); 
} // end function

function rtrim(s) {
	return s.replace(/\s+$/, ''); 
} // end function
