function MiddleDiv(ev, n, width, height){
	// iframe borders
	width+=4;
	height+=4;

	if(!document.getElementById) return true;
	if(!document.createElement) return true;
	if(!document.body) return true;
	if(!document.body.appendChild) return true;
	if(n.nodeName!='A' && n.nodeName!='AREA') return true;

	var video=document.createElement('IFRAME');
	if(!video) return true;
	video.src='/video.php?p='+escape(n.href);

	var st=0;
	if(typeof(self.pageYOffset)!='undefined') // all except Explorer
		st=self.pageYOffset;
	else if(document.documentElement && document.documentElement.scrollTop)
		st=document.documentElement.scrollTop;
	else if(document.body) // all other Explorers
		st=document.body.scrollTop;
	
	var blocker=document.createElement('DIV');
	blocker.className='blocker';
	var w=0,h=0;
	if(document.body){
		w=Math.max(w, document.body.scrollWidth);
		h=Math.max(h, document.body.scrollHeight);
		w=Math.max(w, document.body.offsetWidth);
		h=Math.max(h, document.body.offsetHeight);
	}
	if(document.documentElement && typeof(document.documentElement.scrollHeight)!='undefined'){
		w=Math.max(w, document.documentElement.scrollWidth);
		h=Math.max(h, document.documentElement.scrollHeight);
	}
	if(document.documentElement && typeof(document.documentElement.offsetHeight)!='undefined'){
		w=Math.max(w, document.documentElement.offsetWidth);
		h=Math.max(h, document.documentElement.offsetHeight);
	}
	if(w) blocker.style.width=w+'px';
	if(h) blocker.style.height=h+'px';
	blocker.onclick=doNothing;
	document.body.appendChild(blocker);

	window.scrollTo(0,0);

	w=0; h=0;
	var l=0, t=21;
	if(typeof(self.innerHeight)!='undefined'){ // all except Explorer
		w=self.innerWidth;
		h=self.innerHeight;
	} else if(document.documentElement && document.documentElement.clientWidth){
		// Explorer/Mozilla strict mode
		w=document.documentElement.clientWidth;
		h=document.documentElement.clientHeight;
	} else if(document.body){ // other Explorers
		w=document.body.clientWidth;
		h=document.body.clientHeight;
	}
	if(w) l=Math.max(0,(w-width)/2);
	if(h) t=Math.max(0,(h-height)/2);
	video.style.left=l+'px';
	video.style.top=t+'px';
	video.style.width=width+'px';
	video.style.height=height+'px';
	video.className='video';
	document.body.appendChild(video);

	var vidbutton=document.createElement('DIV');
	vidbutton.className='vidbutton';
	vidbutton.style.left=l+'px';
	vidbutton.style.top=(t+height+10)+'px';
	vidbutton.style.width=width+'px';
	var x=document.createElement('SPAN');
	vidbutton.appendChild(x);
	x.appendChild(document.createTextNode('[Close]'));
	x.onclick=function(){
		video.src='/video.php';
		document.body.removeChild(vidbutton);
		document.body.removeChild(video);
		document.body.removeChild(blocker);
		window.scrollTo(0,st);
	};
	document.body.appendChild(vidbutton);

	return doNothing(ev);
}
function doNothing(ev){
	if(!ev) ev=window.event;
	if(!ev) return false;
	if(ev.preventDefault) ev.preventDefault();
	if(ev.stopPropagation) ev.stopPropagation();
	ev.returnValue = false;
	ev.cancelBubble = true;
	return false;
}
function MiddleDiv_ld(){
	if(document.getElementById){
		var a=document.getElementById('MiddleDivAutoClick');
		if(a) a.onclick();
	}
}
