/* added for Poppup Starts here */
			
function setXMLHttpReq()
{
	if(typeof(XMLHttpRequest) != "undefined" )
	{
		return new XMLHttpRequest();
	}
	else if( window.ActiveXObject )
	{
		var allVers = ["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
						"MSXML2.XMLHttp.2.0","MSXML2.XMLHttp.1.0"];
		for( var i=0 ; i < allVers.length;i++ )
		{
			try
			{
				var xmlHttp = new ActiveXObject(allVers[i]);
				return xmlHttp;
			}
			catch( ex )
			{
				
			}
		}
	}
	throw new Error("MSXML is not installed");
}

var isMouseOut = false ;
var currElem;
var movieID;
var popUpSize;
var flag = true;
var direction ;
function LostFocus() 
{
	isMouseOut = true ;
	popUpBlocker= 0 ;			
	var objPopUp = document.getElementById( 'PopUp' )
	if( objPopUp == undefined || objPopUp == null )
	{
	return true;
	} 
	objPopUp.innerHTML = ''
	objPopUp.style.width = 0  + 'px'
	objPopUp.style.height = 0 + 'px' 
	objPopUp.style.visibility = 'hidden'
	document.getElementById('TransperantLayer').style.visibility  = 'hidden';
	objPopUp.style.zIndex = 1 ;
} 
function This_onMouse(_currElem,_movieID,_popUpSize) //Controller
{
	currElem = _currElem;
	movieID = _movieID;
	popUpSize = _popUpSize;
	flag = false;
	//alert("anil"+ flag)
	setTimeout("Controller()",1500);

}

function Controller()
{
	if(flag)
	{	
	onMouse();
	}
	if(flag)
		getMovieInfo(movieID,popUpSize,direction); 
	if(flag)
	{
		document.getElementById('TransperantLayer').style.visibility  = 'visible';
		document.getElementById('PopUp').style.visibility = 'visible';
	}	
	else
	{
		LostFocus(); 
		flag = false;
	}
}

function onMouse() 
{	
	LostFocus(); 
	isMouseOut = false ;
	var objPopUp = document.getElementById('PopUp');
	var objTransLayer =	 document.getElementById('TransperantLayer');
	if( objPopUp == undefined || objPopUp == null )
	{
	return true;
	} 
	/////*************************************************************************//////////
	///////////////////*******************If IE*****************////////////////////////////
	/////////////////////////////////////////////////////////////////////////////////////////
	if( navigator.appName.indexOf("Microsoft Internet Explore") >= 0 )
	{		
		if(popUpSize=='SMALL')
		{
		 objPopUp.style.left = findPosX(currElem) + 54 +"px"
		 objTransLayer.style.left =   findPosX(currElem) + 45 +"px"
		 objPopUp.style.top  =  findPosY(currElem) - 63 + "px" 
		 objTransLayer.style.top  =    findPosY(currElem) - 72 + "px"
		 document.getElementById('TransperantLayer').style.height = 289;
		}
		else
		{
			/*if(findPosX(currElem) > 160)
			{
				direction = "left";
				objPopUp.style.left = findPosX(currElem) + 49 + "px"
				//alert("anilad1 ends"+objPopUp.style.left)
				objTransLayer.style.left =   findPosX(currElem) + 40 + "px"
				objPopUp.style.top  =  findPosY(currElem) - 63 + "px" 
				objTransLayer.style.top  =    findPosY(currElem) - 72 + "px"
				objTransLayer.style.width = 351;
				
			}
			else
			{*/
				direction = "left";
				objPopUp.style.left = findPosX(currElem) + 49 + "px"
				objTransLayer.style.left =   findPosX(currElem) + 40 + "px"
				objPopUp.style.top  =  findPosY(currElem) - 63 + "px" 
				objTransLayer.style.top  =    findPosY(currElem) - 72 + "px"
				objTransLayer.style.width = 361;
				
		//	}
			document.getElementById('TransperantLayer').style.height = 415;
		}
		objPopUp.style.width = 345;
		
		objPopUp.style.zIndex  = 45 ;
		objTransLayer.style.zIndex = 18;
		currentID = movieID ;
		
	}
	/////////////////////////////////////////////////////////////////////////////////////////
	//////////////////*****************If Mozilla/Netscape etc..***********//////////////////
	/////////////////////////////////////////////////////////////////////////////////////////
	else
	{
	 if(popUpSize=='SMALL')
	 {
	  left = findPosX( currElem ) + 45 + "px" ;
	  top  = findPosY( currElem ) - 63 + "px";
	  objPopUp.style.left = left 
	  objTransLayer.style.left = left  
	  objPopUp.style.top  = top  
	  top  = findPosY( currElem ) - 72 + "px";
	  objTransLayer.style.top = top 
	  document.getElementById('TransperantLayer').style.height = 281;
	 }
	 else
	 {
		/*if(findPosX(currElem) > 162)
		{
			direction = "left";
			left = findPosX( currElem ) + 45 + "px" ;
			top  = findPosY( currElem ) - 63 + "px";
			objPopUp.style.left = left 
			objPopUp.style.top  = top  
			left  = findPosX( currElem ) + 54  + "px";
			objTransLayer.style.left = left 
			top  = findPosY( currElem ) - 72 + "px";
			objTransLayer.style.top = top 
			document.getElementById('TransperantLayer').style.height = 381;
		}
		else
		{*/
			direction = "left";
			left = findPosX( currElem ) + 45 + "px" ;
			top  = findPosY( currElem ) - 63 + "px";
			objPopUp.style.left = left 
			objPopUp.style.top  = top  
			left =  findPosX( currElem ) + 54 + "px";
			objTransLayer.style.left = left  
			top  = findPosY( currElem ) - 72 + "px";
			objTransLayer.style.top = top 
			document.getElementById('TransperantLayer').style.height = 381;
		//}
	}
	 objPopUp.style.zIndex  = 10 ;	
	 objPopUp.style.width = 351 
	 objTransLayer.style.width = 360; 
	 currentID = movieID ;		
	}
	
}
function show()
{	
//alert("showstart"+flag)
	if(flag)
		falg = false;
	else
		flag = true;
//alert("showend"+flag)
		
}

function findPosX(obj)
{
	var curleft = 0;
	//alert("xposstart "+obj.offsetParent)
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		curleft += obj.offsetLeft; 
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
		curtop += obj.offsetTop;
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
	
}		

function ClearPopup()
{
	//alert("anil")
		document.getElementById('TransperantLayer').style.visibility  = 'hidden';
		document.getElementById('PopUp').style.visibility = 'hidden';
}
/* added for Poppup Starts here */							

