var g_timeID = 0;

function cancelZoomIndexIn()
{
    if (g_timeID != 0)
        clearTimeout(g_timeID);
}

function zoomIndexIn(o){
    g_timeID = setTimeout("zoomItem('" + o.id + "')", 500);
}

function zoomItem(oID){

    o = document.getElementById(oID);
	rect = o.getBoundingClientRect();
	zoom = document.getElementById('idZoom');
	
	if(zoom)
		zoom.removeNode(true);
	
	zoom = document.createElement("div");
	zoom.id = 'idZoom';
	document.body.appendChild(zoom);
	
	zoom.style.top = rect.top-50;
	zoom.style.left = rect.left-30;
	zoom.style.right = rect.right+30;
	zoom.style.bottom = rect.bottom+30;
	zoom.style.backgroundColor = 'red';
	zoom.style.position = 'absolute';
	//zoom.style.display = 'block';
	//zoom.innerHTML = o.innerHTML;
	newObj = o.cloneNode(true);
	newObj.onmouseover = null;
	newObj.onmouseout= zoomIndexOutZoom;
	newObj.style.width='351px';
	newObj.style.height='255px';
	//newObj.style.zoom = 1.6;
	newObj.onclick = onZoomClick;
	zoom.oid = o.id;
	zoom.startTime = o.startTime;
	zoom.appendChild(newObj);

/*
	o.style.top="-20px";
	o.style.left="-40px";
	o.style.width="200px"; 
	o.style.height="160px";
	o.style.position="absolute"; 
	o.style.borderColor="gray";
	o.style.zIndex=10000;
	window.status=o.style.zIndex;
	*/
}

function onZoomClick(){
	zoom = document.getElementById('idZoom');
	if(zoom){
	    window.location = "InstructorViewer.aspx?startTime=" + zoom.startTime;
		/*alert(zoom.oid);
		if(zoom.oid)
			alert(zoom.oid);*/
	}
}

function zoomIndexOutZoom(){
	zoom = document.getElementById('idZoom');
	if(zoom){
		zoom.style.display = 'none';
		zoom.removeNode(true);
	}
}

function zoomIndexOut(o){
/*	o.style.top="0";
	o.style.left="0";
	o.style.width="130px"; 
	o.style.height="120px";	
	o.style.position="relative"; 
	o.style.borderColor="white";
	o.style.zIndex=-1;
	window.status=o.style.zIndex;
	*/
}
