﻿
function fillthescreen() {
   document.getElementById('container-body').style.height = document.getElementById('container-page').clientHeight - document.getElementById('container-head').clientHeight - document.getElementById('container-foot').clientHeight + "px";
    //    document.getElementById('container-right').style.height = document.getElementById('container-content').clientHeight + "px";
}

function TabChanged(obj, nTab) {
    obj.className = 'TabActive';
    document.getElementById('ctl00_cph_hfActiveTab').value = obj.id;

    for (i = 1; i < nTab; i++) {
        if ('tab' + i == obj.id) {
            document.getElementById('div_' + obj.id).style.display = '';
        }
        else {
            document.getElementById('div_tab' + i).style.display = 'none';
            document.getElementById('tab' + i).className = 'Tab';
        }
    }
}

function TabLoad(nTab) {
    var ActivePanel = "tab" + getQuerystring("p");
    if (ActivePanel == "tab") { ActivePanel = 'tab1'; }

    for (i = 1; i < nTab; i++) {
        if ('tab' + i == ActivePanel) {
            document.getElementById('div_' + ActivePanel).style.display = '';
            document.getElementById(ActivePanel).className = 'TabActive';
        }
        else {
            document.getElementById('div_' + 'tab' + i).style.display = 'none';
        }
    }
}

function getQuerystring(key, default_) {
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return default_;
    else
        return qs[1];
}



var min = 11;
var max = 18;
function increaseFontSize() {
    var p = document.getElementById('divBody');
    if (p != null) {
        if (p.style.fontSize) {
            var s = parseInt(p.style.fontSize.replace("px", ""));
        } else {
            var s = 11;
        }
        if (s != max) {
            s += 1;
        }
        p.style.fontSize = s + "px"
    }
}
function decreaseFontSize() {
    var p = document.getElementById('divBody');
    if (p != null) {
        if (p.style.fontSize) {
            var s = parseInt(p.style.fontSize.replace("px", ""));
        } else {
            var s = 11;
        }
        if (s != min) {
            s -= 1;
        }
        p.style.fontSize = s + "px"
    }
}


PositionX = 100;
PositionY = 100;
defaultWidth = 500;
defaultHeight = 500;
var AutoClose = false;


if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
    var isNN = (navigator.appName == "Netscape") ? 1 : 0;
    var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
var optNN = 'scrollbars=no,width=' + defaultWidth + ',height=' + defaultHeight + ',left=' + PositionX + ',top=' + PositionY;
var optIE = 'scrollbars=no,width=150,height=100,left=' + PositionX + ',top=' + PositionY;
function popImage(imageURL, imageTitle) {
    if (isNN) { imgWin = window.open('about:blank', '', optNN); }
    if (isIE) { imgWin = window.open('about:blank', '', optIE); }
    with (imgWin.document) {
        writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>'); writeln('<sc' + 'ript>');
        writeln('var isNN,isIE;'); writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
        writeln('isNN=(navigator.appName=="Netscape")?1:0;'); writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
        writeln('function reSizeToImage(){'); writeln('if (isIE){'); writeln('window.resizeTo(300,300);');
        writeln('width=300-(document.body.clientWidth-document.images[0].width);');
        writeln('height=300-(document.body.clientHeight-document.images[0].height);');
        writeln('window.resizeTo(width,height);}'); writeln('if (isNN){');
        writeln('window.innerWidth=document.images["George"].width;'); writeln('window.innerHeight=document.images["George"].height;}}');
        writeln('function doTitle(){document.title="' + imageTitle + '";}'); writeln('</sc' + 'ript>');
        if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
        else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
        writeln('<img name="George" src=' + imageURL + ' style="display:block"></body></html>');
        close();
    }
}