blnSetCookie("strMode", strGetQueryVariable("strMode"), false);
//var strDataURL = "http://www.bookmyshow.com/Services/getJSData.aspx?";
var strDataURL = "Services/getJSData.aspx?";
var objBody = document.getElementsByTagName("body").item(0);
var strImageUrl = "/Common/Images/";
var arrEvents = new Array();
var arrSubRegionEvents = new Array();
var arrRegions = new Array();
var arrSubRegions = new Array();
var arrTopMovies = new Array();
var arrLanguages = new Array();
var arrEventTypes = new Array();
var arrVenues = new Array();
var arrSubRegionVenues = new Array();
var arrShowDates = new Array();
var strSearchCriteria = "EVENT";
var strDateString = "";
var strEventType = "MT";
var blnIsPaymentPage;
var arrTabs = new Array();
arrTabs[0] = new Array('MT', 'Movies');
arrTabs[1] = new Array('PL', 'Plays');
arrTabs[2] = new Array('ET', 'Events');
//arrTabs[2] = new Array('SP', 'Sports');
//arrTabs[3] = new Array('ET', 'Events');
//arrTabs[4] = new Array('CF', 'Conferences');
var arrCategories = new Array();
arrCategories[0] = new Array('MT', 'LR', '&nbsp;&nbsp;Latest Releases');
arrCategories[1] = new Array('MT', 'NS', '&nbsp;&nbsp;Now Showing');
arrCategories[2] = new Array('MT', 'CS', '&nbsp;&nbsp;Coming Soon');
arrCategories[3] = new Array('PL', 'NS', '&nbsp;&nbsp;Now Showing');
arrCategories[4] = new Array('PL', 'CS', '&nbsp;&nbsp;Coming Soon');
var arrErrorCodes = new Array();
arrErrorCodes[0] = "There seems to be a technical problem Tip: Please try again later";
arrErrorCodes[1] = "Wakey Wakey! Please enter the correct WinPin!!! Tip: If you are facing problems with your WinPin write to us on helpdesk@bookmyshow.co.nz";
arrErrorCodes[2] = "Better luck next time! Your WinPin is not valid for today !!! Tip: If you are facing problems with your WinPin write to us on helpdesk@bookmyshow.co.nz";
arrErrorCodes[3] = "OOPS! Technical Error. Tip: Please try again later";
arrErrorCodes[4] = "OOPS! Due to an unexpected technical error your card has been charged but your booking could not be completed.Be assured your money would be refunded. We regret the inconvinience caused.";
arrErrorCodes[5] = "Population Explosion! Show is already booked. Tip: Please try booking for another show.";
arrErrorCodes[6] = "Population Explosion! Seats are not available together. Tip: The show seems very popular, please try another show.";
arrErrorCodes[7] = "Grrrrr ! Technical Error. Tip: You may want to try again after sometime or try to book another show.";
arrErrorCodes[8] = "Oops! Missed the bus! Its too close to the showtime. Tip: We stop bookings an hour before the showtime.";
arrErrorCodes[9] = "Sorry! The theatre reserves the right of sale of the tickets. Tip: Please try booking for another show.";
arrErrorCodes[10] = "OOPS! The server just went down. Tip: We are working on it, please try again after sometime.";
arrErrorCodes[11] = "Sorry! Invalid WinPin for current price category. Tip: Try another price category.";
arrErrorCodes[12] = "Oops! Payment failed. Tip: Try another card.";
arrErrorCodes[13] = "Invalid UserName or Password. Tip: Enter the correct UserName / Password; Or click on \"Forgot Password\".";
arrErrorCodes[14] = "Invalid Password. Tip: Enter the correct UserName / Password; Or click on \"Forgot Password\".";
arrErrorCodes[15] = "Please enter a new password";
arrErrorCodes[16] = "Offer NOT valid for this day. Please try again later. Tip: Please check the offer date.";
arrErrorCodes[17] = "All good things come to an end. Offer has reached its limit for the day. Tip: Try again on another date, make sure your early";
arrErrorCodes[18] = "Sorry, Offer is Not valid for this price category. Tip:  Please try another price category.";
arrErrorCodes[19] = "Sorry, Offer is valid for the first transaction only. Tip: Please read the disclaimer.";
arrErrorCodes[20] = "Wakey Wakey! Please enter the correct Gift Voucher Code!!! Tip: Your code seems to be incorrect.";
arrErrorCodes[21] = "Oops! Insufficient Gift Voucher balance; Tip: You can pay the balance by your credit card.";
arrErrorCodes[22] = "Your WinPin has already been used!!! Please try another WinPin";
arrErrorCodes[23] = "Oops! This Email Id has already <br/> been registered.<br/> Please use another Email Id";
subDisableRightClick();
subUpdateSignInSection();

