﻿

function DoTask(target, functionref, tasktype){
    
    var tasktype = (window.addEventListener)? tasktype : "on" + tasktype;
    
    if (target.addEventListener)
        target.addEventListener(tasktype, functionref, false);
    else if (target.attachEvent)
        target.attachEvent(tasktype, functionref);
        
}

this.DoTask(window, function(){ResizeForm()}, "resize")

function ResizeForm(){
    var c = document.getElementById('DialogMessage'); 
    if (c.style.visibility == 'visible'){ShowDialog(false)}
}

function CloseDialog(){
    var c = document.getElementById('DialogMessage'); 
    var i = document.getElementById('DialogCover'); 
    c.style.visibility = 'hidden';
    i.style.visibility = 'hidden';
}
function ShowDialog(UseTimer){

    var PageHeight = null;
    var PageWidth = null;
    
    if (window.innerHeight){
        PageHeight = window.innerHeight;
    }else{
        PageHeight = document.documentElement.clientHeight;
    }

    if (window.innerWidth){
        PageWidth = window.innerWidth;
    }else{
        PageWidth = document.documentElement.clientWidth;
    }
    
    var c = document.getElementById('DialogMessage'); 
    c.style.left = (PageWidth / 2) - 175 + 'px'; 
    c.style.top = (PageHeight / 2) - 65 + 'px';
    c.style.visibility = 'visible';

    var i = document.getElementById('DialogCover'); 
    i.style.width = PageWidth + "px" 
    i.style.height = PageHeight + "px" 
    i.style.left = 0 
    i.style.top = 0 
    i.style.visibility = "visible" 
    
    if (UseTimer){ setTimeout("CloseDialog()",3000); }
    
}
function BtnMouseOver(objectID){

    var btn = document.getElementById(objectID)
    btn.style.color = "#003371"
    btn.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#dcdcdc',EndColorStr='#ffffff');"

}
function BtnMouseOut(objectID){

    var btn = document.getElementById(objectID)
    btn.style.color = "#000000"
    btn.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ffffff',EndColorStr='#dcdcdc');"

}
function BtnCloseMouseOver(){
    var btn = document.getElementById('btnTBClose')
    btn.src = "images/CloseRed1.gif"
}
function BtnCloseMouseOut(){
    var btn = document.getElementById('btnTBClose')
    btn.src = "images/CloseRed.gif"
}