﻿function showDialog(){
	
	if(showDialog.arguments[0]!=null){
		$("#dialogTitle").html(showDialog.arguments[0]);
		
		if(showDialog.arguments[1]!=null){
			$("#dialogContent").html(showDialog.arguments[1]);
		}
	}else{
		$("#dialogTitle").html("");
	}
	
	var height=$("#dialogFrame").height();
	var width=$("#dialogFrame").width();
	
	var top=(document.body.clientHeight-height)/2+document.body.scrollTop;
	var left=(document.body.clientWidth-width)/2;
	
	$("#dialogFrame").css("top",top-10);
	$("#dialogFrame").css("left",left);
	
	$(".dialogFoil").show();
}

function hideDialog(){
	$(".dialogFoil").hide();
	$("#hint").hide();
}

function closeDialog(){
	hideDialog();
	return false;
}

function readyDialogAction(){
	var height=document.body.scrollHeight+5;
	$("#dialogShader").height(height);
	$("#dialogBackground").height(height);
	
	$("#dialogBackground").click(function(){
		hideDialog();
	});
}
