// JavaScript Document

	$(function() {
		$("#accordian").accordion({
			header: ".acc-header",
			autoHeight: false 
		});		
	});
	
$(function() {
    Count= 3;
    ShowItems();
    $("#add-acc").click(function(){
        Count = Count + 1;
        ShowItems();
    });
    $("#remove-acc").click(function(){
        Count = Count - 1;
        ShowItems();
    });
});

function ShowItems() {
    if (Count > $("#accordian .acc-header").size()) { Count = $("#accordian .acc-header").size() };
    $("#accordian .acc-header:lt(" + Count + ")").slideDown("slow");
    $("#accordian .acc-header:gt(" + (Count - 1) + ")").slideUp("slow");
	if (Count == 1) {
	$("#remove-acc").hide();
	}
	if (Count != 1) {
	$("#remove-acc").show();
	}
	if (Count == $("#accordian .acc-header").size()) {
	$("#add-acc").hide();
	}
	if (Count != $("#accordian .acc-header").size()) {
	$("#add-acc").show();
	}
	var total = $("#accordian .acc-header").size();
	$("#countdis").text( Count + " of " + total + " displayed." );
	}
	


$(function() {
    Countleft= 3;
    ShowItemsleft();
    $("#add-item").click(function(){
        Countleft = Countleft + 1;
        ShowItemsleft();
    });
    $("#remove-item").click(function(){
        Countleft = Countleft - 1;
        ShowItemsleft();
    });
});

function ShowItemsleft() {
    if (Countleft > $("#column1 .left-item").size()) { Countleft = $("#column1 .left-item").size() };
    $("#column1 .left-item:lt(" + Countleft + ")").slideDown("slow");
    $("#column1 .left-item:gt(" + (Countleft - 1) + ")").slideUp("slow");
	if (Countleft == 1) {
	$("#remove-item").hide();
	}
	if (Countleft != 1) {
	$("#remove-item").show();
	}
	if (Countleft == $("#column1 .left-item").size()) {
	$("#add-item").hide();
	}
	if (Countleft != $("#column1 .left-item").size()) {
	$("#add-item").show();
	}
	var totalleft = $("#column1 .left-item").size();
	$("#countdis-left").text( Countleft + " of " + totalleft + " displayed." );
	}	

$(function() {
    Counttip= 5;
    ShowItemsTip();
    $("#add-tip").click(function(){
        Counttip = Counttip + 1;
        ShowItemsTip();
    });
    $("#remove-tip").click(function(){
        Counttip = Counttip - 1;
        ShowItemsTip();
    });
});

function ShowItemsTip() {
    if (Countleft > $("#tipples-list li").size()) { Counttip = $("#tipples-list il").size() };
    $("#tipples-list li:lt(" + Counttip + ")").slideDown("slow");
    $("#tipples-list li:gt(" + (Counttip - 1) + ")").slideUp("slow");
	if (Counttip == 1) {
	$("#remove-item").hide();
	}
	if (Counttip != 1) {
	$("#remove-tip").show();
	}
	if (Counttip == $("#tipples-list li").size()) {
	$("#add-tip").hide();
	}
	if (Counttip != $("#tipples-list li").size()) {
	$("#add-tip").show();
	}
	var totaltip = $("#tipples-list li").size();
	$("#counttipdis").text( Counttip + " of " + totaltip + " displayed." );
	}	

$(function() {
    $(".carousel").jCarouselLite({
		auto: 2500,
		speed: 1500,
		visible: 4
    });
});

$.ajax({
  url: "quotes.htm",
  cache: false,
  success: function(html){
    $("#header").append(html);
 }
});

$(function() {
	 var quotes= $("#header > blockquote");
	 var randomNum = Math.floor(Math.random()* quotes.length);
	$('blockquote:eq(' + randomNum + ')').css("display", "block");
});
