

	var KareIdx = 1;
	var t;
	function scrPost1() {
			$("#film").animate({left: 0}, 1000);
			$("#info1").fadeIn(800);
			$("#info2").hide();
			$("#info3").hide();
			$("#info4").hide();
			$("#info5").hide();

			$("#post1").addClass("active");
			$("#post2").removeClass(); 
			$("#post3").removeClass(); 
			$("#post4").removeClass(); 

			KareIdx = 1;
	}
	
	
	function scrPost2() {
			$("#film").animate({left: -633}, 1000);
			$("#info1").hide();
			$("#info2").fadeIn(800);
			$("#info3").hide();
			$("#info4").hide();
			$("#info5").hide();

			$("#post2").addClass("active");
			$("#post1").removeClass(); 
			$("#post4").removeClass(); 
			$("#post3").removeClass(); 
			$("#post5").removeClass(); 

			KareIdx = 2;
	}
	
	function scrPost3() {
			$("#film").animate({left: -1266}, 1000);
			$("#info1").hide();
			$("#info2").hide();
			$("#info3").fadeIn(800);
			$("#info4").hide();
			$("#info5").hide();

			$("#post3").addClass("active");
			$("#post1").removeClass(); 
			$("#post2").removeClass(); 
			$("#post5").removeClass(); 
			$("#post4").removeClass(); 

			KareIdx = 3;
	}
	
	function scrPost4() {
			$("#film").animate({left: -1899}, 1000);
			$("#info1").hide();
			$("#info2").hide();
			$("#info3").hide();
			$("#info4").fadeIn(800);
			$("#info5").hide();

			$("#post4").addClass("active");
			$("#post1").removeClass(); 
			$("#post2").removeClass(); 
			$("#post3").removeClass(); 
			$("#post5").removeClass(); 

			KareIdx = 4;
	}
	
	function scrPost5() {
			$("#film").animate({left: -2532}, 1000);
			$("#info1").hide();
			$("#info2").hide();
			$("#info3").hide();
			$("#info4").hide();
			$("#info5").fadeIn(800);

			$("#post5").addClass("active");
			$("#post1").removeClass(); 
			$("#post2").removeClass(); 
			$("#post3").removeClass(); 
			$("#post4").removeClass(); 
			
			KareIdx = 5;
	}
	
	
$(document).ready(function() {
	
	$("#post1").click (function () { scrPost1(); }	);
	
	$("#post2").click (function () { scrPost2(); }	);
	
	$("#post3").click (function () { scrPost3(); }	);
	
	$("#post4").click (function () { scrPost4(); }	);
	
	$("#post5").click (function () { scrPost5(); }	);
	
	$("#kare_left").click (
		function () { 
			clearTimeout(t);
			switch(KareIdx) {
				case 1 : scrPost5(); break;
				case 2 : scrPost1(); break;
				case 3 : scrPost2(); break;
				case 4 : scrPost3(); break;
				case 5 : scrPost4(); break;
			}
			t = setTimeout("scrollKareta()", 5000);
		}	
	);
	
	$("#kare_right").click (
		function () { 
			clearTimeout(t);
			switch(KareIdx) {
				case 1 : scrPost2(); break;
				case 2 : scrPost3(); break;
				case 3 : scrPost4(); break;
				case 4 : scrPost5(); break;
				case 5 : scrPost1(); break;
			}
			t = setTimeout("scrollKareta()", 5000);
		}	
	);
	
	$("#search_country").change(
		function() {
			$("#search_city").load("http://www.loyal-travel.com/loadCity.php?country_id="+$("#search_country").val()); 
		} 
	);
	
	t = setTimeout("scrollKareta()", 5000);
		
});

	function scrollKareta() {
		switch(KareIdx) {
			case 1 : scrPost2(); break;
			case 2 : scrPost3(); break;
			case 3 : scrPost4(); break;

			case 4 : scrPost5(); break;
			case 5 : scrPost1(); break;
			default: scrPost1(); 
		}
		
		t = setTimeout("scrollKareta()", 5000);
	}

