/* kawamoto.js
 */

function toTop(id){document.getElementById(id).scrollTop=0}
var step=3;
var timer;
function scrollDivDown(id){
document.getElementById(id).scrollTop+=step;
timer=setTimeout("scrollDivDown('"+id+"')",1);
}
function scrollDivUp(id){
document.getElementById(id).scrollTop-=step;
timer=setTimeout("scrollDivUp('"+id+"')",1);
}
function toBottom(id){ document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight; }
function toPoint(id){ document.getElementById(id).scrollTop=100; }
function noScroll(id){ clearTimeout(timer); }
function showDiv(id){ document.getElementById(id).style.visibility = "visible"; }
function hideDiv(id){ document.getElementById(id).style.visibility = "hidden"; }
function setSrc(id,file){ document.getElementById(id).src= file; }

function getPageSize() {
	        
	     var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}

var browser = navigator.appName;

function showAd(){
	if( browser != "Microsoft Internet Explorer"){
	var arrayPageSize = getPageSize();
    var over = document.getElementById('overlay');
    over.style.width = arrayPageSize[0] + 'px';
    over.style.height= arrayPageSize[1] + 'px';
	over.style.display= 'block';
	}
	document.getElementById('reklam').style.display = 'block';
}
function hideAd(){
document.getElementById('overlay').style.display = 'none';
document.getElementById('reklam').style.display = 'none';
}

