
function links(){
	
	// apply arrow on "add to cart" links
	$("a.cart").after("<img class='arrow' src='/images/arrow_0066cc.png' width='5' height='7' />");
	$("a.cart").hover(
		function(){
			$(this).next("img.arrow").remove();
			$(this).after("<img class='arrow' src='/images/arrow_000000.png' width='5' height='7' />");
		}, 
		function(){
			$(this).next("img.arrow").remove();
			$(this).after("<img class='arrow' src='/images/arrow_0066cc.png' width='5' height='7' />");
		}
	);
	
	// apply arrow on "continue shopping" links
	$("a.continue").before("<img class='arrow' src='/images/arrow_0066cc_left.png' width='5' height='7' />");
	$("a.continue").hover(
		function(){
			$(this).prev("img.arrow").remove();
			$(this).before("<img class='arrow' src='/images/arrow_000000_left.png' width='5' height='7' />");
		}, 
		function(){
			$(this).prev("img.arrow").remove();
			$(this).before("<img class='arrow' src='/images/arrow_0066cc_left.png' width='5' height='7' />");
		}
	);
	
	// make entire "featured sale" area clickable
	$("div.featured-sale").click(function () {
		var url = $(this).find("a").attr('href');
		window.location = url;
	});
	
	// add active state to and make entire "product" area clickable	
	$("div.product").hover(
		function() { $(this).addClass("active"); }, 
		function() { $(this).removeClass("active"); }
	);
	$("div.product").click(function () {
		var url = $(this).find("a").attr('href');
		window.location = url;
	});
	
}

function zoom(){
	var options2 = {
		zoomWidth: 250,
		zoomHeight: 310,
		zoomType:'reverse'
	}
	$(".jqzoom").jqzoom(options2);
}

function checkout(){
	$("input.options").click(function(){
		checkoutForms();
	});
}

function checkoutForms(){
	if ( $("input#option1").attr("checked") ) {
		$("form#login").show();
		$("div#whichForm form").remove();
	}
	if ( $("input#option2").attr("checked") ) {
		$("form#login").hide();
		$("div#whichForm").load("/includes/form2.shtml");
	}
	if ( $("input#option3").attr("checked") ) {
		$("form#login").hide();
		$("div#whichForm").load("/includes/form3.shtml");
	}
}

function dropDown(){
	$("div.header ul li").hover(
		function() {
			$(this).children("ul").show();
		}, 
		function() {
			$(this).children("ul").hide();
		}
	);
}

function adminDoEraseImage(product_id,image_index){
	$("#image_div_"+image_index).load("/administration/phpworx/index.php?cmd=admin-products&action=erase-image&id="+product_id+"&image_index="+image_index);
	return false;
}
