﻿// JScript File
function PaidBookingCallFromSchedule(StringPath)
        {
                xmlHttpLogin=GetXmlHttpObject()
                if (xmlHttpLogin==null)
                {
                    alert ("Browser does not support HTTP Request")
                    return
                }
                //window.parent.CheckLogin();

                LocationPath =StringPath;
                var currentTime = new Date()     
                var temp = (currentTime.getMonth() + 1) + "-" + currentTime.getDate() + "-" + currentTime.getFullYear() + "-" + currentTime.getHours() + "-" + currentTime.getMinutes() + "-" + currentTime.getSeconds();    
                var url="Service/WebService.asmx/CancelTransaction?&temp="+temp;

                //document.getElementById('divSuccess').innerHTML = 'Loading....';

                xmlHttpLogin.onreadystatechange=PaidBookingCallFromSchedule_CallBack
                xmlHttpLogin.open("GET",url,true)
                xmlHttpLogin.send(null)
        }

        function PaidBookingCallFromSchedule_CallBack()
        {
                if (xmlHttpLogin.readyState==4 || xmlHttpLogin.readyState=="complete")
                {	
                    if (xmlHttpLogin.status == 200)      
                    { 
                        window.parent.GetLoginStatus();
                        if(IsLogin == 0)
                        {
                            window.parent.location.href = LocationPath;
                        }
                        else
                        {
                            window.scrollTo("0px","0px");
                            LoadLoginDialog(1,LocationPath);
                            ShowImagePopUp();
                            LightenPage=1;
                        }

                    }
                }
        }
        function showSynopsis(MovieCode,CenterCode)
        {
            window.parent.location.href="MovieSynopsis.aspx?Movie="+MovieCode+"&CenterCode="+CenterCode;
        }
        
        
        
    function ShowImagePopUp()
    {
        
        ImageDarkenPage();
        ShowImagePopUpPanel();
        //setTimeout("ClearGenCRMPopUp()",25000) 
       
    }

    function ClearImageCRMPopUp()
    {
        var div_temp = document.getElementById('divBookingBox');
        div_temp.style.display = 'none';
        ImageLightenPage();
    }


    function ShowImagePopUpPanel()
    {
        var div_temp = document.getElementById('divBookingBox');
        div_temp.style.display = 'block';
       
    }


    function ImageDarkenPage()
    {
       var div_temp = document.getElementById('div_Centerscreen');
       if(div_temp == null)
       {
            div_temp = document.getElementById('div_CommScreen');
       } 
       div_temp.style.height = (document.body.scrollHeight )+ 'px';//document.body.parentNode.scrollHeight + 'px';
       div_temp.style.display = 'block';
    }

    // this function removes the dark screen and the page is light again
    function ImageLightenPage()
    {
        var div_temp = document.getElementById('div_Centerscreen');
        if(div_temp == null)
        {
            div_temp = document.getElementById('div_CommScreen');
        } 
        div_temp.style.display = 'none';
    }


