/*
 * The code in this file was extracted from:
 * Thickbox 3 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
function showOverlay(contentDivName) {
	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		} else {
			if (document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
				$("#TB_overlay").click(tb_remove);
			}
		}
		
		$("#TB_window").append("<div id='TB_ajaxContent' style='height: 200px;'></div>");
				
		$("#TB_ajaxContent").click(tb_remove);
	
		$("#TB_ajaxContent").html($('#' + contentDivName).html());
		$("#TB_window").css({position:'absolute', top:'-1px', 'text-align':'right'});
		$("#TB_load").remove();
		$("#TB_window").css({display:"block"}); 
	} catch(e) {
		//nothing here
	}
}

function tb_remove() {
	$("#TB_overlay").unbind("click");
	$("#TB_ajaxContent").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	return false;
}

