
$(document).ready(function(){
	// Z - Index IE 6/7 Fix
	/*
	$(function() {
		var zIndexNumber = 10000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 1;
		});
	});*/
	autoScroller('.box647NewsContent', 2, 1, 10, 10);
});	

function imageSwap(link,id,overIm) {
	if(document.images) {
	im            = document.images[id];
	im.outIm      = new Image();
	im.overIm     = new Image();
	im.outIm.src  = document.images[id].src;
	im.overIm.src = overIm;
	im.src        = im.overIm.src;
	link.onmouseout  = new Function("var im=document."+id+"; im.src=im.outIm.src;");
	link.onmouseover = new Function("var im=document."+id+"; im.src=im.overIm.src;");
	}
}

/* does not allow adding to basket unless filled selected size and quantity correctly */
$(document).ready(function() {
	$("#itemSize").change(function(){
								   
				
		if($(this).val() != "FALSE" && $("#itemQuantity").val() != "FALSE" && $("#itemQuantity").val() != "Qty") 
		{
			
			$('#buttonID').removeAttr("disabled");
		
		}
		else
		{
		
			$('#buttonID').attr("disabled", "disabled");
		
		}
	})
	
	$("#itemQuantity").change(function(){
		if($(this).val() != "FALSE" && $("#itemSize").val() != "FALSE" && $("#itemSize").val() != "Qty") 
		{
			$('#buttonID').removeAttr("disabled");
		
		}
		else
		{
			$('#buttonID').attr("disabled", "disabled");
		}
	})
		
	// on blur hide the search
	$('#searchTerm').bind('blur',function(){
		$('#searchPreview').html("");		
	});
	
	// allow clicking on the search results, then allow blur on mouse out.
	$('#searchPreview').hover(
		function(){
			$('#searchTerm').unbind('blur');
		},
		function(){
			$('#searchTerm').bind('blur',function(){
				$('#searchPreview').html("");		
			});
		}
	);         
});