function ErrorHandler(objerrorcontent,objerrortrue){
	if(objerrortrue){
		errnum=errnum+1;
		$("#errnum").html( errnum +" ERROR");
		$("#errorcontent").append(objerrorcontent + "<br/>");
		//errortruefalse = true;
		Errorhtmlevent();
	}			
}

var gameMoneyType=false;
function Errorhtmlevent(){

	$("#errorhandler").css({"display":"block","z-index":"999","top": (errheight - 350)/2 + "px","left":( errwidth - 800)/2 + "px","width":"800px"});
	if(gameMoneyType){
	    $("#errorhandler").css("top","100px");   
	}
	$("#errorbg").css({"display":"block","top":"0px","z-index":"998","left":"0px","width":errwidth+"px","height":errheight+"px"});	
}		

var errnum=0;


var he=$("#header").height()+$("#picheader").height()+$("#nav").height()+$("#center").height()+$("#foot").height();
var errortruefalse=false;
var errwidth=document.documentElement.clientWidth>$("#main").width()?document.documentElement.clientWidth:$("#main").width();
var errheight=window.document.documentElement.clientHeight>he?window.document.documentElement.clientHeight:he;

function onerrorclose_Click(){   
   gameMoneyType=false; 
   $("#gameMoney").attr("src","");
   $("#errorhandler").css({"z-index":"-1","display":"none"});
   $("#errorbg").css({"z-index":"-1","display":"none"});
  
   
}
function onwinclosenotice_Click(){
    $("#notice").fadeOut(1000,function(){$("#notice").css({"z-index":"-1"});});    
    $("#noticebg").slideToggle(1000,function(){$("#noticebg").css({"z-index":"-1"});});
}
function onwincloseversion_Click(){
    $("#version").fadeOut(1000,function(){$("#version").css({"z-index":"-1"});});
    $("#versionbg").slideToggle(1000,function(){$("#versionbg").css({"z-index":"-1"});}); 
    flashclose=false; 
}

function onliveChat(){
    $("#basic-modal-content").css({"top": (errheight - $("#basic-modal-content").height() )/2 + "px","left":( errwidth - $("#basic-modal-content").width() )/2 + "px"});
}

window.onresize=function(){
    var h=$("#header").height()+$("#picheader").height()+$("#nav").height()+$("#center").height()+$("#foot").height();
    errwidth=document.documentElement.clientWidth>$("#main").width()?document.documentElement.clientWidth:$("#main").width();
	errheight=window.document.documentElement.clientHeight>h?window.document.documentElement.clientHeight:h;
	noticeHandle();
	IsFlash();
	SetGameHall();
	onliveChat();
	gameMoneySize();
};