function addFlowerEvents() {
	$("a.flower").hover(function() {
		var id = this.id.split("_")[1];
		var productcode = this.id.split("_")[2];
		if ($("#slideovertext_"+id).html()=="") {
			$.get("rs/image.php",
				{product_code:productcode},
				function(data) {
					//alert(data);
					eval("var productdata = " + data + ";");
					$("#slideovertext_"+id).html(productdata.name + " $" + parseFloat(productdata.price));
					$("#slideovertextdiv_"+id).show();
					$("#slideoverlink_"+id+"_"+productcode).click(function() {
						//window.location = "index.php?productID=" + productdata.productID;
						$("#waiting_"+id).show();
						getProductDetails(productdata.productID);
					});
				}
			);
		} else {
			$("#slideovertextdiv_"+id).show();
		}
	},function() {
		var id = this.id.split("_")[1];
		$("#slideovertextdiv_"+id).hide();
	});
}

var shortpause = 7000;
var longpause = 20000;
var slideshowtimer = null;
function slideshowpage(topage, blnLongPause) {
	clearTimeout(slideshowtimer);
	if ($("#detailWindow").css("display") == "none" && $("#waiting").css("display") == "none") {
		var src = $("#feature_" + topage).src();
		if (src != null && src.indexOf("spacer.gif")>-1) {
			$("#feature_" + topage).src("products_pictures/feature/feature_" + topage + ".jpg");
		}
		$("#feature_link").html((topage+1) + ". " + features[topage]["name"] + ", $" + features[topage]["price"]);
		if (currentpage == null || topage == currentpage) {
			$("#slidecontainer_" + topage).show();
		} else {
			$("#slidecontainer_" + currentpage).fadeOut(500);
			$("#slidecontainer_" + topage).fadeIn(500);
		}
		currentpage = topage;
	}
	slideshowtimer = setTimeout(
		function() {slideshowforward();},
		blnLongPause == true ? longpause : shortpause
	);
}
function slideshowforward(blnLongPause) {
	var topage = currentpage + 1;
	if (topage >= features.length) topage = 0;
	slideshowpage(topage, blnLongPause);
}
function slideshowback(blnLongPause) {
	var topage = currentpage - 1;
	if (topage < 0) topage = features.length - 1;
	slideshowpage(topage, blnLongPause);
}

