function pageblock(str,secheight){
	var obj_name = "pageblock";
		bgfade(0,obj_name);
	var getdiv=document.getElementById(obj_name);
	var pageWH=getPageSize();
	//getdiv.onclick=function () {pageblockclose();};
	getdiv.style.width=( pageWH[0] + 'px' );
	getdiv.style.height=( pageWH[1] + 'px' );
	getdiv.style.display="block";
	var getdivcontent=document.getElementById("pageblockcontent");
	setTimeout("vidLoading();",3000);
	//vidLoading();
	//var newsecheight=secheight-130;
	//alert(newsecheight + 'px');
	getdivcontent.style.top='100px';
	getdivcontent.style.display="inline";

	if(document.getElementById('video_'+str)){
		document.getElementById('finalvid').innerHTML=document.getElementById('video_'+str).innerHTML;
	}else{
		alert("Video not found!");
		pageblockclose();
		return false;
	}

}

function vidLoading(){
	var getdivcontent=document.getElementById("pageblockcontent");
	var secgetdiv=getdivcontent.getElementsByTagName('div');
	secgetdiv[0].style.display='block';
}

function bgfade(op,obj_name){
	var obj = document.getElementById(obj_name);
	if(op==80) return false; else op = op + 10;
	if(navigator.appName=='Microsoft Internet Explorer')
		obj.filters.alpha.opacity = (op-0);	else obj.style.opacity = ((op-0)/100);
	setTimeout("bgfade("+op+",'"+obj_name+"')",10);
}

function bgfadef(op,obj_name){
	var obj = document.getElementById(obj_name);
	if(op==00){
		obj.style.display="none";
		return false;
	}else{
		op = op - 10;
	}
	if(navigator.appName=='Microsoft Internet Explorer')
		obj.filters.alpha.opacity = (op-0);	else obj.style.opacity = ((op-0)/100);
	setTimeout("bgfadef("+op+",'"+obj_name+"')",10);
}

function pageblockclose(){
	var getdivcontent=document.getElementById("pageblockcontent");
	getdivcontent.style.display="none";
	
	//var getdiv=document.getElementById("pageblock");
	//getdiv.style.display="none";
	bgfadef(80,"pageblock");
}

function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		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
		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;
	}	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function videoEmbSource(str,secheight){
	pageblock(str,secheight);
}
