var sitefunctions = {
	textresize : function(){
		// show text resizing links
		$(".FontSize").show();
		var $cookie_name = "sitename-FontSize";
		var originalFontSize = $("html").css("font-size");
		// if exists load saved value, otherwise store it
		if($.cookie($cookie_name)) {
			var $getSize = $.cookie($cookie_name);
			$("html").css({fontSize : $getSize + ($getSize.indexOf("px")!=-1 ? "" : "px")}); // IE fix for double "pxpx" error
		} else {
			$.cookie($cookie_name, originalFontSize);
		}
		// reset link
		$(".FontSizeReset").bind("click", function() {
			$("html").css("font-size", originalFontSize);
			$.cookie($cookie_name, originalFontSize);
		});
		// text "+" link
		$(".FontSizeInc").bind("click", function() {
			var currentFontSize = $("html").css("font-size");
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*1.2;
			if(newFontSize, 11) {
				$("html").css("font-size", newFontSize);
				$.cookie($cookie_name, newFontSize);
			}
			return false;	
		});
		$(".FontSizeDec").bind("click", function() {
			var currentFontSize = $("html").css("font-size");
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*0.8;
			if (newFontSize, 11) {
				$("html").css("font-size", newFontSize);
				$.cookie($cookie_name, newFontSize);
			}
			return false;
		});
	}
}

$(document).ready(function() {  
	
	sitefunctions.textresize();
	
	$(".fancybox").fancybox();
	
	$(".fancyframe").fancybox({
		'zoomSpeedIn': 0, 
		'zoomSpeedOut': 0, 
		'overlayShow': true ,
		'frameWidth': 480,
		'frameHeight': 380
	});
	
	$('#mycarousel').jcarousel({
        visible: 4
    });	
	
});
$(function () {
	var tabContainers = $('div.prodtabs > div');
	$('div.prodtabs ul.tabNav a').click(function () {
		tabContainers.hide().filter(this.hash).show();
		$('div.prodtabs ul.tabNav a').removeClass('selected');
		$('div.prodtabs ul.tabNav li').removeClass('current');
		$(this).addClass('selected');
		$(this).parent().addClass('current');
		return false;
}).filter(':first').click();});	


// JavaScript Document
function validate_selection(field) {
	with(field) {
		if (checked==true) {
			return true
		} else {
			return false
		}
	}
}

function validate_form(thisform) {
	if (!document.getElementById('pay1').checked) {
		if (!document.getElementById('pay2').checked) {
			if (!document.getElementById('pay3').checked) {
				alert("You need to select a method of payment")
				return false
			}
		}
	}
}

function deleteitem(code) {
	document.getElementById('delete').value = code;
	document.getElementById('basket').submit();
}
