
	function ValidateForm ( prForm )
	{
		var amount = $("#wishList div.wishlistItem").length;
		if ( amount < 1 )
		{
			alert ( "Please add at least one product to your wish list..." );
			return false;
		}
		
		if ( prForm.First_Name.value == "" )
		{
			alert ( "Please enter your Name" );
			prForm.First_Name.focus ();
			return false;
		}
		
		if ( prForm.Surname.value == "" )
		{
			alert ( "Please enter your Surname" );
			prForm.Surname.focus ();
			return false;
		}
		
		if ( prForm.Cellphone.value == "" )
		{
			alert ( "Please enter your Telephone Number" );
			prForm.Cellphone.focus ();
			return false;
		}
		
		if ( !JS_IsEmail ( prForm.eEmail.value ) )
		{
			alert ( "Please enter a valid Email address" );
			prForm.eEmail.focus ();
			return false;
		}
		
		if ( prForm.newExistY.checked )
		{
			prForm.newExist.value = 'Y';
		} else {
			prForm.newExist.value = 'N';
		}
		
		return true;
	}
	
	function removeElementAll ( results )
	{
		$("#wishList").html ( "" );
		document.frmProducts.reset ();
	}
	
	function addElement ( element )
	{
		var wishList = $("#wishList");
		
		//	See if the product is already in the wishList
		var id_found = false;
		var list = wishList.find ( "div.wishlistItem" );
		for ( var i = 0; i < list.length; i++ )
		{
			//	see if this is an actual product in the wishlist
			if ( list [i].id.substr ( 0, 17 ) == "wishlist_product_" )
			{
				var list_id = list [i].id.replace ( "wishlist_product_", "" );
				//	match the id's
				if ( list_id == element.id.replace ( "product_id_", "" ) )
				{
					id_found = list_id;
					break;
				}
			}
		}
		
		if ( id_found == false )
		{
			//	this is a new item - create it and append to wishlist
			var the_id = element.id.replace ( "product_id_", "" );
			var newProduct = document.createElement ( "div" );
			newProduct.className = "wishlistItem sep";
			newProduct.id = "wishlist_product_" + the_id;
			id_found = the_id;
			
			var q_input = document.createElement ( "input" );
			q_input.type = "text";
			q_input.id = "quantity_" + the_id;
			q_input.name = "order_quantity_" + the_id;
			q_input.value = "1";
			$(newProduct).append ( q_input );
			
			var inner = "";
			inner += "<b>" + $("#product_" + the_id + " h2:first").text () + "</b>&nbsp;";
			inner += "<a onclick=\"removeElement('" + the_id + "');\" href=\"javascript:;\">(-)</a>";
			$(newProduct).append ( inner );
			wishList.append ( newProduct );
		} else {
			//	this item exists, just increment the quantity
			var elem = $("#quantity_" + id_found);
			elem.val ( parseInt ( elem.val () ) + 1 );
		}
		
		$("#wishlist_product_" + id_found).Highlight ( "slow", "#999" );
		
		return false;
	}
	
	function removeElement ( itemid )
	{
		var theq = $("#quantity_" + itemid);
		
		if ( parseInt ( theq.val () ) > 1 )
		{
			//	just decrement 1
			theq.val ( parseInt ( theq.val () ) - 1 );
			theq.parent().Highlight ( "slow", "#900" );
		} else {
			//	remove the item completely
			var elem = theq.parent().remove();
		}
		
		return false;
		var thisdiv = "my" + itemid + "Div";
		var thisfield = "fld" + itemid;
		var fieldvalue = document.getElementById ( thisfield ).value;
		var tempfieldvalue = "";

		if ( fieldvalue > 1 )
		{
			tempfieldvalue = fieldvalue - 1;
			document.getElementById ( thisfield ).value = tempfieldvalue;			
		} else {
			var d = document.getElementById ( 'prodOrderListDiv' );
			var olddiv = document.getElementById ( thisdiv );
			d.removeChild ( olddiv );
		}

		for ( i = 0; i < prodcount; i++ )
		{
			if ( prodArray [i] == itemid )
			{				
				prodArray [i] = "";
				noOfitems--;
				prodcount--;
			}
		}

		$('#' + thisdiv).Highlight ( 500, '#900' );
		return false;
	}
