var dBox=new Object();
dBox.Html=""
dBox.Title="";
dBox.Text="";
dBox.Icon="";
dBox.Button="";
dBox.ButtonType={
	"O":{ "Text":"Tamam","Action":"" },
	"Y":{ "Text":"Evet","Action":"" },
	"N":{ "Text":"Hayır","Action":"" },
	"C":{ "Text":"İptal","Action":"" },
	"C1":{ "Text":"","Action":"" },
	"C2":{ "Text":"","Action":"" },
	"C3":{ "Text":"","Action":"" },
	"C4":{ "Text":"","Action":"" },
	"A":{ "Text":"","Action":"" } };
dBox.ButtonClick="";
function dBoxCreate() {
	var ww, wh, w, h, t, l;
	if (self.innerHeight) {
		ww=self.innerWidth;
		wh=self.innerHeight;
	} else {
		ww=document.body.clientWidth;
		wh=document.body.clientHeight;
	}
	w=450; h=150;
	l=((ww/2)-(w/2));
	t=((wh/2)-(h/2));
	try {
		l+=document.body.scrollLeft;
		t+=document.body.scrollTop;
	} catch (err) { }
	var html='';
	html+='<div id="dBox" style="position:absolute; padding:0; margin:0; left:0px; top:0px; width:100%; height:100%;">';
	html+='<iframe src="/script/dbox/dBoxBlank.html" frameborder="0" width="100%" height="100%" scrolling="no" allowTransparency="true">';
	html+='</iframe>';
	html+='<div style="position:absolute; padding:0; margin:0; left:'+l+'px; top:'+t+'px; width:'+w+'px; height:'+h+'px;">';
	html+='<iframe src="/script/dbox/dBoxAlert.html" frameborder="0" width="100%" height="100%" scrolling="no">';
	html+='</iframe>';
	html+='</div>';
	html+="</div>";
	dBox.Html=html;
}
function dBoxShow(text, icon, title, button) {
	dBox.Text=text;
	dBox.Icon=(((icon==null)||(icon==""))?"I":icon);
	if ((title==null)||(title=="")) {
		if (dBox.Icon=="O") title="Tamam";
		if (dBox.Icon=="I") title="Bilgi";
		if (dBox.Icon=="!") title="İkaz";
		if (dBox.Icon=="?") title="Sor";
		if (dBox.Icon=="X") title="Dikkat";
	}
	dBox.Title=(((title==null)||(title==""))?"Bilgi":title);
	dBox.Button=(((button==null)||(button==""))?"O":button);
	dBoxCreate();
	document.getElementById("dBoxBody").innerHTML=dBox.Html;
	document.getElementById("dBoxBody").style.display="block";
}
function dBoxHide() {
	document.getElementById("dBoxBody").style.display="none";
	var d=document.getElementById("dBox");
	d.parentNode.removeChild(d);
}
function dBoxClick(b) {
	dBoxHide();
	if (dBox.ButtonType[b]["Action"]>"") eval(dBox.ButtonType[b]["Action"]);
	else if (dBox.ButtonType["A"]["Action"]>"") eval(dBox.ButtonType["A"]["Action"]);
}

