function Map_Toggle(lcid) {
	var container = $("#interactiveMapContainer");
	if (container.css("display") == "none" || container.css("height") == "0px") Map_Show(lcid);
	else Map_Hide(lcid);
}

function Map_Hide(lcid) {
	if (ffOnMac()) {
		$("#interactiveMapContainer").css("display", "none");
	} else {
		$("#interactiveMap").animate( {top: "-356" }, 1000);
		$("#interactiveMapContainer").animate({height: "0"}, 1000);
	}

	$('#Map_toggleVisibility').attr('src', "/gfx/objects/interactiveMap/"+ lcid +"/showMap.gif");
}

function Map_Show(lcid) {
	if (ffOnMac()) {
		$("#interactiveMap").css("top", "0px");
		$("#interactiveMapContainer").css("height", "356px");
		$("#interactiveMapContainer").css("display", "block");

		interactiveMapFlash.write("interactiveMap");
	} else {
		if ($("#interactiveMap")[0].innerHTML.indexOf("interactiveMapFlash") > -1) {
			interactiveMapFlash.write("interactiveMap");
		}

		$("#interactiveMap").animate( {top: "0" }, 1000);
		$("#interactiveMapContainer").animate({height: "356"}, 1000);
	}

	$('#Map_toggleVisibility').attr('src', "/gfx/objects/interactiveMap/"+ lcid +"/hideMap.gif");
}
				
function Map_Init(isOpen, mapid, section, category, lcid) {
	interactiveMapFlash = new SWFObject("/media/"+ mapid +"", "map", "526", "376", "7", "#ffffff");
	interactiveMapFlash.addParam('wmode', 'opaque');	
	interactiveMapFlash.addVariable("activesection",""+ section +"");
	interactiveMapFlash.addVariable("xmlpath","/xml/FlashMap.ashx?lcid="+ lcid +"%26cat="+ category +"%26c=c");
	
	if (isOpen) interactiveMapFlash.write("interactiveMap")
	else {
	    if (ffOnMac()) $("#interactiveMapContainer").css("display", "none");
	}
}

function ffOnMac() {
    return ($.browser.name == 'firefox' && $.os.name == 'mac');
}