function height() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function check() {
  //alert('window height: '+height()+"\n\n"+'content height: '+(document.getElementById('content').offsetHeight+200));
  var bottom = document.getElementById('bottom');


  if(document.getElementById('background'))
	  var background = document.getElementById('background');
  else if(document.getElementById('moongod'))
 	  var background = document.getElementById('moongod');
  else if(document.getElementById('background_hearquran'))
 	  var background = document.getElementById('background_hearquran');
  else	
 	  var background = document.getElementById('surah');

  var content = document.getElementById('content');
  if((content.offsetHeight+280) < height()) {
    background.style.height = height()+'px';
    background.style.overflow = 'hidden';
    bottom.style.position = 'absolute';
    bottom.style.bottom = '0px';
    bottom.style.left = '-375px';
    bottom.style.margin = '0px 0px 0px 50%';
  } else {
    if(height() < 701) background.style.overflow = 'hidden';
    background.style.height = (content.offsetHeight+300)+'px';
    bottom.style.position = 'relative';
  }
  setTimeout("check()", 100);
}

var set = 0;
function rollover(obj) {
  if(set == 0) {
    var name = obj.src.replace(".gif", "");
    obj.src = name+"over.gif";
    set = 1;
  } else {
    var name = obj.src.replace("over.gif", "");
    obj.src = name+".gif";
    set = 0;
  }
}

window.onload = function() {
check();
}