var s, posY = 125; 
function createplayer3(theFile) {
	var arrayPageHeight = getPageSize();
	var arrayPageScroll = getPageScroll();
	yPageScroll = arrayPageScroll[1];
	
	document.getElementById("loadingdata").style.top = (posY + yPageScroll) + 'px';
	
	document.getElementById("backLyr").style.height = arrayPageHeight + 'px';
	document.getElementById("backLyr").style.display = "block";
	s = new SWFObject("http://www.estatemedia.no/videoBox/player.swf","playerID","420","245","7");
	s.addParam("allowfullscreen","true");
	s.addParam("allowscriptaccess","always");
	s.addVariable("file",theFile);
	s.addVariable("width","420");
	s.addVariable("height","245");
	s.addVariable("displayheight","225");
	s.addVariable("overstretch","fit");	
	s.addVariable("autostart","true");
	s.write("lfNwMd");
	document.getElementById("loadingdata").style.display = "block";
}

function hide() {
	s = null;
	document.getElementById("lfNwMd").innerHTML = "";
	document.getElementById("loadingdata").style.display = "none";
	document.getElementById("backLyr").style.display = "none";
}

function getPageSize(){
	var yScroll, windowHeight;
	if (window.innerHeight && window.scrollMaxY) {	
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
	}
	if (self.innerHeight) {	// all except Explorer
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowHeight = document.body.clientHeight;
	}	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	return pageHeight;
}

function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function fnSetPos(){
	var arrayPageScroll = getPageScroll();
	yPageScroll = arrayPageScroll[1];
	document.getElementById("loadingdata").style.top = (posY + yPageScroll) + 'px';
}