// --------------------------------------------
// Select or Upload a File (res/img/CMSGallery)
// --------------------------------------------

function SelectPicture()
{	
	var url = "/res/cms/cmsImages.aspx";
	// display popup window allowing user to select from an image list, or upload their own
	flist = "dialogHeight:520px;dialogWidth:800px;resizable:yes;";

	var myObject = new Object();
	myObject.cancel = true;
	myObject.imagePath = "";
	myObject.testString = "Hello";

	var dialog = window.showModalDialog(url, myObject, flist);

	if (myObject.cancel) return;
	document.getElementById("txtPicture").value = myObject.imagePath;			
}

// --------------------------------------------
// Select or Upload a Photo (res/images/people)
// --------------------------------------------

function SelectPhoto()
{	
	var url = "/res/cms/cmsEmployeeImages.aspx";
	// display popup window allowing user to select from an image list, or upload their own
	flist = "dialogHeight:520px;dialogWidth:800px;resizable:yes;";

	var myObject = new Object();
	myObject.cancel = true;
	myObject.imagePath = "";
	myObject.testString = "Hello";

	var dialog = window.showModalDialog(url, myObject, flist);

	if (myObject.cancel) return;
	document.getElementById("txtPhoto").value = myObject.imagePath;			
}

function resizeElements()
{
	var sideDiv;
	var contentDiv;
	var sideDivHeight;
	var contentDivHeight;

	sideDiv = document.getElementById("searchBox");
	contentDiv = document.getElementById("content");
	
	if (contentDiv.offsetHeight > 340)
	{
		sideDiv.style.height = contentDiv.offsetHeight - 280 +"px";
	}
	else
	{
		//sideDiv.style.height = "60px";
		sideDiv.style.height = "110px";
	}
}

function departmentSelected(dropdown)
{
	document.location.href="?section=page&p=people&departmentid=" + dropdown.value;
}