function $(elt) {
	return document.getElementById(elt);
}

function hideDiv(divName) {
	var div = document.getElementById(divName);
	if(div != null) {
		//div.style.visibility = 'hidden';
		div.style.display = 'none';
	}
}

function showDiv(divName) {
	var div = document.getElementById(divName);
	if(div != null) {
		//div.style.visibility = 'visible';
		//dojo.lfx.html.fadeIn(divName, 300).play());
		div.style.display = '';
	}
}

function displayWindow(url, width, height) {
	var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=0,status=yes' );
}

function launchFullSize(obj) {
	var pathToFullSize = getFullPicPath(obj);
	var win = window.open(pathToFullSize, "description", 'width=' + 600 + ',height=' + 450 + ', resizable=yes, scrollbars=no, menubar=0, status=yes');
}

function getFullPicPath(obj) {
	var thumbPath = obj.src;
	return thumbPath.replace(/thumbs\//, "");
}

function enlargePic(obj) {
	/*
	var pathToFullSize = getFullPicPath(obj);
	var imgElt = document.createElement("img");
	imgElt.src = pathToFullSize;
	imgElt.style.width = "30%";
	imgElt.style.height = "30%";
	imgElt.style.position = "absolute";
	imgElt.style.marginTop = "-200px";
	$("gallery").insertBefore(imgElt, obj.nextSibling);
	*/
}

function removePic(obj) {
	/*
	$("gallery").removeChild(obj.nextSibling);
	*/

}

function validationError(eltId, errorMsg) {
	if($(eltId)) {
		$(eltId).style.color = "red";
		$(eltId).style.fontWeight = "bold";
	}
	if($("errorRow")) $("errorRow").style.display = '';
	var pNode = document.createElement("p");
	var txtContent = document.createTextNode(errorMsg);
	pNode.appendChild(txtContent);
	if($("errorStatus")) $("errorStatus").appendChild(pNode);
}

function toggleDateSelector() {
	if($("dateSelector")) {
		var state = $("dateSelector").style.display;
		if(state == '') {
			$("dateSelector").style.display = 'none';
			$("dateToggle").innerHTML = 'Select Dates (optional)';
			$("dateSelected").value = 'false';
		} else {
			$("dateSelector").style.display = '';
			$("dateToggle").innerHTML = '[Hide Dates]';
			$("dateSelected").value = 'true';
		}
	}
}