function checkit(id)
{
	if(document.getElementById(id).value=="")return 0;
	return 1;
}

function showdialog2(id)
{
document.getElementById('trans2').innerHTML="<center>"+document.getElementById(id).innerHTML+"<br><input type=button value='Close' onclick='document.getElementById(\"trans2\").style.display=\"none\";'></center>";
document.getElementById('trans2').style.top=document.body.scrollTop+100;
document.getElementById('trans2').style.left=document.body.clientWidth/2-parseInt(document.getElementById(id).style.height)/2;
document.getElementById('trans2').style.display='block';
}


function ShowDialog(id)
{
ShownDivId=id;
funcScrollDiv();
setOpacity();
document.getElementById(id).style.display = 'block';
}

function showdialog(id, text)
{
ShownDivId=id;
funcScrollDiv();
setOpacity();
document.getElementById(id).style.display = 'block';
}

function hidedialog() {
removeOpacity();
document.getElementById(ShownDivId).style.display = 'none';
}


function showdialogmce(id)
{
document.getElementById(id).style.top=document.body.scrollTop+100;
document.getElementById(id).style.display = 'block';
}


function showIcons(index) {
var move = document.getElementById('move-' + index);
	if (move != null) {
		if(move.style.display == 'block')
		{
		hideIcons(index);
		}
		else
		{
		move.style.display = 'block';
		}
	}
}
function hideIcons(index) {
var move = document.getElementById('move-' + index);
if (move != null) {
move.style.display = 'none'
}
}


function funcScrollDiv()
{
	var scrtop=getBodyScrollTop()-100;
	var scrleft=getBodyScrollLeft();
 
    if (document.getElementById(ShownDivId))
	{
		var divElement = document.getElementById(ShownDivId);
		divElement.style.left=(parseInt(screen.width)-parseInt(divElement.offsetWidth))/2+"px";
		divElement.style.top=((parseInt(screen.height)-parseInt(divElement.offsetHeight))/2)+scrtop+"px";
	}
 
	setTimeout(funcScrollDiv, 1);
}

function getBodyScrollTop()
{
	return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
 
function getBodyScrollLeft()
{
	return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

if (document.layers)
document.captureEvents(Event.KEYPRESS);

function HideOnEsc(e) {
      var kC  = (window.event) ?    // MSIE or Firefox?
                 event.keyCode : e.keyCode;
      var Esc = (window.event) ?   
                27 : e.DOM_VK_ESCAPE // MSIE : Firefox
      if(kC==Esc) {
			hidedialog();
			}
   }
document.onkeypress=HideOnEsc;

    var opacityvalue = 0;

    function setOpacity() {
       opacityvalue += .9;
       var testObj = document.getElementById('shade');
       
       testObj.style.width = "100%";
       testObj.style.height = parseInt(document.body.scrollHeight)+'px';
       testObj.style.display = "block";
       testObj.style.opacity = opacityvalue/10;
       testObj.style.filter = 'alpha(opacity=' + opacityvalue*10 + ')';
       myTimeout = setTimeout("setOpacity()", 1);
       
       if ((opacityvalue/10) >= .5) {
          clearTimeout(myTimeout);
       }
    }

    function removeOpacity() {
       opacityvalue -= .9;
       var testObj = document.getElementById('shade');
       
       myTimeout2 = setTimeout("removeOpacity()", 1);
       testObj.style.opacity = opacityvalue/10;
       testObj.style.filter = 'alpha(opacity=' + opacityvalue*10 + ')';
       
       if ((opacityvalue/10) <= 0) {
          testObj.style.display = "none";
          clearTimeout(myTimeout2);
       }
    }

var xurl="http://toons-empire.com/";
var xtitle="Toons Empire";
function bookmark() {window.external.AddFavorite(xurl,xtitle);}