/*
var boards_delivery = new Array();
boards_delivery[0] = 0.00;
boards_delivery[1] = 7.00;
boards_delivery[2] = 11.00;
boards_delivery[3] = 11.00;
boards_delivery[4] = 11.00;

var sticks_delivery = new Array();
sticks_delivery[0] = 0.00;
sticks_delivery[1] = 3.25;
sticks_delivery[2] = 3.25;
sticks_delivery[3] = 6.50;
sticks_delivery[4] = 6.50;

var one_board_one_stick_delivery = 7.00;
*/
function updateTotalPrice() {
	var totalPrice = 0;
	//var numBoards = 0;
	//var numSticks = 0;
	$("#productSelectionForm select").each(function(){
		var id = $(this).attr("id").split("_");
		var qty = $(this).val();
		if(parseInt(qty) > 0) {
			//if(id[2] == 'board') { numBoards += parseInt(qty); }
			//if(id[2] == 'stick') { numSticks += parseInt(qty); }
			totalPrice += parseFloat($("#"+id[0]+"Price_"+id[1]).html())*parseInt(qty);
		}
	});
	//if(numBoards == 1 && numSticks == 1) { deliveryPrice = one_board_one_stick_delivery; }
	//else { deliveryPrice = boards_delivery[numBoards]+sticks_delivery[numSticks]; }
	//$("#subtotal").html(totalPrice.toFixed(2));
	//$("#total").html((totalPrice+deliveryPrice).toFixed(2));
	//$("#delivery").html(deliveryPrice.toFixed(2));
	$("#total").html((totalPrice).toFixed(2));
}
$(document).ready(function() {
	$("#productSelectionForm select").change(function(){
		updateTotalPrice();
	});
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.8, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
		modal: false, /* If set to true, only the close button will close the window */
		changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
		callback: function(){} /* Called when prettyPhoto is closed */
	});
	$("a.home_link").hover(
		function () { $(this).find("img").attr("src","/img/button_home_over.jpg"); }, 
		function () { $(this).find("img").attr("src","/img/button_home_norm.jpg"); }
	);
	$("a.about_link").hover(
		function () { $(this).find("img").attr("src","/img/button_about_over.jpg"); }, 
		function () { $(this).find("img").attr("src","/img/button_about_norm.jpg"); }
	);
	$("a.boards_link").hover(
		function () { $(this).find("img").attr("src","/img/button_boards_over.jpg"); }, 
		function () { $(this).find("img").attr("src","/img/button_boards_norm.jpg"); }
	);
	$("a.sticks_link").hover(
		function () { $(this).find("img").attr("src","/img/button_sticks_over.jpg"); }, 
		function () { $(this).find("img").attr("src","/img/button_sticks_norm.jpg"); }
	);
	$("a.buy_link").hover(
		function () { $(this).find("img").attr("src","/img/button_buy_over.jpg"); }, 
		function () { $(this).find("img").attr("src","/img/button_buy_norm.jpg"); }
	);
	$("div.left_nav_item").hover(
		function () {
			$(this).css("background-image","url(/img/new_left_nav_over.jpg)");
			$(this).find("a").css("color","#fff");
		}, 
		function () {
			$(this).css("background-image","url(/img/new_left_nav_norm.jpg)");
			$(this).find("a").css("color","#262161");
		}
	);
});

