/* 
JavaScript Document
Developer: Muthuswamy K
E-Mail: muthu.work@gmail.com
Web: http://www.muthuswamy.in
*/


$(document).ready(function(){

	/* Left Category Menu */
	$("ul#cat-list > li > a").not("a:only-child").addClass("ui-header");
	$('ul#cat-list').accordion({clearStyle: 'true',collapsible: 'true',active: '.selected',header: '.ui-header'});
	
	/* Main navigation */
	$("#navigation li").hover(
		function(){$(this).addClass("over");},
		function(){$(this).removeClass("over");}
	);
	
	/* Comment Toggle */
	$(".comment-area-toggle").click(
		function(){
			$("#hotel-info-box").hide("slow");
			$("#comment-area-holder").toggle("slow");
		}
	);
	
	/* Hotel Toggle */
	$(".hotel-info-toggle").click(
		function(){
			$("#comment-area-holder").hide("slow");
			$("#hotel-info-box").toggle("slow");
		}
	);
	
	$("#mini-contact-form form").submit(function(){
		var str = $(this).serialize();

		$.ajax({
		type: "POST",
		url: "http://www.reseskaparna.se/wp-content/themes/reseskaparna/script/contact.php",
		data: str,
		success: function(msg){

			$("#note").ajaxComplete(function(event, request, settings){

			if(msg == 'OK')
			{	
				result = 'Tack f&ouml;r att du anm&auml;lt dig till v&aring;rt nyhetsmail!';
				$("#mini-contact-form").hide();
			}
			else result = msg;
			
			$(this).html(result);

			});
		}});

	return false;

	});
});