window.onload = function() 
{
	if (document.getElementById)
	{
		/* Associate logo's onclick event with home page */
		var logo = document.getElementById("logo");
		if (logo != null)
		{
			logo.onclick = function() 
			{
				window.location = 'index.php';
				return false;
			}
		}

		var aOccasion = document.getElementById('occasionsearch');
		if (aOccasion != null) aOccasion.onsubmit = JSFnValidateOccasionForm;

		var aPerson = document.getElementById('Personsearch');
		if (aPerson != null) aPerson.onsubmit = JSFnValidatePersonForm;
	}	
}

/******************************************************************************************************************************************/

/* Validate the Occasion Form: Fields */
var aOccasionRequiredFields = new Array ("SearchOccasion","Please enter some search details");
/* Validate the Occasion Form: Function */
function JSFnValidateOccasionForm()
{
	return JSFnValidateForm(aOccasionRequiredFields);
}

	/********************************/

/* Validate the Person Form: Fields */
var aPersonRequiredFields = new Array ("SearchPerson","Please enter some search details");
/* Validate the Person Form: Function */
function JSFnValidatePersonForm()
{
	return JSFnValidateForm(aPersonRequiredFields);
}

	/********************************/

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;
}


<!--
// Bookmark Script -->
var url = "http://www.taketime.com/index.html";
var title = "TakeTime.com: Unique Gifts from Another Dimension";
function makeLink(){
if(document.all)
window.external.AddFavorite(url,title)
}
// -->
