function loadimg()
{
	if ($("#floatBoxBg").css("display")=="block")
	{
		$("#floatBoxBg").next().after($("#floatBoxBg"));
	}
	else
	{
		var temp_floatBg=new String;
		// 检测是 IE6.0
		if($.browser.msie&&($.browser.version == "6.0")&&!$.support.style)
		{
			temp_floatBg="<iframe id=\"floatBoxBg\" class=\"floatBoxBg\"></iframe>";
		}else
			temp_floatBg="<div id=\"floatBoxBg\" class=\"floatBoxBg\"></div>";
		$("body").append(temp_floatBg);
		$("#floatBoxBg").css({height:$(document).height()}).show();
	}
//	//开始loading
//	var temp_loading=new String;
//	temp_loading="<div id=\"loadimg\" class=\"loading\">";
//	temp_loading+="<div class=\"loading_left left\"></div>";
//	temp_loading+="<div class=\"loading_c left\">";
//	temp_loading+="<div class=\"loading_c_dot left\"><img src=\"images/loading_dot.gif\" width=\"121\" height=\"10\" /></div>";
//	temp_loading+="<div class=\"loading_c_ball right\"><img src=\"images/loading_ball.gif\" width=\"30\" height=\"30\" /></div>";
//	temp_loading+="</div>";
//	temp_loading+="<div class=\"loading_right left\"></div>";
//	temp_loading+="</div>";
//	$("body").append(temp_loading);
//	var loading_width = $("#loadimg").width();
//	var loading_height = $("#loadimg").height();
//	//loading出现	
//	$("#loadimg").ajaxStart(function(){
//		$("#loadimg").css({"left":(($(document).width())/2-(loading_width/2))+"px","top":(document.documentElement.clientHeight-loading_height) / 2 + document.documentElement.scrollTop +"px"}).show();
//	});
}

// 定义弹出框id，使不同，加载url的内容
function dialog(act_url){
	$.ajax({
		type: "POST",
		url: act_url,
		success: function(msg){
			$("div.container").html(msg);
			var floatbox_width = $("#floatBox").width();
			var floatbox_height = $("#floatBox").height();
			$("#floatBox").css({"left":(($(document).width())/2-(floatbox_width/2))+"px","top":(document.documentElement.clientHeight-floatbox_height) / 2 + document.documentElement.scrollTop +"px"}).show();
		}
	 });
}
// 弹出提示信息，直接显示msg
function g_dialog_msg(msg){
	if ($("#floatBoxBg").css("display")=="block")
	{
		$("#floatBoxBg").next().after($("#floatBoxBg"));
	}
	else
	{
		var temp_floatBg=new String;
		temp_floatBg="<div id=\"floatBoxBg\" class=\"floatBoxBg\"></div>";
		$("body").append(temp_floatBg);
		$("#floatBoxBg").css({height:$(document).height()}).show();
	}

	var temp_float=new String;
	temp_float="<div id=\"floatBox\" class=\"floatBox\" aurl="+""+">";
	temp_float+="<div class=\"closer\"><img src=\"g_images/icon_close.jpg\" width=\"16\" height=\"16\" /></div>";
    temp_float+="<div class=\"titlelogo\"><img src=\"g_images/logo_g.jpg\" width=\"72\" height=\"47\" /></div>";
    temp_float+="<div class=\"clear\"></div>";
    temp_float+="<div class=\"container\">";
    temp_float+="</div>";
	temp_float+="</div>";

	$("body").append(temp_float);
	dialog(msg);
	var floatbox_width = $("#floatBox").width();
	var floatbox_height = $("#floatBox").height();
	$("#floatBox").css({"left":(($(document).width())/2-(floatbox_width/2))+"px","top":(document.documentElement.clientHeight-floatbox_height) / 2 + document.documentElement.scrollTop +"px"}).show();
	
}
function dialog_msg(msg){
	if ($("#floatBoxBg").css("display")=="block")
	{
		$("#floatBoxBg").next().after($("#floatBoxBg"));
	}
	else
	{
		var temp_floatBg=new String;
		temp_floatBg="<div id=\"floatBoxBg\" class=\"floatBoxBg\"></div>";
		$("body").append(temp_floatBg);
		$("#floatBoxBg").css({height:$(document).height()}).show();
	}

	var temp_float=new String;
	temp_float="<div id=\"floatBox\" class=\"floatBox\" aurl="+""+">";
	temp_float+="<div class=\"closer\"><img src=\"images/icon_close.jpg\" width=\"16\" height=\"16\" /></div>";
    temp_float+="<div class=\"titlelogo\"><img src=\"images/logo4.jpg\" width=\"72\" height=\"47\" /></div>";
    temp_float+="<div class=\"clear\"></div>";
    temp_float+="<div class=\"container\">";
    temp_float+="</div>";
	temp_float+="</div>";

	$("body").append(temp_float);
	dialog(msg);
	var floatbox_width = $("#floatBox").width();
	var floatbox_height = $("#floatBox").height();
	$("#floatBox").css({"left":(($(document).width())/2-(floatbox_width/2))+"px","top":(document.documentElement.clientHeight-floatbox_height) / 2 + document.documentElement.scrollTop +"px"}).show();
	
}

/**
*	关闭弹出框
*/
function hide_popup()
{
	//弹出框的id，每关闭一个递减
	$("#floatBox").remove();
	if ($(".floatBox").css("display")=="block")
	{
		$("#floatBoxBg").after($("#floatBoxBg").prev());
	}
	else
	{
		$("#floatBoxBg").remove();
	}
}
