window.onload = jsFnOnLoad;

function jsFnOnLoad()
{	
	if (document.getElementById)
	{
		var aLogo = document.getElementById('logo');
		if (aLogo != null) 
		{
			aLogo.onclick = function() {window.location = 'index.html';};
			aLogo.style.cursor = 'pointer';
		}
		
		var aPageRemove = document.getElementById('RemovePage');
		if (aPageRemove != null) aPageRemove.onclick = JSFnRemoveClick;
		
		var aImageRemove = document.getElementById('RemoveImage');
		if (aImageRemove != null) aImageRemove.onclick = JSFnRemoveClick;
		
//		var aContactForm = document.getElementById('contactform');
//		if (aContactForm != null) aContactForm.onsubmit = JSFnValidateContactForm;
	}
}	


function JSFnRemoveClick()
{
	var removed = confirm("Are you sure you want to remove this item?");

	return removed;
}

/*function jsFnShowBigImage()
{
	window.open(this.href, 'bigimage', 'width=600px, height=700px');	
	return false;
}

var aContactRequiredFields = new Array ("Name","Please enter your name to continue",
										"Company","Please enter your company name to continue",
										"PostTown","Please enter the post town",
										"Email","Please enter your email address to continue");
function JSFnValidateContactForm()
{
	var aEmail = document.getElementById('email');
	var aAddress = document.getElementById('address');
	var aTelephone = document.getElementById('telephone');
	var aFax = document.getElementById('fax');
	if ((aEmail != null) && (aAddress != null) && (aTelephone != null) && (aFax != null))
	{
		if ((aEmail.value == '') && (aAddress.value == '') && (aTelephone.value == '') && (aFax.value == ''))
		{
			alert('You must provide either your address, telephone/fax number or email address to continue.');
			return false;
		}
	}

	return JSFnValidateForm(aContactRequiredFields);
}

function JSFnValidateForm(aRequiredFields)
{
	for (aIndex = 0; aIndex < aRequiredFields.length; aIndex = aIndex + 2)
	{
		currElement = document.getElementById(aRequiredFields[aIndex]);
		if (currElement != null)
		{
			if  (   (   (currElement.type == 'text')
				     && (currElement.value == ''))
				 || (   (currElement.type == 'password')
				     && (currElement.value == ''))
				 || (   (currElement.type == 'checkbox')
				     && (currElement.checked == false))
				 || (   (currElement.type == 'file')
				     && (currElement.value == ''))
				 || (   (currElement.type == 'textarea')
				     && (currElement.value == ''))
				 || (   (currElement.type == 'select-one')
				     && (currElement.value == '')))
			{
				alert(aRequiredFields[aIndex + 1]);
				return false;
			}
			else if (currElement.type == 'radio')
			{
				aIndex = aIndex + 2;
				if (!currElement.checked)
				{
					currElement = document.getElementById(aRequiredFields[aIndex]);
					if ((currElement.type == 'radio') && (!currElement.checked))
					{
						alert(aRequiredFields[aIndex + 1]);
						return false;
					}
				}
			}
		}
	}
	return true;
}
*/