// JavaScript Document
function pop_createXMLHttpRequest() {
   try { return new XMLHttpRequest(); } catch(e) {}
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
   alert("XMLHttpRequest not supported");
   return null;
}
var pop_xhReq = pop_createXMLHttpRequest();
function showPopUp($page,$id){
	pop_xhReq.open("post", $page+".php");
	pop_xhReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	pop_xhReq.onreadystatechange = popBack
	pop_xhReq.send("vid_id="+$id);
	var ele = document.getElementById('popup_div');
	if (ele){
		ele.style.visibility = 'visible';
	}
}
function closePopUp(){
	var ele = document.getElementById('popup_div');
	if (ele){
		ele.style.visibility = 'hidden';
		ele.innerHTML = "";
	}
}
function popBack(){
	if (pop_xhReq.readyState == 4) {
		if (pop_xhReq.status == 200) {
			var doc = pop_xhReq.responseText;
			var ele = document.getElementById('popup_div');
			if (ele){
				ele.style.visibility = 'visible';
				ele.innerHTML = doc;
			}
		} else {
			alert('There was a problem with the request.');
		}
	}
}