//IE6 Hover
$(document).ready(function(){	
  	$('#basket_items tr').hover(function() 
		{
			$(this).addClass('table-hover');
		}, 
		function() 
		{
			$(this).removeClass('table-hover');
		});
		
	//Checkout
		
		//Hide Delivery address
        if ($("#shipping-address").is(":checked"))
			{
		      $("#ship-address").css("display","none");
            }
		
		$("#shipping-address").click(function()
		{
			if ($("#shipping-address").is(":checked"))
			{
				$("#ship-address").css("display","none");
				$("#payment").show();
			}
			else
			{     
				$("#ship-address").show();
				$("#payment").hide();
			}       
		});
		
		
		//IE6 Hover
		$('#bag-items tr').hover(function() 
		{
			$(this).addClass('table-hover');
		}, 
		function() 
		{
			$(this).removeClass('table-hover');
		});
        
         //This function deals with shipping addresses in the basket
        $('#us_bill_states').hide();
        $('#us_ship_states').hide();
        
        if($('#country').val()=='US'){
            $('#us_bill_states').show();
        }
        
        if($('#ship-country').val()=='US'){
            $('#us_ship_states').show();
        }     
        
        $('#country').change(function() {
            if($('#country').val()=='US'){
                $('#us_bill_states').slideDown();
            }
            if(($('#country').val()!='US')&&($('#us_bill_states').is(':visible'))){
                $('#us_bill_states').slideUp();
            }
        });
        
        $('#ship-country').change(function() {
            if($('#ship-country').val()=='US'){
                $('#us_ship_states').slideDown();
            }
            if(($('#ship-country').val()!='US')&&($('#us_ship_states').is(':visible'))){
                $('#us_ship_states').slideUp();
            }
        });
		
});


$(document).ready(function(){
  $('#catland-slideshow')   
    .cycle({ 
		fx: 'fade',
		pager : '#controls',
		pagerAnchorBuilder : function(i){
			return $('<li><a href="#"><span class="rem-text">'+i+'</span></a></li>');
		}
    
    });
    
});
