var s, posY = 125; 
function createplayer3(theFile) {
	var arrayPageHeight = getPageSize();
	var arrayPageScroll = getPageScroll();
	yPageScroll = arrayPageScroll[1];

	document.getElementById("lfNwMd").innerHTML = "";
	document.getElementById("imgData").innerHTML = "";
	document.getElementById("backLyr").style.height = (arrayPageHeight + 50) + 'px';
	document.getElementById("backLyr").style.display = "block";

    sUrl = document.getElementById("hidBasePath").value;
    var urlx = encodeURI(sUrl + '/video/');
	s = new SWFObject(urlx + "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("roundcont").style.display = "none";
	document.getElementById("roundcont").style.visibility = "hidden";

	var sVideoLyr = document.getElementById("loadingdata");
	sVideoLyr.style.display = "block";
	var sBackLyr = document.getElementById("backLyr");

	sVideoLyr.style.top = (posY + yPageScroll) + 'px';
	sVideoLyr.style.width = (420 + 20) + "px";
	sVideoLyr.style.left = ((sBackLyr.offsetWidth -  parseInt(sVideoLyr.style.width))/2) + "px";
}

function hide() {
	s = null;
	document.getElementById("lfNwMd").innerHTML = "";
	document.getElementById("imgData").innerHTML = "";
	document.getElementById("loadingdata").style.display = "none";
	document.getElementById("roundcont").style.display = "none";
	document.getElementById("backLyr").style.display = "none";
}


function hideImg() {
	document.getElementById("lfNwMd").innerHTML = "";
	document.getElementById("imgData").innerHTML = "";
	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(){
	try{
	var arrayPageScroll = getPageScroll();
	yPageScroll = arrayPageScroll[1];
	document.getElementById("loadingdata").style.top = (posY + yPageScroll) + 'px';
	}
	catch(ex){}
}


function showImg(theFile, desc) {
	var arrayPageHeight = getPageSize();
	var arrayPageScroll = getPageScroll();
	yPageScroll = arrayPageScroll[1];
	var sRound = document.getElementById("roundcont");
	document.getElementById("imgData").style.display = "block";
	var sBackLyr = document.getElementById("backLyr");
	document.getElementById("loadingdata").style.display = "none";
	sRound.style.top = (posY + yPageScroll) + 'px';
	sBackLyr.style.height = arrayPageHeight + 'px';
	sBackLyr.style.display = "block";
	document.getElementById("imgData").innerHTML = "<img id='sImg' src='"+ theFile +"'><div class='dvInfo'>"+ desc +"</div>";
	sRound.style.display = "block";
	document.getElementById("roundcont").style.visibility = "visible";
	sRound.style.width = (document.getElementById("sImg").width + 20) + "px";
	sRound.style.left = ((sBackLyr.offsetWidth -  parseInt(sRound.style.width))/2) + "px";
	if((posY + document.getElementById("sImg").height + 90) > parseInt(sBackLyr.style.height)){
		document.getElementById("backLyr").style.height = (posY + document.getElementById("sImg").height + 90) + "px";
	}
}