function Resize() {
	var sWinHeight = new String(document.body.clientHeight);
	var sWinWidth = new String(document.body.clientWidth);
	var sHeight = new String(document.body.clientHeight - 67);
	var sWidth = new String(document.body.clientWidth - 293);
	var sHandleTop = new String(document.body.clientHeight - 14);
	var sHandleLeft = new String(document.body.clientWidth - 14);
	var sButtonsLeft = new String(document.body.clientWidth - 268);
	var sCopyrightLeft = new String((document.body.clientWidth/2) - 200);
	if (sWinHeight > 540 || sWinWidth > 760) {
		//if (sHeight < 400) {sHeight = 400};
		//if (sWidth < 472) {sWidth = 472};
		if (sButtonsLeft < 492) {sButtonsLeft = 492};
		if (sHandleLeft < 746) {sHandleLeft = 746}
		if (sHandleTop < 526) {sHandleTop = 526}
		document.getElementById('frameNavigation_div').style.height = sHeight;
		document.getElementById('frameContent_div').style.height = sHeight;
		document.getElementById('frameContent_div').style.width = sWidth;
		document.getElementById('cornerhandle').style.top = sHandleTop;
		document.getElementById('frameButtons').style.left = sButtonsLeft;
		document.getElementById('frameCopyright').style.left = sCopyrightLeft;
		document.getElementById('frameCopyright').style.top = (parseInt(sHeight) + 33);
		document.getElementById('cornerHandle').style.left = sHandleLeft;
	}
	
	//alert("height = " + sWinHeight + "\n" + "width = " + sWinWidth)
}

function OpenVideoDialog(url, high, wide) {
  window.status = "";
  strFeatures = "dialogWidth=" + wide + "px;dialogHeight=" + high + "px;scrollbars=no;center=yes;border=thin;help=no;status=no" 
  strTitle = window.showModalDialog(url, "ExampleWin", strFeatures);
    
  window.event.cancelBubble = true;
  window.event.returnValue = false;
}


var imgsize
imgsize = "tiny"

function scaleDlg(id) {
		
	if (imgsize == "tiny") {
		document.getElementById(id).style.zoom = "100%";
		imgsize = "big"
	}
	else {
		document.getElementById(id).style.zoom = "50%";
		imgsize = "tiny"
	}
}

var hide
hide = true

function showImg(id) {
	
	if (hide == true) {
		document.getElementById(id).style.display = "block";
		hide = false
	}
	else {
		document.getElementById(id).style.display = "none";
		hide = true
	}
}
	
function zoomDlg(id, type, h, w) {
	var image = new String("./common/images/" + id + "+." + type)
	params = "'fullscreen=no,toolbar=no,menubar=no,alwaysRaised=yes,location=no,resizable=no,status=no,directories=no,scrollbars=no,width=" + w + ",height=" + h;

	objWin = window.open(image, id, params, 'true')
 	var x = 0
	while(objWin.document.images[0] == null && x < 32000) {
		x++
	}

	var wide = new Number(objWin.document.images[0].width + 45)
	var high = new Number(objWin.document.images[0].height + 75)

	objWin.resizeTo(wide, high)
	objWin.moveTo((screen.availWidth - wide)/2,((screen.availHeight - high)/3) - 5)
}

function zoomDlgOld(id, type) {
	var image = new String("./common/images/" + id + "+." + type)
	params = "'fullscreen=no,toolbar=no,menubar=no,alwaysRaised=yes,location=no,resizable=no,status=no,directories=no,scrollbars=no,width=482,height=362";

	objWin = window.open(image, id, params, 'true')
 	var x = 0
	while(objWin.document.images[0] == null && x < 32000) {
		x++
	}

	var wide = new Number(objWin.document.images[0].width + 30)
	var high = new Number(objWin.document.images[0].height + 60)

	objWin.resizeTo(wide, high)
	objWin.moveTo((screen.availWidth - wide)/2,((screen.availHeight - high)/3) - 5)
}

function zoomImg(id, type) {
	var image = new String("./common/images/" + id + "." + type)
	params = "'fullscreen=no,toolbar=no,menubar=no,alwaysRaised=yes,location=no,resizable=no,status=no,directories=no,scrollbars=no,width=482,height=362";

	objWin = window.open(image, id, params, 'true')
 	var x = 0
	while(objWin.document.images[0] == null && x < 32000) {
		x++
	}

	var wide = new Number(objWin.document.images[0].width + 30)
	var high = new Number(objWin.document.images[0].height + 60)

	objWin.resizeTo(wide, high)
	objWin.moveTo((screen.availWidth - wide)/2,((screen.availHeight - high)/3) - 5)
}

function goBack() {
	window.history.back()
}

function goFwd() {
	window.history.forward()
}

function printContent() {
    window.parent.frames.item("frameContent").focus()
    window.parent.frames.item("frameContent").print()
}

function btnDisable() {
	//No Disabling;
}

function browserSniff() {
	var browser = new Object()
	browser.version = parseInt(navigator.appVersion)

	if(navigator.appName != 'Microsoft Internet Explorer' || browser.version < 4) {
	alert("This application has been designed for Microsoft Internet Explorer version 5.5 or newer. Not all features will be available in other browsers.")
	}
}

function getCurYear()
	{
	var thisYear = new Date()
	return thisYear.getFullYear()
}

//****Tree View Functions

function showBranch(branch){
	var objBranch = document.getElementById(branch).style;
	if(objBranch.display=="block")
		objBranch.display="none";
	else
		objBranch.display="block";
}

function swapImage(img, type){
	objImg = document.getElementById(img);
	if(objImg.src.indexOf('closed_' + type + '.gif')>-1)
		objImg.src = openImg.src;
	else
		objImg.src = closedImg.src;
}

