/* News */
$(document).ready(function() {
	$("#latestnews").jCarouselLite({ vertical: true, start: 0, scroll: 1, auto:800, speed:5000,circular: false });
});

/* Banner */
$(function() {
 $('#banner ul').cycle({
		fx: 'fade',
		speed: 2000
	});
});


/* Products Navigation */
$(function() { $( "#p_nav" ).accordion({ collapsible: true, active:false }); });

/* Footer */
$(document).ready(function() {
	
	// Expand Panel
	$("#open").click(function(){
		$("div#footcontent").slideDown("slow");
	
	});	
	
	// Collapse Panel
	$("#close").click(function(){
		$("div#footcontent").slideUp("slow");	
	});		
	
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle span").click(function () {
		$("#toggle span").toggle();
	});		
		
});


/* Mailing List Widget */
$(document).ready(function(){

  
$("#mailing").submit( 
  
    function(){
    	
		var dataString = $(this).serialize();

        $.ajax({
        	type: "POST",
        	url: "ajax/mailing",
        	dataType: "json",
        	data: dataString,
        	cache:false,
        	success: 
         	 function(data){
				if(data.status == "success")
				{
					$('.newsletter_form').html('<p>'+data.message+'</p>');
				}
				else
				{
					alert('Please fill out all fields!');
				}
          	}
        });
		return false;
	});
});



/* Request Sample
$(function() {

	$('.ajax-sample').live({
		click:function()
		{
			var itemlink = $(this).attr('href');
			var theitem = $(this);
			$.ajax({
					   	url: itemlink,
						type: 'POST',
						success: function(msg){
							var div_data = "<p>" + msg + "</p>";
							$(".ajax-sample").html(div_data);
							alert(msg);
						}
			 });
			return false;
		}
	});
});

*/
