// 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'></div>");
        $("#TB_overlay").click(tb_remove);
      }
    }
    
		// check to see if we are dealing with london mazda, if we are do not implement changes from FP-011
		var urlToCheck = url;
		urlToCheck = urlToCheck.toLowerCase();	
		
		if(urlToCheck.indexOf('londonmazda') == -1)
		{
			if(tb_detectMacXFF()){
		      $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
		    }else{
		      $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
		    }
		 }

		$("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:2px; background-image: url("+closeImage+"); background-repeat: no-repeat; background-position: center right; height:23px; width:70px;font-size:18px; color:white;cursor:hand;'>Close</div></div>");
		
		//pass the screen resolutions and colour depth in the URL to the iframe, this is so NI can access variables that it cannot access from within the Iframe natively.
		url = urlNoQuery[0] + "&screenX=" + self.screen.width + "&screenY=" + self.screen.height + "&colorDepth=" + self.screen.colorDepth;
		
		$("#TB_window").append("<iframe frameborder='0' hspace='0' scrolling='no' src='"+url+"' 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
	}
}
