function editPageWindow(id){
	window.open('/publish/edit_page_popup.php?id='+id,'Edit','width=700,height=350');
}

function popupCloseReloadParent(){
	window.opener.location.reload();
	this.close();
}

function uploadImage(id){
	//function for opening the image upload window - id is the pagefieldid to be updated with the new image
	window.open('upload_image.php?fieldid='+id,'Upload','width=600,height=400');
}

function showHideDiv(id,imgId, imgOpen,imgClose) {
	//safe function to show or hide an element with a specified id
	//modified 8/17/2007 to take img, imgOpen & imgClose as additional params
	//if img, imgOpen && imgClose are not undefined or blank, we will swap out the image
	// imgId is the id of the image to change
	// imgOpen is the image url of the icon to be displayed to open the div
	// imgClose is the image url of the icon to be displayed to close the div
	imgId = imgId + "";
	imgOpen = imgOpen + "";
	imgClose = imgClose + "";
	
	var swapImg = true;
	if( imgId=="undefined" || imgId=="" || imgOpen=="undefined" || imgOpen=="" || imgClose=="undefined" || imgClose=="" ) swapImg = false;
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if(document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = 'block';
			if(swapImg) document.getElementById(imgId).src = imgClose;
		} else {
			document.getElementById(id).style.display = 'none';
			if(swapImg) document.getElementById(imgId).src = imgOpen;
		}
			
	}
	else {
		if (document.layers) { // Netscape 4
			if(document.id.display == 'none'){
				document.id.display = 'block';
				if(sqapImg) document.id.src = imgClose;
			} else {
				document.id.display = 'none';
				if(sqapImg) document.id.src = imgOpen;
			}
		}
		else { // IE 4
			if(document.all.id.style.display == 'none'){
				document.all.id.style.display = 'block';
				if(imgSwap) document.all.id.src = imgClose;
			} else {
				document.all.id.style.display = 'none';
				if(imgSwap) document.all.id.src = imgOpen;
			}
		}
	}
}
