	var PopUpDivWidth = 290;
	var PopUpDivHeight = 150;
	var clickEvent;
	var CatId;
	var TimerId;
	var DivTimerId;
	var MainTimerid;
	var BottomLeftScreen;
	var DocWidth = 0;
	var DocHeight = 0;
	var ScrollX = 0;
	var ScrollY = 0;
	var MouseOutFlag = true;
	var FlyOutHeight = 0;
	var FlyOutWidth = -10;
	var page=null;
	var imgX = 0;
	var imgY = 0;
		
	function OnMouseUpFun(evt, from,topage)
	{
		ScrollX = 0;
		ScrollY = 0;
		
		page=topage;
		
	    //alert(page);
	  // context = _context;
	   //alert(imgId[0])
	    if(from == 1)
	    {
	        MovieImagWidth = parseInt(120,10);
            MovieImagHeight = parseInt(5,15);																				
        }
		//alert(MovieImagWidth+'/'+MovieImagHeight)
         
		   MouseOutFlag = true;
		    //CatId = catId;
		    clickEvent = evt;
		    Position();
		    MainTimerid = setTimeout("Control()", 100);
			//return void;
	}

//Position the popup Div based on the image 

	function Position()
	{
		//alert('in pOSITION')
		
			PopUPDiv = document.getElementById('DivPopUp');
			PopUPifrm = document.getElementById('ifrmPopUp');
			//alert(PopUPDiv)
			GetDocumentHeight();
			GetDocumentScrollXY();
			
			//imgX = 180//parseInt(findPosX(curObj), 10); //called by Rohit on GetDocumentHeight(); 
			//imgY = 620//parseInt(findPosY(curObj),10);
			docX = 1003//DocWidth + parseInt(ScrollX,10);
			docY = DocHeight + parseInt(ScrollY,10);
			
			
			divTopRightX = 505//parseInt(findPosX(curObj), 10) + PopUpDivWidth;
			divLeftBottomY = 680//parseInt(findPosY(curObj), 10) + PopUpDivHeight;
		//alert(divTopRightX+'/'+divLeftBottomY)
		
			//alert(event.clientX)
		//alert(curObj.clientX +'@@@')
		
		imgX = clickEvent.clientX-10;
		imgY = clickEvent.clientY-10;
		//alert(imgX+'@@@'+imgY)
		if(DocWidth-imgX<450){
		imgX=DocWidth-470;
		}
		//alert(imgX+'//'+imgY);
		imgX=imgX+ScrollX;
		if(ScrollY!=0){
			imgY=imgY+ScrollY;
		}
		else{imgY=imgY;}
		//alert(imgX)
		
	
	//alert(ScrollX+'//'+ScrollY);
		//alert(imgX + PopUpDivWidth + MovieImagWidth +'//'+ DocWidth)
		if 	(imgX + PopUpDivWidth + MovieImagWidth < DocWidth) //[ 1 AND 3 ]
			{
				
				PopUPDiv.style.left = imgX + MovieImagWidth  - FlyOutWidth + "px";
				PopUPifrm.style.left = imgX + MovieImagWidth  - FlyOutWidth + "px";
			}
		else 
			 { 
				
				PopUPDiv.style.left = imgX - PopUpDivWidth  + FlyOutWidth + "px";
				PopUPifrm.style.left = imgX - PopUPifrmWidth  + FlyOutWidth + "px";
			}
		if(imgY + MovieImagHeight + PopUpDivHeight > docY)
			{
			
				
				PopUPDiv.style.top = imgY + MovieImagHeight - FlyOutHeight + "px";// imgY - PopUpDivHeight + FlyOutHeight + "px";
				PopUPifrm.style.top = imgY + MovieImagHeight - FlyOutHeight + "px";
			}
		else
			{ 
				
				PopUPDiv.style.top =  imgY + MovieImagHeight - FlyOutHeight + "px";
				PopUPifrm.style.top =  imgY + MovieImagHeight - FlyOutHeight + "px";
			}	
			PopUPDiv.style.zIndex = 2200;
			PopUPifrm.style.zIndex = 2200;
		
	}

	// Get the data from Ajax
	function Control()
	{
		getMousePopUp();
	}

	// Create the object of XmlHttp
	function initXmlHttpRequest()
	{
		if (window.ActiveXObject)
		{
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		else if(window.XMLHttpRequest)
		{
			return  new XMLHttpRequest();
		}
	} 

	// Show the Ajax result into Div
	function getMousePopUp()
	{
		try
		{
		var xmlHttp = initXmlHttpRequest();
		xmlHttp.onreadystatechange = function()
		{
			//alert(xmlHttp.readyState+'/'+xmlHttp.status)
			if(xmlHttp.readyState == 4)
			{  
				if(xmlHttp.status == 200)
				{   
					if(xmlHttp.responseText != null)
					{
						document.getElementById('DivPopUp').style.display= '';
						divH = document.getElementById('DivPopUp').offsetHeight;
						divW = document.getElementById('DivPopUp').offsetWidth;	
						document.getElementById('ifrmPopUp').style.display= '';
						document.getElementById('ifrmPopUp').style.height = (divH);
						document.getElementById('ifrmPopUp').style.width = (divW);
						//document.getElementById('DivPopUp').style.display= block;
						document.getElementById('DivPopUp').innerHTML = xmlHttp.responseText;						
						clearTimeout(MainTimerid)
						delete MainTimerid;
						delete xmlHttp;
					}

				}				
			}
		}
		//alert(page)
		xmlHttp.open( "GET",page, true ); 
		// set "Request-Ajax" header for purpose of url rewriting to identify whether its a ajax request or normal request.        
		xmlHttp.setRequestHeader("Request-Ajax", "XMLHttpRequest");
		xmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		xmlHttp.send(null);
		}
		catch(err)
		{			
//			alert(err.description );
		}
	}

	///Find X position of the Object
	function findPosX(obj)
	  {
	    var curleft = 0;
	    if(obj.offsetParent)
		   while(1) 
		   {
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
			  break;
			obj = obj.offsetParent;
		   }
	    else if(obj.x)
		   curleft += obj.x;
	    return curleft;
	  }


	///Find Y position of the Object
	function findPosY(obj)
	  {
	    var curtop = 0;
	    if(obj.offsetParent)
		   while(1)
		   {
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
			  break;
			obj = obj.offsetParent;
		   }
	    else if(obj.y)
		   curtop += obj.y;
	    return curtop;
	  }

	/// On MouseOut of Image
	function CloseDiv()
	{        
		TimerId = setTimeout('HidePopUpDiv()',1);
		clearTimeout(MainTimerid)
			delete MainTimerid;
	}  

	///On MouseOver of PopUp Div
	function ClearPopUpTimeOut()
	{
		//Clearing the timer of OnMouse Out Of Image
		clearTimeout(TimerId);
		delete TimerId;		
	}    

	/// Hide the PopUp
	function HidePopUpDiv()
	{
		document.getElementById('DivPopUp').style.display = 'none';
		document.getElementById('ifrmPopUp').style.display = 'none';
	}
	
	// Get the Document Height and width
	function GetDocumentHeight()
	{
		
			//alert(typeof( window.innerWidth ))
			//alert(document.body && ( document.body.clientWidth || document.body.clientHeight ))
		/* Getting Document Width and Height starts here*/
		  if( typeof( window.innerWidth ) == 'number' ) 
			{
			 // alert('in 1')
			    //Non-IE
			    DocWidth = window.innerWidth;
			    DocHeight = window.innerHeight;
				//alert(DocWidth+'/'+DocHeight)

			imgX = 160;
			imgY = 560;
				
  			}	 
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			{
			  //  alert('in 2')
				//IE 6+ in 'standards compliant mode'
			    DocWidth = document.documentElement.clientWidth;
			    DocHeight = document.documentElement.clientHeight;
				//alert(DocWidth+'/'+DocHeight)
				imgX = 160;
				imgY = 560;			  			
			}

		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
			{
			//alert('in 3')
			    //IE 4 compatible
			    DocWidth = document.body.clientWidth;
			    DocHeight = document.body.clientHeight;
				//alert(DocWidth+'/'+DocHeight)
					
			  }
			/* Getting Document Width and Height Ends here*/
			//alert('@ exit')
		
		
	}

	// Get the Document Scroll X and Y position 
	function GetDocumentScrollXY()
	{
		
		/* Getting Document Scroll X and Y starts here*/
			if( typeof( window.pageYOffset ) == 'number' ) 
			{
				//Netscape compliant
				ScrollY = window.pageYOffset;
				ScrollX = window.pageXOffset;

			}
			else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
			{
				//DOM compliant
				//alert('in doc scroll')
				ScrollY = document.body.scrollTop;
				ScrollX = document.body.scrollLeft;
				//alert(ScrollY+'/'+ScrollX)
			}
			else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
			{
				//IE6 standards compliant mode
				//alert('in doc scroll')
				ScrollY = document.documentElement.scrollTop;
				ScrollX = document.documentElement.scrollLeft;
			}
			/* Getting Document X and Y Ends here*/
			//alert(ScrollY+'/@@@'+ScrollX)
		
	}

	function divClose(){
	var div = document.getElementById('DivPopUp');
	var ifrm = document.getElementById('ifrmPopUp');
//	alert('@@@'+div)
	div.style.display='none';
	ifrm.style.display='none';
	return false;
	}



