function checkInputIn(which_form, which_input, should_be)
{
var a = eval("document.forms."+which_form+"."+which_input+".value");
if (a == should_be)
	{
	eval("document.forms."+which_form+"."+which_input+".value = '';");
	}
}

function checkInputOut(which_form, which_input, should_be)
{
var a = eval("document.forms."+which_form+"."+which_input+".value");
if (a == "")
	{
	eval("document.forms."+which_form+"."+which_input+".value = '"+should_be+"';");
	}
}


function showDiv(which_div)
{
var a = document.getElementById(which_div);
a.className = "divShow";
}

function hideDiv(which_div)
{
var a = document.getElementById(which_div);
a.className = "divHide";
}



function showHideElement(which_element) {
var a = document.getElementById(which_element)
if (a.style.display == "block" || a.style.display == "")
	{
	a.style.display = "hidden";
	}
else
	{
	a.style.display = "block";
	}
}


function showHideList(which_list) {
var a = document.getElementById(which_list);
if (a.className == "list_show")
	{
	a.className = "list_hidden";
	}
else
	{
	a.className = "list_show";
	}
}


function showHideYearList(which_list, which_plus_minus) {
var a = document.getElementById(which_list);
var b = document.getElementById(which_plus_minus);
if (a.className == "list_show")
	{
	a.className = "list_hidden";
	b.innerHTML = "+";
	}
else
	{
	a.className = "list_show";
	b.innerHTML = "-";
	}
}


function orderImage(which_imageID, whichID, up_or_down, returnPosition) {
document.forms.copyForm.final_save.value = "0";
if (up_or_down == "up")
	{
	document.forms.copyForm.rURL.value = "orderImageUp.asp?iID="+which_imageID+"&id="+whichID+"&returnPosition="+returnPosition;
	}
else
	{
	document.forms.copyForm.rURL.value = "orderImageDown.asp?iID="+which_imageID+"&id="+whichID+"&returnPosition="+returnPosition;
	}
document.forms.copyForm.submit();
}


function NewBlogImageSelector(which_iframe_ID, imageChangeId) {
var a = document.getElementById("selectImage"+which_iframe_ID);
var b = document.getElementById("plusMinus"+which_iframe_ID);
if (a.style.display == "block")
	{
	b.innerHTML = "+";
	a.src = "/_admin/blog/blank_iframe.asp";
	a.style.display = "none";
	}
else
	{
	b.innerHTML = "-";
	b.style.paddingLeft = "2px";
	b.style.paddingRight = "2px";
	a.src = "/_admin/blog/select_image.asp?iID="+which_iframe_ID+"&imageChangeId="+imageChangeId;
	a.style.display = "block";
	}
}


function SelectNewBlogImage(original_image, new_image, new_image_name, imageChangeId) {
var a = parent.document.getElementById("mBlogImg"+original_image);
a.style.display = "block";
a.src = "/_images/blog/"+new_image_name+"_m.jpg";
var b = parent.document.getElementById("commitLink"+original_image);

if (original_image == "NewImg")
	{
	b.innerHTML = '<input type="button" value="commit image addition" class="subButCommit" onclick="this.form.final_save.value=\'0\';	this.form.rURL.value=\'add_new_image.asp?nImg='+new_image+'\'; this.form.imageChangeId.value=\''+imageChangeId+'\'; this.form.imageChangeFrom.value=\''+original_image+'\'; this.form.imageChangeTo.value=\''+new_image+'\'; this.form.submit();" />';
	}
else
	{
	b.innerHTML = '<input type="button" value="commit image change" class="subButCommit" onclick="this.form.final_save.value=\'0\';	this.form.rURL.value=\'add_step4.asp\'; 	this.form.imageChangeId.value=\''+imageChangeId+'\'; this.form.imageChangeFrom.value=\''+original_image+'\'; this.form.imageChangeTo.value=\''+new_image+'\'; this.form.submit();" />';
	}
}


function DeleteBlogImage(imgID, dbID, blogID) {
var agree = confirm("Are you sure you wish to delete this blog image? Deleting this image will remove the copy above and below. If you'd like to keep the wording, please move it before deleting the image. And please save any unsaved copy changes before deleting. Only press OK if you're sure you want to delete.");
if (agree)
	{
	location.href="deleteBlogImage.asp?imgID="+imgID+"&dbID="+dbID+"&blogID="+blogID;
	}
else
	{
	return false;
	}
}


function largeBlogImg(which_img) {
var a = which_img;
var b = a.replace("_t.jpg", ".jpg");
alert (b);
}

