//
// Universal Box javascript.
//

//var d=document;
//var thumb=null;

window.onresize=OnWindowResize;

function ShowWindow(title, what)
{
	var thumb = document.getElementById("thumb");
	if(thumb)
	{
		thumb.style.left = String(document.body.clientWidth/2 - 200) + 'px';
		thumb.style.top = String(document.body.clientHeight/2 - 50) + 'px';
		thumb.style.visibility = "visible";
		thumb.innerHTML='<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400"><tr><td width="400" height="45" background="i/smallwindow_top.png"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="100%"><tr><td width="400" height="10" colspan="3"></td></tr><tr><td width="110" height="25"></td><td width="170" height="25" align="center"><p class="title">'+title+'</p></td><td width="120" height="25"></td></tr><tr><td width="400" height="10" colspan="3"></td></tr></table></td></tr><tr><td width="400" background="i/smallwindow_body.png"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><tr><td width="100%"><p class="news">' + what + '</p></td></tr><tr><td width="100%" align="center"><a href="#"><img border="0" src="i/b_ok.gif" onclick="javascript:HideWindow()"></a></td></tr></table></td></tr><tr><td width="40" height="20" background="i/smallwindow_bottom.png"></td></tr></table>';
	}
}


function HideWindow()
{
	var thumb = document.getElementById("thumb");
	if(thumb) thumb.style.visibility = "hidden";
}


function OnWindowResize()
{
	var thumb = document.getElementById("thumb");
	if(thumb)
	{
		thumb.style.left = String(document.body.clientWidth/2 - 200) + 'px';
		thumb.style.top = String(document.body.clientHeight/2 - 50) + 'px';
	}
}

function OpenWindow(fname, w, h)
{
	window.open('viewimage.php?filename=' + fname,'download','width=' + w + ',height=' + h + ',left=0,top=0,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=no');
}

function Copy(sobj, tobj)
{
	var a = new Array();
	a = (sobj.options[sobj.selectedIndex]).value.split("|"); 
	tobj.value = a[1];
}
