$(document).ready(function()
{ 	
	$('#comment-form').submit(function()
	{  	
		//var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
		
		var str = $("#comment-form").serialize();
		var path = $("#comment-form").attr("action");
			
		$.ajax(
		{
			type: "POST", url: path, data: str, dataType: "html", timeout: 5000, success: function(data)
			{
				var response = $(data).find('#comment-results').html();
				var msg = $(data).find('#error-msg-js').html();
				
				if (msg)
				{
					$('#error-msg-js-holder').hide().html(msg).fadeIn("slow");
					
					if ($('.panel-msg-confirm'))
					{
						$('.panel-msg-confirm').delay(5000).fadeOut("slow");
						$('#comment-text').val("");
					}
				}
				//$('#comment-results').hide().html(response).show();
			},
			
			error: function ()
			{
			}
		});
						
		return false;
	});
});
$(document).ready(function()
{  
  	//$('.s-list-price-details').tipsy({title: 'title', fade: true, gravity: 'e'});
  	
  	$("#tabbed-news-popular > div").hide();
	$("#tabs-most-commented").show();
	$("#most-commented").attr("class", "ppt-on");
	$("#most-commented").find("span").attr("class", "ppt-on");
	
	$("a.ppt-off").live("click", function()
	{
		$(this).parent().find("a").attr("class", "ppt-off");
		$(this).parent().find("span").attr("class", "ppt-off");
		
		$(this).attr("class", "ppt-on");
		$(this).find("span").attr("class", "ppt-on");
		
		$("#tabbed-news-popular > div").hide();
		$("#tabs-" + $(this).attr("id")).fadeIn();
				
		return false;
	});
	
	$("a.ppt-on").live("click", function()
	{
		return false;
	});
	
	$(".news-menu-list-item").hover(function()
	{
		$(this).next().toggleClass('news-menu-count-rev');
	},
	function()
	{
		$(this).next().removeClass('news-menu-count-rev');
	});
});
