// version of thickbox without the chrome (just for iframes)
function thinb_show(url, closeImage) {
	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 {//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
				$("#TB_overlay").click(tb_remove);
			}
		}

		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader

		var queryString = url.replace(/^[^\?]+\??/,'');
		var params = tb_parseQuery( queryString );

        CLOSE_RIGHT = 80;
		TB_WIDTH = (params['width']*1) || 630; //defaults to 630 if no paramaters were added to URL
		TB_HEIGHT = (params['height']*1) || 440; //defaults to 440 if no paramaters were added to URL
		ajaxContentW = TB_WIDTH;
		ajaxContentH = TB_HEIGHT;

		urlNoQuery = url.split('TB_');		
		$("#TB_window").append("<div id='TB_closeWindowButton' style='position:absolute; top:24px;left:"+(TB_WIDTH-CLOSE_RIGHT)+"px;z-index:200;margin-top:-16px;'><div style='padding-top:5px; border:0px;' id='formCloseButton' alt='Close Button' class='hand' /></div>");
		$("#TB_window").append("<iframe frameborder='0' hspace='0' scrolling='no' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='overflow: hidden; margin:0px; width:"+(ajaxContentW)+"px;height:"+(ajaxContentH)+"px;' onload='tb_showIframe()'> </iframe>");

		// make post creation style adjustments here (otherwise IE sits on it's hands - grrrr)
		$("#TB_window").css('border', 'none');
		$("#TB_window").css('height', (TB_HEIGHT-2)+'px');

		$("#TB_closeWindowButton").click(tb_remove);
		
		tb_position();

		// reposition the box near the top in general (closer to the whitespace)
		tb_reposition();

		if(frames['TB_iframeContent'] === undefined){//be nice to safari
			$("#TB_load").remove();
			$("#TB_window").css({display:"block"});
			$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}});
		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}
// version of thickbox without the chrome (just for iframes)
function thinb_show(url, closeImage) {
	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 {//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
				$("#TB_overlay").click(tb_remove);
			}
		}

		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader

		var queryString = url.replace(/^[^\?]+\??/,'');
		var params = tb_parseQuery( queryString );

        CLOSE_RIGHT = 80;
		TB_WIDTH = (params['width']*1) || 630; //defaults to 630 if no paramaters were added to URL
		TB_HEIGHT = (params['height']*1) || 440; //defaults to 440 if no paramaters were added to URL
		ajaxContentW = TB_WIDTH;
		ajaxContentH = TB_HEIGHT;

		urlNoQuery = url.split('TB_');		
		$("#TB_window").append("<div id='TB_closeWindowButton' style='position:absolute; top:24px;left:"+(TB_WIDTH-CLOSE_RIGHT)+"px;z-index:200;margin-top:-16px;'><div style='border:0px; vertical-align:top;' id='formCloseButton' alt='Close Button' class='hand' />Close</div>");
		$("#TB_window").append("<iframe frameborder='0' hspace='0' scrolling='no' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='overflow: hidden; margin:0px; width:"+(ajaxContentW)+"px;height:"+(ajaxContentH)+"px;' onload='tb_showIframe()'> </iframe>");

		// make post creation style adjustments here (otherwise IE sits on it's hands - grrrr)
		$("#TB_window").css('border', 'none');
		$("#TB_window").css('height', (TB_HEIGHT-2)+'px');

		$("#TB_closeWindowButton").click(tb_remove);
		
		tb_position();

		// reposition the box near the top in general (closer to the whitespace)
		tb_reposition();

		if(frames['TB_iframeContent'] === undefined){//be nice to safari
			$("#TB_load").remove();
			$("#TB_window").css({display:"block"});
			$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}});
		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}