function blnIsSubRegionInRegion(strSubRegionCode, strRegionCode)
{
    try
    {
        for(var intCount = 0; intCount < arrSubRegions.length; intCount++) {
            if(arrSubRegions[intCount][1].toUpperCase() == strSubRegionCode.toUpperCase() && arrSubRegions[intCount][0].toUpperCase() == strRegionCode.toUpperCase()) {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "blnIsSubRegionInRegion('" + strSubRegionCode + "', '" + strRegionCode + "')", e);
    }
    return false;
}

function blnIsEventInSubRegion(strSubRegionCode, strEventCode)
{
    try
    {
        for(var intCount = 0; intCount < arrSubRegionEvents.length; intCount++) {
            if(arrSubRegionEvents[intCount][0].toUpperCase() == strSubRegionCode.toUpperCase() && arrSubRegionEvents[intCount][1].toUpperCase() == strEventCode.toUpperCase()) {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "blnIsEventInSubRegion('" + strSubRegionCode + "', '" + strEventCode + "')", e);
    }
    return false;
}

function blnIsVenueInSubRegion(strVenueCode, strSubRegionCode)
{
    try
    {
        for(var intCount = 0; intCount < arrSubRegionVenues.length; intCount++) {
            if(arrSubRegionVenues[intCount][0].toUpperCase() == strSubRegionCode.toUpperCase() && arrSubRegionVenues[intCount][1].toUpperCase() == strVenueCode.toUpperCase()) {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "blnIsVenueInSubRegion('" + strSubRegionCode + "', '" + strVenueCode + "')", e);
    }
    return false;
}

function blnIsSubRegionInCompany()
{
    
}

function blnIsEventInCompany(strEventCode, strCompanyCode, strMovieStatus)
{
    try {
        if(strCompanyCode.length == 0) {
            return true;
        }
        if(strMovieStatus == "CS") {
            return true;
        }
        for(var intCount = 0; intCount < arrVenueEvent.length; intCount++) {
            if(arrVenueEvent[intCount][3].toUpperCase() == strMovieCode.toUpperCase() && arrVenueEvent[intCount][0].toUpperCase() == strCompanyCode.toUpperCase()) {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("InstantBookingCode.js", "blnIsMovieInCompany('" + strCompanyCode + "', '" + strCinemaCode + "', '" + strMovieStatus + "')", e);
    }
    return false;
}

function blnIsVenueInCompany(strVenueCode, strCompanyCode)
{
    try {
        if(strCompanyCode.length == 0) {
            return true;
        }
        for(var intCount = 0; intCount < arrVenues.length; intCount++) {
            if(arrVenues[intCount][0].toUpperCase() == strVenueCode.toUpperCase() && arrVenues[intCount][1].toUpperCase() == strCompanyCode.toUpperCase()) {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("InstantBookingCode.js", "blnIsVenueInCompany('" + strVenueCode + "', '" + strCompanyCode + "')", e);
    }
    return false;
}

function strGetEventName(strEventCode, intLength)
{
    try
    {        
        for(var intCount = 0; intCount < arrEvents.length; intCount++)
        {
            if(arrEvents[intCount][1] == strEventCode) {
            var strEventName = arrEvents[intCount][4];
            //blnSetCookie("strEventName", strEventName, false);
            var intEventNameLength = strEventName.length;
            if(intLength > 0){                
                return strEventName.substring(0, intLength) + (intLength < intEventNameLength ? "..." : "");
                }
                else {
                    return strEventName;
                }
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetEventName('" + strEventCode + "')", e);
    }
    return "";
}

function blnIsEventInCategory(strEventCode, strCategory)
{
    try
    {        
        for(var intCount = 0; intCount < arrEvents.length; intCount++)
        {
            if(arrEvents[intCount][1] == strEventCode && arrEvents[intCount][0].toUpperCase() == strCategory.toUpperCase())
            {
                return true;
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "blnIsEventInCategory('" + strEventCode + "', '" + strCategory + "')", e);
    }
    return false;
}

function strGetVenueName(strVenueCode, intLength)
{
     try {        
        for(var intCount = 0; intCount < arrVenues.length; intCount++) {
            if(arrVenues[intCount][0] == strVenueCode) {
            var strVenueName = arrVenues[intCount][2];
            //blnSetCookie("strVenueName", strVenueName, false);
            var intVenueNameLength = strVenueName.length;
            if(intLength > 0){                
                return strVenueName.substring(0, intLength) + (intLength < intVenueNameLength ? "..." : "");
                }
                else {
                    return strVenueName;
                }
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetEventName('" + strEventCode + "')", e);
    }
    return "";
}

function strGetSubRegionName(strSubRegionCode)
{
    try {        
        for(var intCount = 0; intCount < arrSubRegions.length; intCount++) {
            if(arrSubRegions[intCount][1] == strSubRegionCode) {
                //blnSetCookie("strSubRegionName", arrSubRegions[intCount][2], false)
                return arrSubRegions[intCount][2];
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetSubRegionName('" + strSubRegionCode + "')", e);
    }
    return "";
}

function strGetShowDate(strDate)
{
    try {        
        for(var intCount = 0; intCount < arrShowDates.length; intCount++) {
            if(arrShowDates[intCount][3] == strDate) {
                blnSetCookie("strDisplayDate", arrShowDates[intCount][4], false)
                return arrShowDates[intCount][4];
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetShowDate('" + strDate + "')", e);
    }
    return "";
}

function subAddToArray(strArrayName, strArrayData)
{
    try
    {
        var strEval = strArrayName + "[" + eval(strArrayName + ".length") + "] = " + strArrayData + ";";
    
        eval(strEval);
    } catch(e) {
        subDisplayError("MiscCode.js", "subAddToArray('" + strArrayName + "', '" + strArrayData + "')", e);
    }
}

function subShowMessage(intError, strMessage, strImage)
{
    try {
        var intX = 0;
        var intY = 0;        
        
        if(document.body.scrollTop > 0)
        {
            intY = document.body.scrollTop;
        }
        else
        {
            intY = document.documentElement.scrollTop;
        }
        
        var objDivStatus = document.getElementById("divStatus");
        var objTblStatus = document.getElementById("tblStatus");
        var objTblError = document.getElementById("tblError");
        var objTblLoading = document.getElementById("tblLoading");
        
        if((objDivStatus) && (objTblStatus) && (objTblError)) {
            objTblLoading.style.display="none";
            objDivStatus.style.display="block";
            objTblError.style.display="inline";
            if(intError == 12)
            {
                var objaHideMessage = document.getElementById("aHideMessage");
                if(objaHideMessage)
                {
                    objaHideMessage.href = "javascript:subHideMessage();subGoToURL('/Home.aspx')";
                }
            }
            if(intY > 0)
            {
                objDivStatus.style.top = objDivStatus.offsetParent.offsetTop + intY + "px";
            }
            if(strImage)
            {
                if(objTblError.childNodes.length == 1)
                {
                    objTblError.childNodes[0].style.backgroundImage = 'url(Common/Images/' + strImage + '.gif)';
                }
                else
                {
                    objTblError.childNodes[1].style.backgroundImage = 'url(Common/Images/' + strImage + '.gif)';
                }
            }
            else
            {
                if(objTblError.childNodes.length == 1)
                {
                    objTblError.childNodes[0].style.backgroundImage = 'url(Common/Images/ErrorBg3.gif)';
                }
                else
                {
                    objTblError.childNodes[1].style.backgroundImage = 'url(Common/Images/ErrorBg3.gif)';
                }
            }
            var objtdMessage = document.getElementById("tdMessage");
            objtdMessage.innerHTML = strMessage;
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "subShowMessage();", e);
    }
}

function subHideMessage()
{
    try {        
        var objDivStatus = document.getElementById("divStatus");
        var objTblStatus = document.getElementById("tblStatus");
        var objTblError = document.getElementById("tblError");
        var objTblLoading = document.getElementById("tblLoading");
        
        if((objDivStatus) && (objTblStatus) && (objTblError)) {
            objTblLoading.style.display="none";
            objDivStatus.style.display="none";
            objTblError.style.display="none";
            var objtdMessage = document.getElementById("tdMessage");
            objtdMessage.innerHTML = "";
        }
        
        //subEnableSchedule("");
    } catch(e) {
        subDisplayError("MiscCode.js", "subShowMessage();", e);
    }
}

function subDisplayBookingInfo(strBookingId, strSeatInfo, curTicketsAmt, curFoodAmt, curBookingFee, curDiscountAmt, curTotalAmt)
{
    try
    {
        var objtblSummary = document.getElementById("tblSummary");
        var objtdSummaryTotal = document.getElementById("tdSummaryTotal");
        var objtdSummaryTotalEx = document.getElementById("tdSummaryTotalEx");
        var objspnSummaryTitleName = document.getElementById("spnSummaryTitleName");
        var objspnSummaryTitle = document.getElementById("spnSummaryTitle");
        var objspnSeatInfo = document.getElementById("spnSeatInfo");
        var objspnClass = document.getElementById("spnClass");
        var tblSeatLayout = document.getElementById("tblSeatLayout");
        var objaSeatLayout = document.getElementById("aSeatLayout");
        var strDisplay = "";
        objtblSummary.style.display = "inline";
        tblSeatLayout.style.display = "none";
        
        if(strBrowserType == "ie")
        {
            strDisplay = "inline";
        }
        else
        {
            strDisplay = "table-cell";
        }
        objtdSummaryTotal.style.display = strDisplay;
        objtdSummaryTotalEx.style.display = strDisplay;
        objspnSummaryTitleName.style.display = strDisplay;
        objspnSummaryTitle.style.display = strDisplay;
        objaSeatLayout.style.display = strDisplay;
        if(blnShowSeatLayout == true)
        {
            objspnSeatInfo.style.display = strDisplay;
            objspnClass.style.display = strDisplay;
            objspnSeatInfo.innerHTML = strSeatInfo;
        }
        
        objtdSummaryTotal.innerHTML = "Total: Rs." + curTotalAmt;
        objtdSummaryTotalEx.innerHTML = "(Rs." + curTicketsAmt + " + Rs." + curBookingFee + " Convenience Charge)<br/>";        
        objtdSummaryTotalEx.innerHTML += " - (Rs. " + curDiscountAmt + " Discount)"
        //if(strGetCookie("strCriteria", "") == "EVENT")
        if(strGetCookie("strSearchCriteria", "") == "EVENT")
        {
            objspnSummaryTitleName.innerHTML = "Cinema:";
            objspnSummaryTitle.innerHTML = strGetVenueName(strSelectedVenueCode, 0)
        }
        //else if(strGetCookie("strCriteria", "") == "VENUE")
        else if(strGetCookie("strSearchCriteria", "") == "VENUE")
        {
            objspnSummaryTitleName.innerHTML = "Movie:";
            objspnSummaryTitle.innerHTML = strGetEventName(strSelectedEventCode, 0)
        }
        
    } catch(e) {
        subDisplayError("MiscCode.js", "subDisplayBookingInfo('" + strBookingId + "', '" + strSeatInfo + "', '" + curTicketsAmt + "', '" + curFoodAmt + "', '" + curBookingFee  + "', '" + curDiscountAmt + "', '" + curTotalAmt + "');", e);
    }
}

function strReplace(strData, strFindString, strReplaceString)
{
    try
    {
        while(strData.search(strFindString) > 0)
        {
            strData = strData.replace(strFindString, strReplaceString)
        }
        
        return strData;
    } catch(e) {
        subDisplayError("MiscCode.js", "strReplace('" + strData + "', '" + strFindString + "', '" + strReplaceString + "');", e);
    }
    return strData;
}

function strGetQueryVariable(strName)
{
    try
    {
        var strQuery = window.location.search.substring(1);
        var arrValues = strQuery.split("&");
        for (var intCount = 0; intCount < arrValues.length; intCount++) 
        {
            var arrPair = arrValues[intCount].split("=");
            if (arrPair[0] == strName) 
            {
                return arrPair[1];
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetQueryVariable('" + strName + "')", e);
    }
    return "";
}

function subSelectTabs(strCategory, blnGoToHome, blnChangeImageOnly)
{
    try
    {
        if(strCategory == "CT")
        {
            strCategory = "ET";
        } 
        for(var intTabCount = 0;intTabCount < arrTabs.length;intTabCount++)
        {
            var objImg = document.getElementById("tab_" + arrTabs[intTabCount][0]);            
            
            if(objImg)
            {
                if(arrTabs[intTabCount][0] == strCategory)
                {
                    objImg.src = strImageUrl + "tabover_" + arrTabs[intTabCount][0] + ".jpg";                
                    objImg.style.visibility = "visible";
                    //blnRollOver == false ? strEventType = arrTabs[intTabCount][0] : strEventType = strEventType;
                }
                else
                {
                    objImg.src = strImageUrl + "tab_" + arrTabs[intTabCount][0] + ".jpg";
                }
            }
        }
        
        if(blnChangeImageOnly != true)
        {
            if(blnGoToHome == true)
            {
                if(strGetCookie("BOOKINGID", "") != "")
                {
                    subCancelTransEx();
                }
                if(strCategory.toUpperCase() == "ET")
                {
                    subGoToURL("Concerts.aspx");
                }
                else
                {
                    subGoToURL("Home.aspx?strEventType=" + strCategory)
                }
            }
            if(strCategory == strEventType) {
                return;
            }
                    
            if(strCategory.toUpperCase() == "PL" && blnGoToHome != true)
            {                
                strEventType = "PL";
                subRenewArrays();
                subChangeSearch();
                subGetDataAndExecute("HOMEPAGEDATA", "Data/GetHomeData_PL.js?" + strTimeStamp(), "subFetchEvents('PL')", true);
            }
            
            if(strCategory.toUpperCase() == "MT" && blnGoToHome != true)
            {
                strEventType = "MT";
                subRenewArrays();
                subChangeSearch();
                subGetDataAndExecute("HOMEPAGEDATA", "Data/GetHomeData.js?" + strTimeStamp(), "subFetchEvents('MT')", true);
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "subSelectTabs('" + strCategory + "', '" + blnGoToHome + "')", e);
    }
}

function subCreateSignInSection(e, blnChangePassword)
{
    try
    {
        var objtblSignIn = document.getElementById("tblSignIn");
        if(objtblSignIn)
        {
            var objtxtPassword = document.getElementById("txtPassword");
            var objtxtNewPassword = document.getElementById("txtNewPassword");
            var objaForgotPassword = document.getElementById("aForgotPassword");
            var objaSignIn = document.getElementById("aSignIn");
            var objaChangePassword = document.getElementById("aChangePassword");
            var objtrOldPassword = document.getElementById("trOldPassword");
            var objtrNewPassword = document.getElementById("trNewPassword");
            var objtrSignIn = document.getElementById("trSignIn");
            var objtrLoginid = document.getElementById("trLoginId");
            
            objtxtPassword.value = "";
            objtxtNewPassword.value = "";
            
            if(blnChangePassword == true)
            {
                if(strBrowserType == "ie")
                {
                    objtxtNewPassword.style.display = "inline";
                    objaForgotPassword.style.display = "none";
                    objaSignIn.style.display = "none";
                    objaChangePassword.style.display = "inline";
                    objtrOldPassword.style.display = "inline";
                    objtrNewPassword.style.display = "inline";
                    objtrSignIn.style.display = "none";
                    objtrLoginid.style.display = "inline";
                }
                else
                {
                    objtxtNewPassword.style.display = "inline";
                    objaForgotPassword.style.display = "none";
                    objaSignIn.style.display = "none";
                    objaChangePassword.style.display = "inline";
                    objtrOldPassword.style.display = "table-row";
                    objtrNewPassword.style.display = "table-row";
                    objtrSignIn.style.display = "none";
                    objtrLoginid.style.display = "table-row";
                }
            }
            else
            {
                if(strBrowserType == "ie")
                {
                    objtxtPassword.value = "";
                    objtxtNewPassword.value = "";
                    objtxtNewPassword.style.display = "none";
                    objaForgotPassword.style.display = "inline";
                    objaSignIn.style.display = "inline";
                    objaChangePassword.style.display = "none";
                    objtrOldPassword.style.display = "none";
                    objtrNewPassword.style.display = "none";
                    objtrSignIn.style.display = "inline";
                    objtrLoginid.style.display = "none";
                }
                else
                {
                    objtxtPassword.value = "";
                    objtxtNewPassword.value = "";
                    objtxtNewPassword.style.display = "none";
                    objaForgotPassword.style.display = "inline";
                    objaSignIn.style.display = "inline";
                    objaChangePassword.style.display = "none";
                    objtrOldPassword.style.display = "none";
                    objtrNewPassword.style.display = "none";
                    objtrSignIn.style.display = "table-row";
                    objtrLoginid.style.display = "none";
                }
            }
            objtblSignIn.style.display = "block";
            if(window.event)
            {
                intClientX = window.event.clientX - 120;
                intClientY = window.event.clientY + document.body.scrollTop + 2;
            }
            else if(e)
            {
                intClientX = e.clientX - 120;
                intClientY = (e.clientY + document.documentElement.scrollTop + 2);
            }
            
            objtblSignIn.style.left = intClientX + "px";
            objtblSignIn.style.top = intClientY + "px";
            return;
        }
        var objTable = document.createElement("table");
        objTable.id = "tblSignIn";
        var objTbody = document.createElement("tbody");
        var objTR = document.createElement("tr");
        var objTD = document.createElement("td");
        var intClientX = 0;
        var intClientY = 0;
        
        if(window.event)
        {
            intClientX = window.event.clientX - 100;
            intClientY = window.event.clientY + document.body.scrollTop + 2;
        }
        else if(e)
        {
            intClientX = e.clientX - 100;
            intClientY = (e.clientY + document.documentElement.scrollTop + 2);
        }
        
        objTable.setAttribute("border", "0");
        objTable.setAttribute("cellSpacing", "0");
        objTable.setAttribute("cellPadding", "0");
        objTable.style.width = "220px";
        objTable.style.position = "absolute";
        objTable.style.zIndex = "1";
        
        objTD.style.verticalAlign = "bottom";
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<img src=\"Common/Images/callout_top_left.gif\" alt=\"\" />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.style.verticalAlign = "bottom";
        objTD.colSpan = "2";
        objTD.className = "cssCallOutBorderT";
        objTD.style.textAlign = "center";
        objTD.style.width = "90%";
        objTD.innerHTML = "<img src=\"Common/Images/callout_top.gif\" alt=\"\" />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.style.verticalAlign = "bottom";
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<img src=\"Common/Images/callout_top_right.gif\" alt=\"\" />";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        objTR.id = "trSignIn";
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<span class=\"cssFontB\">Sign In</span>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "right";
        objTD.innerHTML = "<img src=\"Common/Images/p3_r4_c7.gif\" onmouseover=\"javascript:subSetCursor(this,'hand')\" onclick=\"javascript:subHideCallOut('tblSignIn')\" alt=\"\"/>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        objTR.id = "trLoginId";
        objTR.style.display = "none";
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";
        objTD.style.textAlign = "left";
        objTD.innerHTML = "";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "right";
        objTD.innerHTML = "<img src=\"Common/Images/p3_r4_c7.gif\" onmouseover=\"javascript:subSetCursor(this,'hand')\" onclick=\"javascript:subHideCallOut('tblSignIn')\" alt=\"\"/>&nbsp;&nbsp;&nbsp;";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTR = document.createElement("tr");
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<span class=\"cssFontBGray\">User Id</span>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "right";
        //objTD.innerHTML = "<input id=\"txtUserName\" type=\"text\" style=\"text-align:left;\" class=\"cssTextBox\" value ='" + strGetCookie("strLastLogin", "") + "' size=\"30\" />";
        objTD.innerHTML = "<input id=\"txtUserName\" type=\"text\" style=\"text-align:left;width:170px;\" class=\"cssTextBox\" value ='" + strGetCookie("strLogin", "") + "' />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        objTR.id = "trOldPassword";
        objTR.style.display = "none";
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.colSpan = "2";
        objTD.innerHTML = "";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.colSpan = "2";
        objTD.style.height = "3px";
        objTD.innerHTML = "";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");        
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<span class=\"cssFontBGray\">Password</span>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "right";
        objTD.style.paddingLeft = "2px";
        objTD.innerHTML = "<input id=\"txtPassword\" type=\"password\" style=\"text-align:left;width:170px;\" class=\"cssTextBox\" value =\"\" onkeypress=\"javascript:subLoginKeyPress(event);\" />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        objTR.style.display = "none";
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.colSpan = "2";
        objTD.innerHTML = "";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        objTR.id = "trNewPassword";
        objTR.style.display = "none";
                
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<span class=\"cssFontBGray\">New Password</span>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "right";
        objTD.style.paddingLeft = "2px";
        objTD.innerHTML = "<input id=\"txtNewPassword\" type=\"password\" style=\"text-align:left;display:none;width:170px;\" class=\"cssTextBox\" value =\"\" onkeypress=\"javascript:subChangePasswordKeyPress(event);\" />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderL";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOut";    
        objTD.style.textAlign = "center";
        objTD.colSpan = "2";
        objTD.innerHTML = "<a id=\"aForgotPassword\" href=\"javascript:subForgotPassword();\" class=\"cssHrefBlue\">Forgot Password</a>";
        objTD.innerHTML += "&nbsp;&nbsp;<a id=\"aSignIn\" href=\"javascript:subSignIn();\"><img src=\"Common/Images/sub_butt.jpg\" alt=\"\" style=\"border-style:none;vertical-align:middle\" /></a>";
        objTD.innerHTML += "<a id=\"aChangePassword\" href=\"javascript:subChangePassword();\" style=\"display:none;\"><img src=\"Common/Images/sub_butt.jpg\" alt=\"\" style=\"border-style:none;vertical-align:middle;\" /></a>";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.className = "cssCallOutBorderR";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTR = document.createElement("tr");
        
        objTD = document.createElement("td");
        objTD.style.verticalAlign = "bottom";
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<img src=\"Common/Images/callout_bottom_left.gif\" alt=\"\" />";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.style.verticalAlign = "bottom";
        objTD.colSpan = "2";
        objTD.className = "cssCallOutBorderB";
        objTD.style.textAlign = "center";
        objTD.style.width = "90%";
        objTR.appendChild(objTD);
        
        objTD = document.createElement("td");
        objTD.style.verticalAlign = "bottom";
        objTD.style.textAlign = "left";
        objTD.innerHTML = "<img src=\"Common/Images/callout_bottom_right.gif\" alt=\"\" />";
        objTR.appendChild(objTD);
        
        objTbody.appendChild(objTR);
        
        objTable.appendChild(objTbody);
        
        objTable.style.left = intClientX + "px";
        objTable.style.top = intClientY + "px";
        
        objBody.appendChild(objTable);
    } catch(e) {
        subDisplayError("MiscCode.js", "subAddToArray('" + blnChangePassword + "')", e);
    }
}

function subSignIn()
{
    try
    {
        var strUserName = document.getElementById("txtUserName").value
        var strPassword = document.getElementById("txtPassword").value
        if(strUserName == "")
        {
            subShowError(0, "Please enter a valid Email Address!!!");
            return;
        }
        if(strPassword == "")
        {
            subShowError(0, "Please enter your Password!!!");
            return;
        }
        subGetDataAndExecuteEx("WEB", "", 0, "AUTHENTICATEMEMBER", strUserName, strPassword, "", "", "", "", "", "", "", "", "", "blnAuthenticateUser")
    } catch(e) {
        subDisplayError("MiscCode.js", "subSignIn()", e);
    }
}

function subSignOut()
{
    try
    {
        blnSetCookie("strLoginData", "", false);
        if(document.getElementById("txtUserName"))
        {
            //document.getElementById("txtUserName").value = strGetCookie("strLastLogin", "");
            document.getElementById("txtUserName").value = strGetCookie("strLogin", "");
            document.getElementById("txtPassword").value = "";
        }
        subUpdateSignInSection();
    } catch(e) {
        subDisplayError("MiscCode.js", "subSignOut()", e);
    }
}

function subForgotPassword()
{
    subGetDataAndExecuteEx("WEB", "", 0, "FORGOTMEMBERPASSWORD", document.getElementById("txtUserName").value, "MAIL", "", "", "", "", "", "", "", "", "", "")
    subShowMessage(0, "Password Sent via Email");
}

function subChangePassword()
{
    subGetDataAndExecuteEx("WEB", "", 0, "SETMEMBERPASSWORD", document.getElementById("txtUserName").value, document.getElementById("txtPassword").value, document.getElementById("txtNewPassword").value, "", "", "", "", "", "", "", "", "subChangePasswordSuccess")    
}

function subChangePasswordSuccess(strData)
{
    subShowMessage(0, "Password changed successfully");
    subHideCallOut('tblSignIn');
}

function blnAuthenticateUser(strData)
{
    try
    {        
        blnSetCookie("strLoginData", strData, false);
        blnSetCookie("strLogin", document.getElementById("txtUserName").value, true);
        //blnSetCookie("strLogin", document.getElementById("txtUserName").value, true);
        //blnSetCookie("strLastLogin", document.getElementById("txtUserName").value, true);
        subHideCallOut('tblSignIn')
        subUpdateSignInSection();
    } catch(e) {
        subDisplayError("MiscCode.js", "blnAuthenticateUser('" + strData + "')", e);
    }
    
}

function blnIsUserLoggedIn()
{
    try
    {
        if(strGetCookie("strLoginData","") != "")
        {
            return true;
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "blnIsUserLoggedIn()", e);
    }
      
    return false;
   
}

function strGetUserData(strName)
{
    try
    {
        var strValue = "";
        
        if(blnIsUserLoggedIn() == true)
        {
            var strLoginData = strGetCookie("strLoginData", "");
            
            var arrData = strLoginData.split("|");
            
            for(var intDataCount = 0; intDataCount < arrData.length; intDataCount++)   
            {
                var arrValue = arrData[intDataCount].split("=");
                if(arrValue[0].toUpperCase() == strName.toUpperCase())
                {
                    strValue = arrValue[1];
                }
            }
        }
        
        return strValue;
    } catch(e) {
        subDisplayError("MiscCode.js", "strGetUserData('" + strName + "')", e);
    }
}

function subUpdateSignInSection()
{
    try
    {
        var objtdSignIn = document.getElementById("tdSignIn");
        
        if(objtdSignIn)
        {
            if(blnIsUserLoggedIn() == false)
            {
            
                 objtdSignIn.innerHTML = "<a class=\"cssHrefBold\" style=\"text-decoration:none\" onmouseover=\"subSetCursor(this, 'hand');\" onclick=\"javascript:subCreateSignInSection(event, false);\">Sign in</a>&nbsp;/&nbsp;<a class=\"cssHrefBold\" style=\"text-decoration:none\" href=\"javascript:subOpenWindow('/Registration.aspx', false, 550, 628);\">Register</a>";
            }
            else
            {
                objtdSignIn.innerHTML = "<span class=\"cssHrefBold\">Hi " + strGetUserData("NAME") +  "</span>&nbsp;&nbsp;<a class=\"cssHrefBold\" style=\"text-decoration:underline\" href=\"javascript:subOpenWindow('/Registration.aspx?strLogin=" + strGetCookie("strLogin", "") + "', false, 550, 610);\">Edit Profile</a>&nbsp;&nbsp;<a class=\"cssHrefBold\" style=\"text-decoration:underline\" onmouseover=\"subSetCursor(this, 'hand');\" onclick=\"javascript:subCreateSignInSection(event, true);\">Change Password</a>&nbsp;&nbsp;<a class=\"cssHrefBold\" style=\"text-decoration:underline\" href=\"javascript:subOpenWindow('/BookingHistory.aspx',false,500,950);\">Booking History</a>&nbsp;&nbsp;<a class=\"cssHrefBold\" style=\"text-decoration:underline\" href=\"javascript:subSignOut();\">Sign Out</a>";
            }
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "subUpdateSignInSection()", e);
    }
}

function subShowError(intError, strErrorMessage)
{
    var strImage = "";
        
    switch (intError)
    {
        case 1 :
            strErrorMessage = arrErrorCodes[1];
            strImage = "ErrorBg2";
            break;
        case 2 :
            strErrorMessage = arrErrorCodes[2];
            strImage = "ErrorBg3";
            break;
        case 3 :
            strErrorMessage = arrErrorCodes[3];
            strImage = "ErrorBg2";
            break;
        case 4 :
            strErrorMessage = arrErrorCodes[4];
            strImage = "ErrorBg1";
            break;
        case 5 :
            strErrorMessage = arrErrorCodes[5];
            strImage = "ErrorBg1";
            break;
        case 6 :
            strErrorMessage = arrErrorCodes[6];
            strImage = "ErrorBg1";
            break;
        case 7 :
            strErrorMessage = arrErrorCodes[7];
            strImage = "ErrorBg1";
            break;
        case 8 :
            strErrorMessage = arrErrorCodes[8];
            strImage = "ErrorBg1";
            break;
        case 9 :
            strErrorMessage = arrErrorCodes[9];
            strImage = "ErrorBg2";
            break;
        case 10 :
            strErrorMessage = arrErrorCodes[10];
            strImage = "ErrorBg1";
            break;
        case 11 :
            strErrorMessage = arrErrorCodes[11];
            strImage = "ErrorBg2";
            break;
        case 12 :
            strErrorMessage = arrErrorCodes[12];
            strImage = "ErrorBg2";
            break;
        case 13 :
            strErrorMessage = arrErrorCodes[13];
            strImage = "ErrorBg1";
            break;
        case 14 :
            strErrorMessage = arrErrorCodes[14];
            strImage = "ErrorBg1";
            break;
        case 15 :
            strErrorMessage = arrErrorCodes[15];
            strImage = "ErrorBg1";
            break;
        case 16 :
            strErrorMessage = arrErrorCodes[16];
            strImage = "ErrorBg1";
            break;
        case 17 :
            strErrorMessage = arrErrorCodes[17];
            strImage = "ErrorBg1";
            break;
        case 18 :
            strErrorMessage = arrErrorCodes[18];
            strImage = "ErrorBg1";
            break;
        case 19 :
            strErrorMessage = arrErrorCodes[19];
            strImage = "ErrorBg1";
            break;
        case 20 :
            strErrorMessage = arrErrorCodes[20];
            strImage = "ErrorBg1";
            break;
        case 21 :
            strErrorMessage = arrErrorCodes[21];
            strImage = "ErrorBg1";
            break;
        case 22 :
            strErrorMessage = arrErrorCodes[22];
            strImage = "ErrorBg1";
            break;
        case 23 :
            if(strGetUserData("LSID") != "")
            {
                strErrorMessage = arrErrorCodes[3];
            }
            else
            {
                strErrorMessage = arrErrorCodes[23];
            }
            strImage = "ErrorBg1";
            break;
        default :
            if(strErrorMessage == "")
            {
                strErrorMessage = arrErrorCodes[0];
            }
            strImage = "ErrorBg2";
    }
    
    subShowMessage(intError, "<span style=\"font-size:16px;\">" + strErrorMessage + "</span>", strImage);
}

function subLoginKeyPress(argEvent)
{
    var objEvent = window.event ? window.event : argEvent;
    if(objEvent.keyCode == 13)
    {
        subSignIn();
    }
}

function subChangePasswordKeyPress(argEvent)
{
    var objEvent = window.event ? window.event : argEvent;
    if(objEvent.keyCode == 13)
    {
        subChangePassword();
    }
}

function subFillHeader()
{
    try
    {
        var objTDHeader = document.getElementById("tdHeader");
        objTDHeader.appendChild(objCreateLinksTable());
    } catch(e) {
        subDisplayError("MiscCode.js", "subFillHeader()", e);
    }
}

function subFillFooter()
{
    try
    {
        var objTDFooter = document.getElementById("tdFooter");
        var objTDCopyright = document.getElementById("tdCopyright");
        objTDFooter.appendChild(objCreateFooterTable());
        objTDCopyright.appendChild(objCreateCopyrightTable());
    } catch(e) {
        subDisplayError("MiscCode.js", "subFillFooter()", e);
    }
}

function strTimeStamp()
{
    try {
        var dtmDate = new Date();
        return "&stamp=" + dtmDate.toString();
    } catch(e) {
        subDisplayError("MiscCode.js", "strTimeStamp()", e);
    }
}

function subPrintPage(blnClose)
{
    try
    {
        window.print();
        if(!blnClose) blnClose = false;
        if(blnClose) {
            window.close();
        }
    } catch(e) {
        subDisplayError("MiscCode.js", "subPrintPage()", e);
    }
}

function objCreateLinksTable()
{
    try
    {
        var objTable = document.createElement("table");
        var objTBody = document.createElement("tbody");
        var objTR = document.createElement("tr");
        var objTD = document.createElement("td");
        
        objTable.style.width = "100%";
        objTable.border = "0";
        objTable.cellPadding = "0";
        objTable.cellSpacing = "0";
        objTable.align = "center";
        objTR.style.width = "100%";
        objTD.style.width = "100%";
        objTD.colSpan = "4";
        objTD.style.textAlign = "right";
        
        objTD.appendChild(objCreateHyperLink("Home", "subGoToURL('/Home.aspx')", "cssHref", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssHref"));
        objTD.appendChild(objCreateHyperLink("Contact Us", "subOpenWindow('/Static/ContactUs.htm', false, 160, 370)", "cssHref", "", "", "none"));
        
        objTR.appendChild(objTD);
        objTBody.appendChild(objTR);
        objTable.appendChild(objTBody);
        
        return objTable;
    } catch(e) {
        subDisplayError("MiscCode.js", "objCreateLinksTable()", e);
    }
}

function objCreateFooterTable()
{
    try
    {
        var objTable = document.createElement("table");
        var objTBody = document.createElement("tbody");
        var objTR = document.createElement("tr");
        var objTD = document.createElement("td");
        
        objTable.style.width = "100%";
        objTable.border = "0";
        objTable.cellPadding = "5";
        objTable.align = "center";
        objTR.style.width = "100%";
        objTD.style.textAlign = "left";    
        
        objTD.appendChild(objCreateHyperLink("Careers", "subOpenWindow('/Static/Careers.htm', false,570,560);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("About Us", "subOpenWindow('/Static/AboutUs.htm', false,570,560);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("Investors", "subOpenWindow('/Static/Investors.htm', false,570,560);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("Partners", "subOpenWindow('/Static/Partners.htm', false,570,560);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("Corporate Bookings", "subDisplayComingSoon();", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("Our Policies", "subOpenWindow('/Static/Purchase.htm', false,570,560);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("Feedback", "subOpenWindow('/Feedback.aspx', false, 525, 550);", "cssBlackHrefBold", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHrefBold"));
        objTD.appendChild(objCreateHyperLink("FAQs", "subOpenWindow('/static/FAQ.htm', false, 570, 560);", "cssBlackHrefBold", "", "", "none"));
        objTR.appendChild(objTD);
        objTBody.appendChild(objTR);
        
        objTable.appendChild(objTBody);
        
        return objTable;
    } catch(e) {
        subDisplayError("MiscCode.js", "objCreateFooterTable()", e);
    }
}

function objCreateCopyrightTable()
{
    try
    {
        var objTable = document.createElement("table");
        var objTBody = document.createElement("tbody");
        var objTR = document.createElement("tr");
        var objTD = document.createElement("td");
        
        objTable.style.width = "100%";
        objTable.border = "0";
        objTable.cellPadding = "5";
        objTable.align = "center";
        objTR.style.width = "100%";
        objTD.style.textAlign = "right";
        
        objTD.appendChild(objCreateHyperLink("Privacy Policy", "subOpenWindow('/Static/Privacy.htm', false,570,560);", "cssBlackHref", "", "", "none"));
        objTD.appendChild(objCreateSpan("&nbsp;&nbsp;|&nbsp;&nbsp;", "cssBlackHref"));
        objTD.appendChild(objCreateSpan("&copy;&nbsp;Bigtree Entertainment Pvt. Ltd.", "cssBlackHref"));
        objTR.appendChild(objTD);
        objTBody.appendChild(objTR);
        
        objTable.appendChild(objTBody);
        
        return objTable;
    } catch(e) {
        subDisplayError("MiscCode.js", "objCreateFooterTable()", e);
    }
}

function subDisableRightClick(e)
{
    try {
        if(!document.blnRightClickDisabled) {
            if(document.layers) {
                document.captureEvents(Event.MOUSEDOWN);
                document.onmousedown = subDisableRightClick;
            } else {
                document.oncontextmenu = subDisableRightClick;
            }
            return document.blnRightClickDisabled = true;
        }
        if(document.layers || (document.getElementById && !document.all)) {
            if (e.which==2||e.which==3) {
                return false;
            }
        } else { 
            return false;
        }
    } catch(ex) {
        subDisplayError("MiscCode.js", "subDisableRightClick();", ex);
    }
}

function subDocumentClick()
{
    
}

function objCreateHiddenField(strElementId, strValue)
{
    try
    {
        var objRet = document.createElement("input");
        objRet.type = 'hidden';
        objRet.id = strElementId;
        objRet.name = strElementId;
        objRet.value = strValue;
        return objRet;
    } catch(e) {
        subDisplayError("MiscCode.js", "objCreateHiddenField('" + strElementId + "', '" + strValue + "')", e);
    }
    return null;
}

function subDisplayComingSoon()
{
    try {        
//        var objDivStatus = document.getElementById("divStatus");
//        var objTblStatus = document.getElementById("tblStatus");
//        var objTblLoading = document.getElementById("tblLoading");
//        var objTblComingSoon = document.getElementById("tblComingSoon");
//        
//        if((objDivStatus) && (objTblStatus)) {
//            //objTblStatus.style.backgroundImage = 'url(Common/Images/2px_orange.gif)';
//            objDivStatus.style.display="block";
//            objTblLoading.style.display="none";
//            objTblComingSoon.style.display="block";
//        }
        subShowMessage(0, "Coming Soon", "ErrorBg3");
    } catch(e) {
        subDisplayError("MiscCode.js", "subDisplayComingSoon();", e);
    }
}

function subDisplayError(strFileName, strFunctionName, objError)
{
    try
    {
        if(strGetCookie("strMode", "") == "DEBUG")
        {
            document.getElementById("divError").innerHTML += "File: " + strFileName + ", Function: " + strFunctionName + ", Error: " + objError.message + "<BR>";
            document.getElementById("divError").style.display = "block";
        }
    } catch(e) {
        alert("File: " + strFileName + "\nFunction: " + strFunctionName + "\nError: " + objError.message + "\nError2: " + e.message);
    }
}

