

$(document).ready(function(){
 /*Initiate Home Page Slider*/
  $('#slider').nivoSlider({
	   pauseTime:8000,
	   controlNav: false,
	   effect: 'fade'
	  });
 /**/
 /*Order Page*/
 /*Order Page*/
 var items = new Array(18); //Change this to number of items on the page
 var prices = new Array(18); //Change this to number of items on the page
 $('.qtyForm').change(function() {
	 //Total Products
	 var thisId = $(this).attr('id');
	 var idNo = thisId.split('_');
	 items[idNo[1]] = $('#'+thisId).val();
	 for(var i=0; i<items.length; i++) { //Only Count Numbers in the total
		if (isNaN(items[i]) || items[i] == '') {
    	items[i] = 0
	    } 
	 }
	 var totalPrices = 0;
	 $.each(items,function() {
       totalPrices += parseInt(this);
	 });
  	 $('#totalProducts').text(totalPrices);
});
 /**/
  });
  
  
$(function() {
    $(".carousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		auto: 5000,
   		speed: 1000
    });

    if ($('div#gallery').length) {
        $('div#gallery img').click(function() {
			scroll(0,0);
            $('div#gallery_top img').filter(':visible').fadeOut().end().eq($(this).index() - 1).fadeIn();
        }).css('cursor', 'pointer').eq(0).click();
    }
});




