/*
 Zoom by scaling font size
 Usage: zoomFontSize(n) - Sets font size to n%
*/
function zoomFontSize(percent)
{
	var fontSize = document.body.style.fontSize;
 
	if(fontSize == '' || percent == 0){
		fontSize = '100%';
	}
 
	var newSize = parseInt(fontSize) + percent;
 
	document.body.style.fontSize = newSize + '%';

}

function adjustContentDimensions()
{
	if($.browser.safari || $.browser.chrome){
		addHeight = 29;
	}else{
		addHeight = 25;
	}
	
	var headerHeight  = $("#header").height() + $("#banner").height();
	var contentHeight = $("#content").height();
	var subMenuHeight = $("#subNav").height();
	var windowHeight  = $(window).height();
    
	var leftColumnHeight = subMenuHeight + 110;
	
	if(contentHeight >= leftColumnHeight){
		overallHeight = contentHeight;
	}else{
		overallHeight = leftColumnHeight;
	}

	if((windowHeight - headerHeight) > overallHeight){
		overallHeight = windowHeight - headerHeight;
	}
	
	var targetHeight = overallHeight - addHeight;

    $("#clearMainWrap").attr({style: 'min-height:' + targetHeight + 'px'});
	
    if ($.browser.msie && $.browser.version < 7) {
        $("#clearMainWrap").attr({style: 'height:' + targetHeight + 'px'});
    }

}

function getLocationId(id)
{
	var part = "";
	part = id.substring(4);
	return part;
}

function getLocationId(id)
{
	var part = "";
	part = id.substring(4);
	return part;
}

function showLocation(id)
{
	var idLbl = "#loctxt-" + id;
	$(idLbl).show();
}

jQuery(function($) {

	$(".mapItem").mouseover(
			function(){
				$(".mapItem").css("background-color","transparent");
				$(".mapLocationItemText").hide();
				$(this).css('background-color','white');
				id = getLocationId($(this).attr("id"));
				showLocation(id);
				$("#mapLocationBlindText").hide();
				$("#mapLocationId").show();
			}
	);

	$("a.export").toggle(
			function(){
				$(this).next().fadeIn(500);
			},
			function(){
				$(this).next().fadeOut(500);
			}
	);
	
});
