var GB_DONE = false;

function GB_show(jaxtype, height) {
	var realjaxtype = "&style=" + jaxtype;
	var realheight = "?height=" + height;
	GB_HEIGHT = 250;
	if (height) { GB_HEIGHT = height; }
	GB_WIDTH = 500;
	if (jaxtype == "message" || jaxtype == "introduce") GB_WIDTH = 700;
	if(!GB_DONE) {
		$(document.body).append("<div id='GB_overlay' style='display:none'></div><div id='GB_window' style='display:none'></div>");
		$("#GB_window img").click(GB_hide);
		$("#GB_overlay").click(GB_hide);
		$(window).resize(GB_position);
		$(window).scroll(GB_position);
		GB_DONE = true;
	}
	$("#GB_window").html('');
	$("#GB_window").load("/overlay/parse.php" + realheight + realjaxtype);
	$("#GB_window").show();
	if(jaxtype!='mess_loading')
		$("#GB_overlay").show();
	GB_position();
}

function GB_hide() {
	$("#GB_window,#GB_overlay").hide();
	$('#zip_code').focus();
}
// <div id="screen" class="smoke" style="position: absolute; top: 0pt; left: 0pt; width: 100%; height: 2723px; opacity: 0.3;"/>
function GB_position() {
	var de = document.documentElement;
	var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	$("#GB_window").css({width:GB_WIDTH+"px",height:700+"px", left: ((w - GB_WIDTH)/2)+"px", top: "10%" });
	$("#GB_frame").css("height",GB_HEIGHT +"px");
	var yy = $("body > table").height();
	if (!yy) {
		var yy = document.height || document.body.offsetHeight;
	}
	$("#GB_overlay").css("height",yy +"px");
}
function GB_message(id) {
	GB_show('message',id);
	javascript:scroll(0,0);
	return false;
}