
	// Gallery rollovers
function SwitchPhoto(src,caption)
	{
	document.getElementById("gallery_closeup").style.display='block';
	document.getElementById("gallery_main_image").src=src;
	document.getElementById("gallery_main_caption").innerHTML=caption;
	}



// Search engine friendly link logger
function clickthru(target, supplierid)
	{
    $.get("ajax.aspx", { referurl: target, supplierid: encodeURIComponent(supplierid) });
	return true;
	}


// Search engine friendly link logger
function clickthru_from_variety(target,supplierid,varietyid)
	{
	$.get("../ajax.aspx", { referurl: target, supplierid: encodeURIComponent(supplierid), varietyid: encodeURIComponent(varietyid)} );
	return true;
	}



// Validate new variety submission
function ValidateVarietyRequest(f) {

	    if (f.email.value == "") {
	        alert('Please enter your email address');
	        f.email.focus();
	        return false;
	    }


	    else if (f.varietyname.value == "") {
	        alert('Please enter the name of the variety you want us to add to our database');
	        f.varietyname.focus();
	        return false;
	    }


	    else
	        return true;

	}



// Validate new comment
	function ValidateComment(f) {

	    if (f.email.value == "") {
	        alert('Please enter your email address - we will not publish it');
	        f.email.focus();
	        return false;
	    }


	    else if (f.username.value == "") {
	        alert('Please enter your name, this will be published alongside your comments');
	        f.varietyname.focus();
	        return false;
	    }

	    else if (f.password.value == "") {
	        alert('Please enter a password for your account so that you can sign-in next time if you want to make further comments');
	        f.varietyname.focus();
	        return false;
	    }

	    else
	        return true;

	}


