jQuery(document).ready(function() {
	jQuery("#gallery_output img").not(":first").hide();

	jQuery("#gallery a").click(function() {								
		if ( jQuery("#" + this.rel).is(":hidden") ) {
			if ($.browser.msie) {
    			jQuery("#gallery_output img").hide();
				jQuery("#" + this.rel).show();
            }
			else{
				jQuery("#gallery_output img").fadeOut("slow");
				jQuery("#" + this.rel).fadeIn("slow");
			}
		}
	});
	jQuery('#quotes').load('scripts/quotes/quotes.html');
});

jQuery(function() {
	jQuery( "#tabs" ).tabs();
});

jQuery(document).ready(function(){
  jQuery('.spin').spin({min: 0});
});


$(document).ready(function() 
{ 
    var $dialog = $('<div></div>')
		.html('Please add at least one item')
		.dialog({
			autoOpen: false,
			title: 'Oops!',
			buttons: { "Ok": function() { $(this).dialog("close"); } },
			modal: true
		});
	
	$("#addItems").submit(function() 
    { 
        if (!isCheckedById("itemnum")) 
        { 
            $dialog.dialog('open'); 
            return false; 
        } 
        else 
        { 
            return true; //submit the form 
        } 
    }); 
 
    function isCheckedById(id) 
    { 
        var checked = $("input[@id="+id+"]:checked").length; 
        if (checked == 0) 
        { 
            return false; 
        } 
        else 
        { 
            return true; 
        } 
    } 
});

jQuery(document).ready(function() {
		var max_size = 100;
		$('.resize').resize(max_size);
});

jQuery(document).ready(function() {
		var $tabs = $('#descriptionTabs').tabs();
		$('#reviewsLink').click(function () {
			$tabs.tabs('select', 1); // switch to reviews tab
    		return false; 
    	});
});

jQuery(document).ready(function() {
				var now = new Date();
				var hour = now.getHours();
				var pm = 23;
				if( (hour > 11) && (hour < 23) ) {
					pm = 23;
				}
				jQuery('#countdown_dashboard').countDown({
					targetDate: {
						'day': 		14,
						'month': 	02,
						'year': 	2012,
						'hour': 	23,
						'min': 		59,
						'sec': 		59					}
				});
			});



