﻿// JScript File
var ttoltiploading="<table cellspacing='0' cellpadding='5' border='0' width='200' bgcolor='#D17869'><tr><td align='center' class='buytickettxt'><b>Please wait.. while the information is being loaded. </b></td></tr></table>";
var tooltipup="<table cellspacing='0' cellpadding='0' border='0' width='200' bgcolor='#D17869'>";
var tooltipdown="</table></td></tr></table>";


var tempShowDate;
var width=1000;
var height=200;
var timer;
var tooltip="";
 var tempX;
 var tempY;
// Set Netscape up to run the "captureMousePosition" function whenever
// the mouse is moved. For Internet Explorer and Netscape 6, you can capture
// the movement a little easier.
if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.documentElement.scrollLeft;
        yMousePos = window.event.y+document.documentElement.scrollTop;
        xMousePosMax = document.body.clientWidth+document.documentElement.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.documentElement.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}

var xmlHttpCommingSoon
var xmlHttNowShowing

function GetXmlHttpObject()
{ 
    var objXMLHttp=null
    if (window.XMLHttpRequest)
    {
         objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
   
    return objXMLHttp
}
function GetNowShowing()
{
    document.getElementById("divNowShowing").innerHTML = "<font color='#FFFFFF'><H3>Loading...</H3></font>"; 
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()        
    var temp = month + "-" + day + "-" + year + "-" + hours + "-" + minutes + "-" + seconds;  
    xmlHttNowShowing=GetXmlHttpObject()
    if (xmlHttNowShowing==null)
    {
        alert ("Browser does not support HTTP Request")
        return
    }
    var url="Services/ITZService.asmx/GetNowShowing?rand="+temp; 
    xmlHttNowShowing.onreadystatechange=GetNowShowing_CallBack
    xmlHttNowShowing.open("GET",url,true)
    xmlHttNowShowing.send(null) 
}
function GetNowShowing_CallBack()
{              
if (xmlHttNowShowing.readyState==4 || xmlHttNowShowing.readyState=="complete")
    	    {	
		        if (xmlHttNowShowing.status == 200)      
		        {       
                    var str = new String(xmlHttNowShowing.responseText);
                    str= str.replace(/&gt;/g,'>');
                    str= str.replace(/&lt;/g,'<');
                    str= str.replace(/&amp;/g,'&');
                    document.getElementById("divNowShowing").innerHTML =str;
                }
            }
} 
function GetCommingSoon()
{
    document.getElementById("divCommingSoon").innerHTML = "<font color='#FFFFFF'><H3>Loading...</H3></font>"; 
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()        
    var temp = month + "-" + day + "-" + year + "-" + hours + "-" + minutes + "-" + seconds;  
    xmlHttpCommingSoon=GetXmlHttpObject()
    if (xmlHttpCommingSoon==null)
    {
        alert ("Browser does not support HTTP Request")
        return
    }
    var url="Services/ITZService.asmx/GetCommingSoonPage?PageNumber=0&rand="+temp; 
    xmlHttpCommingSoon.onreadystatechange=GetCommingSoon_CallBack
    xmlHttpCommingSoon.open("GET",url,true)
    xmlHttpCommingSoon.send(null) 
}

    
function GetCommingSoon_CallBack()
{              
if (xmlHttpCommingSoon.readyState==4 || xmlHttpCommingSoon.readyState=="complete")
    	    {	
		        if (xmlHttpCommingSoon.status == 200)      
		        {       
                    var str = new String(xmlHttpCommingSoon.responseText);
                    str= str.replace(/&gt;/g,'>');
                    str= str.replace(/&lt;/g,'<');
                    str= str.replace(/&amp;/g,'&');
                    document.getElementById("divCommingSoon").innerHTML =str;
                }
            }
} 

function viewMoreDetails(ITZMovieCode,e)
{

 var ntipobj = document.getElementById( "ViewToolTip" ); 
 	    ntipobj.innerHTML=ttoltiploading;
	    ntipobj.style.visibility="visible";
       tempX = e.clientX + document.documentElement.scrollLeft;
       tempY = e.clientY + document.documentElement.scrollTop;
        ntipobj.style.left = (tempX) + "px";
        ntipobj.style.top = tempY + "px" 	    
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()        
    var temp = month + "-" + day + "-" + year + "-" + hours + "-" + minutes + "-" + seconds;  
    xmlHttpCommingSoon=GetXmlHttpObject()
    if (xmlHttpCommingSoon==null)
    {
        alert ("Browser does not support HTTP Request")
        return
    }
    var url="Services/ITZService.asmx/viewMoreDetails?ITZMovieCode="+ITZMovieCode+"&rand="+temp; 
    xmlHttpCommingSoon.onreadystatechange=viewMoreDetails_CallBack
    xmlHttpCommingSoon.open("GET",url,true)
    xmlHttpCommingSoon.send(null) 
}    
function viewMoreDetails_CallBack()
{              
if (xmlHttpCommingSoon.readyState==4 || xmlHttpCommingSoon.readyState=="complete")
    	    {	
		        if (xmlHttpCommingSoon.status == 200)      
		        {       
                    var str = new String(xmlHttpCommingSoon.responseText);
                    str= str.replace(/&gt;/g,'>');
                    str= str.replace(/&lt;/g,'<');
                    str= str.replace(/&amp;/g,'&');
                    tooltip=tooltipup+str+tooltipdown
                    ntipobj = document.getElementById( "ViewToolTip" );
                    ntipobj.innerHTML = tooltip;                    
                }
            }
} 

function hideViewTip() {
       
	    ntipobj = document.getElementById( "ViewToolTip" );
	    ntipobj.style.visibility="hidden";
}

function AjaxCaller(PageNum)
    {
        document.getElementById("divCommingSoon").innerHTML = "<font color='#FFFFFF'><H3>Loading...</H3></font>"; 
        var currentTime = new Date()
        var month = currentTime.getMonth() + 1
        var day = currentTime.getDate()
        var year = currentTime.getFullYear()
        var hours = currentTime.getHours()
        var minutes = currentTime.getMinutes()
        var seconds = currentTime.getSeconds()        
        var temp = month + "-" + day + "-" + year + "-" + hours + "-" + minutes + "-" + seconds;  
        xmlHttpCommingSoon=GetXmlHttpObject()
        if (xmlHttpCommingSoon==null)
        {
            alert ("Browser does not support HTTP Request")
            return
        }
        var url="Services/ITZService.asmx/GetCommingSoonPage?PageNumber="+PageNum+"&rand="+temp; 
        xmlHttpCommingSoon.onreadystatechange=AjaxCaller_CallBack
        xmlHttpCommingSoon.open("GET",url,true)
        xmlHttpCommingSoon.send(null) 
     }
     
   function AjaxCaller_CallBack()
    {
        if (xmlHttpCommingSoon.readyState==4 || xmlHttpCommingSoon.readyState=="complete")
    	    {	
		        if (xmlHttpCommingSoon.status == 200)      
		        {       
                    var str = new String(xmlHttpCommingSoon.responseText);
                    str= str.replace(/&gt;/g,'>');
                    str= str.replace(/&lt;/g,'<');
                    str= str.replace(/&amp;/g,'&');
                    document.getElementById("divCommingSoon").innerHTML =str;                 
                }
            }	
    }

 function GetMovieDetails(ITZMovieCode)
 {
    xmlHttpCommingSoon=GetXmlHttpObject()
    if (xmlHttpCommingSoon==null)
    {
        alert ("Browser does not support HTTP Request")
        return
    }
    var url="AjaxUtility/AjaxMaster.aspx?MovieSynCode="+ITZMovieCode+"&isSession=0"; 
    xmlHttpCommingSoon.onreadystatechange=GetMovieDetails_CallBack
    xmlHttpCommingSoon.open("GET",url,true)
    xmlHttpCommingSoon.send(null) 
    //location.href = "MovieSynopsis.aspx?ITZMovieCode="+ITZMovieCode;
 }
 function GetMovieDetails_CallBack()
 {
     if (xmlHttpCommingSoon.readyState==4 || xmlHttpCommingSoon.readyState=="complete")
    	    {	
		        if (xmlHttpCommingSoon.status == 200)      
		        {       
	                var str;
			        str = xmlHttpCommingSoon.responseText;
			        if(str == "0")
			        {
			            location.href="MovieSynopsis.aspx";
			        }
                }
             }
 }