$(document).ready(function() {
	$('.styledSelectBox').styledSelect( );
	/*
   	jQuery('#banners').jcarousel({
		auto: 4,
		wrap: 'both',
   		scroll: 1,
        buttonNextHTML: '<img class="next-banner" src="images/womens-jewellery-right.png" alt="next" />',
        buttonPrevHTML: '<img class="previous-banner" src="images/womens-jewellery-left.png" alt="previous" />'
    });
	*/
	$(document).ready(function() {
	$('a[ref=_blank]').attr('target','_blank');
    $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	});
	
    $('a.lighboxImage').lightBox();

    $('#modalSendToFriendButton').click(function(){
    	$('#modalSendToFriend').modal();
    });

	//determine whether to show or hide the form by default
	if ($('#usebillingaddress :radio').attr("id")=='skipyes')
		$('#custom-shipping').hide();
	else
		$('#custom-shipping').show();

	//handle the change of value
	$('#usebillingaddress :radio').click(function(){
		if ($(this).attr("id")=='skipyes') {
			$('#custom-shipping').hide();
		}	else	{
			$('#custom-shipping').show();
	  }
	});

	$('input.changeonclick').each(function(){
		if($(this).val()=='')
				$(this).val($(this).attr('default'));
		$(this).focus(function(){
			if($(this).val()==$(this).attr('default'))
				$(this).val('');
		});
		$(this).blur(function(){
			if($(this).val()=='')
				$(this).val($(this).attr('default'));
		});
	});
	
	$('.read-more-trigger').each(function(){
		$(this).click(function(){
			$(this).parent().next('.read-more-content').slideToggle();
			return false;
		});
	});
});
