// Modal Windows Script File
// Author: Mohammad Tajari
// Date: Aug 20, 2005

function OnKeyPress(){
	switch (event.keyCode){
		case 27:
			self.close();
			break;
	}
}

function OnMessageSilent(){
	with (document.forms[0]){
		if (Message.value != ""){
			self.returnValue = Message.value;
			Message.value = "";
		}
	}
}

function OnUnLoad(){
	self.returnValue = document.forms[0].Message.value != "";
}

function ResizeContent(){
    var Content = document.getElementById("Content");
    var Division = document.getElementById("Division");
    var Footer = document.getElementById("Footer");
    var Toolbox = document.getElementById("Toolbox");
    
    var ExpandedWidth = 30;
    var ExpandedHeight = 60;

    if (Division) {
        Division.style.height = Content.style.height;
    }
    
    if (Footer) {
        Footer.style.width = Content.style.width;
        ExpandedHeight = 150;
    }

    if (Toolbox) {
        ExpandedWidth = 100;
    }

    if (self.dialogWidth) {
        Content.style.width = parseInt(self.dialogWidth) - ExpandedWidth;
    }

    if (self.dialogHeight) {
        Content.style.height = parseInt(self.dialogHeight) - ExpandedHeight;
    }
}
