﻿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){
    if (navigator.appName == "Netscape" && button.which == 3)
        {
            window.close();
            return false;
        }
        else
    var e = event ? event : window.frames["BitmapViewer1"].event;
    if (e.button != 1)
        {
            window.close();
            return false;}
        }      
document.oncontextmenu=new Function("return false")

function disableRightClick(btnClick){
    if (navigator.appName == "Netscape" && btnClick.which == 3)
        { 
            return false;
        }
        else if (navigator.appName =="Microsoft Internet Explorer" && event.button != 1)
        {
            return false;
        }
} 
document.onmousedown = disableRightClick;
document.onmouseup = disableRightClick;

var outColor;
function SetOverColor(source){
     outColor = source.style.backgroundColor;
     source.style.backgroundColor = '#ff9900';
};
function SetOutColor(source){
     source.style.backgroundColor = outColor;
};

    var Instrument;  
    function viewimage(Instrument,Place){   
        var imagewin;
        var carea = GetClientArea();
        if (Place == 1){
            topPos = (carea.height - 696) / 2;
            leftPos = (carea.width - 1012) / 2; 
            imagewin = window.open("Image.aspx?instrument=" + Instrument,"","top="+ topPos +",left=" + leftPos + ",width=1012,height=696,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=no,directories=no,location=no,resizable=no");   
            imagewin.focus();
        }
        if (Place == 2){
            topPos = (carea.height - 682) / 2;
            leftPos = (carea.width - 1012) / 2; 
            imagewin = window.open("Image.aspx?instrument=" + Instrument,"","top="+ topPos +",left=" + leftPos + ",width=1012,height=682,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=no,directories=no,location=no,resizable=yes");   
            imagewin.focus();
        }
    } 
    function viewparties(Instrument){
        var partywin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 200) / 2;
        leftPos = (carea.width - 1012) / 2;
        partywin = window.open("Parties.aspx?instrument=" + Instrument,"Parties","top="+ topPos +",left=" + leftPos + ",width=1012,height=200,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=yes,directories=no,location=no,resizable=yes");
        partywin.focus(); 
    }   
    function viewcross(Instrument){
        var crosswin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 200) / 2;
        crosswin = window.open("Cross.aspx?instrument=" + Instrument,"Cross","top="+ topPos +",left=0,width=" + carea.width + ",height=200,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=yes,directories=no,location=no,resizable=yes");   
        crosswin.focus(); 
    }   
    function viewnote(Instrument){
        var notewin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 200) / 2;
        leftPos = (carea.width - 1012) / 2;
        notewin = window.open("Notation.aspx?instrument=" + Instrument,"Note","top="+ topPos +",left=" + leftPos + ",width=1012,height=200,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=yes,directories=no,location=no,resizable=yes");   
        notewin.focus(); 
    } 
    function ShowDescriptions(Place){
        var descriptionwin;
        var carea = GetClientArea();
        if (Place == 1){
            topPos =  (carea.height  - 600) / 2;
            leftPos = (carea.width - 600) / 2;
            descriptionwin = window.open("Descriptions.aspx","Descriptions","top="+ topPos +",left=" + leftPos + ",width=600,height=600,toolbar=no,addressbar=no,menubar=no,status=no,scrollbars=yes,directories=no,location=no,resizable=yes");   
            descriptionwin.focus(); 
            }
        if (Place == 2){
            topPos =  0;
            leftPos = 0;
            descriptionwin = window.open("Descriptions.aspx","Descriptions","top="+ topPos +",left=" + leftPos + ",width=600,height=600,toolbar=no,addressbar=no,menubar=no,status=no,scrollbars=yes,directories=no,location=no,resizable=yes");   
            descriptionwin.focus(); 
            }
    }  
    function ShowHowMuch(){
        var howmuchwin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 400) / 2;
        leftPos = (carea.width - 780) / 2;
        howmuchwin = window.open("HowMuch.aspx","HowMuch","top="+ topPos +",left=" + leftPos + ",width=780,height=400,toolbar=no,addressbar=no,menubar=no,status=yes,scrollbars=yes,directories=no,location=no,resizable=no");   
        howmuchwin.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(); 
    }   
    function ShowLogin(){
        var loginwin;
        var carea = GetClientArea();
        topPos =  (carea.height  - 100) / 2;
        leftPos = (carea.width - 100) / 2;
        loginwin = window.open("Login.aspx","Login","top="+ topPos +",left=" + leftPos + ",width=315,height=195,toolbar=no,addressbar=no,menubar=no,status=no,scrollbars=no,directories=no,location=no,resizable=no");   
        loginwin.focus(); 
    }     
    var newwin;
    function Softis(){   
        newwin = window.open("http://www.softis.com/","newwin");   
        newwin.focus();
    } 
    function Aurigma(){   
        newwin = window.open("http://www.aurigma.com/","newwin");   
        newwin.focus();
    } 
    function Obout(){   
        newwin = window.open("http://www.obout.com/","newwin");   
        newwin.focus();
    } 
if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();