﻿function GetClientArea() {
    var clientWidth;
    var clientHeight;
    switch(Sys.Browser.agent) {
        case Sys.Browser.InternetExplorer:
            clientWidth = document.documentElement.clientWidth;
            clientHeight = document.documentElement.clientHeight;
            break;
        case Sys.Browser.Safari:
            clientWidth = window.innerWidth;
            clientHeight = window.innerHeight;
            break;
        case Sys.Browser.Opera:
            clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
            clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
            break;
        default:  // Sys.Browser.Firefox, etc.
            clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
            clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
            break;
    }
    var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
    var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
    return new Sys.UI.Bounds(scrollLeft, scrollTop, clientWidth, clientHeight);
}; 

function disableContext(button){
    var message="Right clicking has been disabled!";
    if (navigator.appName == "Netscape" && button.which == 3)
        {
            return false;
        }
        else 
    if (button.which == 2)
        {
            return false;}
        }
document.oncontextmenu=new Function("return false")

var outColor;
function SetOverColor(source){
     outColor = source.style.backgroundColor;
     source.style.backgroundColor = '#ff9900';
};
function SetOutColor(source){
     source.style.backgroundColor = outColor;
};

    function viewall(Account){
        var allwin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 450) / 2;
        allwin = window.open("AllYears.aspx?account=" + Account,"AllYears","top="+ topPos +",left=0,width="+ carea.width +",height=450,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=yes,directories=no,location=no,resizable=yes");
        allwin.focus(); 
    }     
    function viewdetail(TaxType,Year,Ticket,TicketSuff){
        var detailwin;
        var carea = GetClientArea(); 
        topPos =  (carea.height  - 600) / 2;
        leftPos = (carea.width - 1000) / 2;
        detailwin = window.open("Detail.aspx?taxtype=" + TaxType + "&year=" + Year + "&ticket=" + Ticket + "&ticketsuff=" + TicketSuff,"Detail","top="+ topPos +",left=" + leftPos + ",width=1000,height=600,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=no,directories=no,location=no,resizable=no");
        detailwin.focus(); 
    }   
    function ShowAbout(){
        var aboutwin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 600) / 2;
        leftPos = (carea.width - 1050) / 2;
        aboutwin = window.open("About.aspx","About","top="+ topPos +",left=" + leftPos + ",width=1050,height=600,toolbar=yes,addressbar=yes,menubar=yes,status=yes,scrollbars=yes,directories=yes,location=yes,resizable=yes");   
        aboutwin.focus(); 
    }   
if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();
