	var myWidth = 0, myHeight = 0;
	var casovac = 5000;

    function setOpacity(eID, opacityLevel) {
        var eStyle = document.getElementById(eID).style;
        eStyle.opacity = opacityLevel / 100;
        eStyle.filter = 'alpha(opacity='+opacityLevel+')';
    }

    function getElm(eID) {
        return document.getElementById(eID);
    }
    function show(eID) {
        getElm(eID).style.display='block';
    }
    function hide(eID) {
        getElm(eID).style.display='none';
    }
    function fadeIn(eID) {
        setOpacity(eID, 0); show(eID); var timer = 0;
        for (var i=1; i<=100; i++) {
            setTimeout("setOpacity('"+eID+"',"+i+")", timer * 10);
            timer++;
        }
    }
    function fadeOut(eID) {
        var timer = 0;
        for (var i=100; i>=1; i--) {
            setTimeout("setOpacity('"+eID+"',"+i+")", timer * 3);
            timer++;
        }
        setTimeout("hide('"+eID+"')", 310);
    }

    function cekej() {

    }


function alertSize() {

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth - 150;
    myHeight = window.innerHeight - 150;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth - 150;
    myHeight = document.documentElement.clientHeight - 150;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth - 150;
    myHeight = document.body.clientHeight - 150;
  }
	moveBox();
}

function moveBox() {

	var random_x=Math.floor(Math.random()*myWidth);
	var random_y=Math.floor(Math.random()*myHeight);
	document.getElementById('myBox').style.left=random_x+'px';
	document.getElementById('myBox').style.top=random_y+'px';
	fadeIn('myBox');
	setTimeout('cekej()', casovac);
	setTimeout('moveBox()', casovac);

}
