﻿// JScript File
function popOpenPopup(szDivID, iState) // 1 visible, 0 hidden			'Shows hide a Layer
{
    var obj = document.layers ? document.layers[szDivID] :
    document.getElementById ?  document.getElementById(szDivID).style :
    document.all[szDivID].style;
    
    if (iState == 1) {
	    //Set Height and Width Property
	    var myWidth = 0, myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
        }
        obj.width=myWidth;
        obj.height=myHeight;
        
        obj.display = "block";
        popDisableDropDowns(true);
    }
    else {
	    obj.display = "none";
	    popDisableDropDowns(false);
	}    
	obj.visibility = document.layers ? (iState ? "show" : "hide") : (iState ? "visible" : "hidden");
	
}

function popResizePopup(szDivID)
{
    var obj = document.layers ? document.layers[szDivID] :
    document.getElementById ?  document.getElementById(szDivID).style :
    document.all[szDivID].style;
    
    if (obj.display == "block") {
        var myWidth = 0, myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
        }
        obj.width=myWidth;
        obj.height=myHeight;
    }
}

function popDisableDropDowns(truefalse) {
    //var str = '';
    var elem = document.forms[0].elements; //getElementById('aspnetForm').elements;
    for(var i = 0; i < elem.length; i++)
    {
        if (elem[i].type=='select-one') {
            /*
            str += "<b>Type:</b>" + elem[i].type + "&nbsp&nbsp";
            str += "<b>Name:</b>" + elem[i].name + "&nbsp;&nbsp;";
            str += "<b>Value:</b><i>" + elem[i].value + "</i>&nbsp;&nbsp;";
            str += "<BR>";
            */
            elem[i].disabled = truefalse;
            
        }
    } 
    //document.getElementById('lblValues').innerHTML = str;
}

