function TM_show (params) {

	document.body.style.margin = "0px";
    document.body.style.padding = "0px";
	mouseInit = false;
	
	// Detect if the browser is IE or not.
	// If it is not IE, we assume that the browser is NS.
	var IE = document.all?true:false
	// If NS -- that is, !IE -- then set up for mouse capture
	if (!IE) document.captureEvents(Event.MOUSEMOVE)

	defaults = {
		msg: '',
		width: 200,
		height: 50,
		delay: 250,
		tolerance: 5
	}
	if(params) defaults = $tb.extend(defaults,params);

	try {
		
		if (document.getElementById("TB_HideSelect") == null) {
			$tb("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
		}

		TB_overlaySize();
			
		TB_WIDTH = (defaults.width*1) + 30;
		TB_HEIGHT = (defaults.height*1) + 40;
		ajaxContentW = TB_WIDTH - 40;
		ajaxContentH = TB_HEIGHT - 40;

		$tb("#TB_window").append("<div id='TB_ajaxContent'>"+defaults.msg+"</div>");
		if (defaults.classname) $tb("#TB_window").addClass(defaults.classname);
		$tb("#TB_ajaxContent").css({'padding': '20px', 'width': ajaxContentW+'px'});
					
		TB_position();
		$tb("#TB_window").css({display:"block"}); 
				
		// close on escape
		document.onkeyup = function(e){ 	
		 TM_remove();
		 return false;
/*				
			if (e == null) { // ie
				keycode = event.keyCode;
			} else { // mozilla
				keycode = e.which;
			}
			if(keycode == 27){ // close
				//$tb(document).body.unmousemove();
				TM_remove();
				return false;
			}	
*/			
		}
		
		// close on mousemove 
		document.onmousemove = function(e){ 	
			
			if (IE) { 
				tempX = event.clientX + document.body.scrollLeft
				tempY = event.clientY + document.body.scrollTop
			} else { 
				tempX = e.pageX
				tempY = e.pageY
			}  
			
			if (mouseInit == false) 
			{
				curX = tempX;
				curY = tempY;
				mouseInit = true;
			}
		
			if ( tempX > parseInt(curX+defaults.tolerance) || tempY > parseInt(curY+defaults.tolerance) ||  tempX < parseInt(curX-defaults.tolerance) || tempY < parseInt(curY-defaults.tolerance) ) {
				//$(document.body).unmousemove();
				document.onmousemove = function(e){ };
				window.setTimeout("TM_remove()", defaults.delay); 
				mouseInit = false;
				return false;
			}
		
		}

	} catch(e) {
		//console.warn( e );
	}
	
	document.body.style.margin = "";
    document.body.style.padding = "";
	return false;
}

//helper functions below
function TM_remove() {
	$tb("#TB_window").fadeOut("fast",function(){ $tb('#TB_window,#TB_overlay,#TB_HideSelect').remove(); });
	mouseInit = false;
	return false;
}