function obscureScreen(className){

    
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		$("body","html").css({height: "100%", width: "100%"});
		$("html").css("overflow","hidden");

		if (document.getElementById("akBoxHideSelect") === null) {//iframe to hide select elements in ie6
		    $("body").append("<iframe class='akBoxHideSelectClass' id='akBoxHideSelect_" + className + "'></iframe><div class='akBoxOverlayClass' id='akBoxOverlay_" + className + "'></div>");
		}
	}else{//all others
	if (document.getElementById("akBoxOverlay_" + className) === null) {
	    $("body").append("<div class='akBoxOverlayClass' id='akBoxOverlay_" + className + "'></div>");
		}
	}

	overlay = $('#akBoxOverlay_' + className);

	if(detectMacXFF()){
		overlay.addClass("akBoxOverlayMacFFBGHack");//use png overlay so hide flash
	}else{
		overlay.addClass("akBoxOverlayBg");//use background and opacity
	}

}

function detectMacXFF() {
	var userAgent = navigator.userAgent.toLowerCase();
  	if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    	return true;
  	}
}

function openAkBox(className){
	
	obscureScreen(className);
	if ($.browser.msie && $.browser.version == 6) {
	    p = $('.'+className).offset();
		$('.' + className).css('top', document.documentElement.scrollTop);
	}

	$('.' + className).show();
	$('.' + className).css({ marginLeft: '-' + parseInt(($('.' + className).width() / 2), 10) + 'px'/*, width: width + 'px'*/ }).show();
}

function closeAkBox(classname) {
    
	$('.' + classname).fadeOut("fast",function(){
	$('#akBoxOverlay_' + classname + ',#akBoxHideSelect_' + classname).trigger("unload").unbind().remove();
	$('.' + classname).hide();
	});

	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
}