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 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/photographer-Northumberland/"+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);
}



function SelectImpactImageFrame(which_section, which_img_type) {
var a = document.getElementById("selectImage"+which_section);
//var a = eval('document.getElementById("selectImage'+which_img+'")');
a.src = "/_admin/settings/select_image.asp?s="+which_section+"&i="+which_img_type;
a.style.display = "block";
}


function SelectImpactImage(which_section, which_img_type, which_img) {
parent.document.location.href = "/_admin/settings/set_image.asp?s="+which_section+"&i="+which_img_type+"&iID="+which_img;
}



function AddGalleryImage(which_gallery, existing_imageID_overwrite) {
var a = document.getElementById("AddGalleryImgFrame");
if (existing_imageID_overwrite)
	{
	existing_imageID_overwrite = existing_imageID_overwrite
	}
else
	{
	existing_imageID_overwrite = "";
	}
a.src = "/_admin/gallery/select_image.asp?g="+which_gallery+"&existing_imageID_overwrite="+existing_imageID_overwrite;
a.style.display = "block";
}


function SetGalleryImage(imageID, which_gallery, existing_imageID_overwrite) {
parent.document.location.href = "add_image.asp?iID="+imageID+"&g="+which_gallery+"&existing_imageID_overwrite="+existing_imageID_overwrite;
}


function showGalleryImg(which_img) {
var a = document.getElementById("galImg");
a.src = "/_images/photographer-Northumberland/"+which_img+"_l.jpg";
}


function DeleteTestimonial(testimonialID) {
var agree = confirm("Are you sure you wish to delete this testimonial?");
if (agree)
	{
	location.href="delete.asp?tmID="+testimonialID;
	}
else
	{
	return false;
	}
}

