// Author : Rio Husnady Hidayat | spiderio | http://spiderio.deviantart.com
// DO NOT USE THIS SCRIPT WITHOUT PERMISSION!
$(document).ready(function() {
	
	// Headline BIKINAN SENDIRI 
	var headlineshow = $('#headline > div');
		headlineshow.hide().filter(':first').show();
			
		$('div#headline ul.headline-nav a').hover(function () {
			headlineshow.hide();
			headlineshow.filter(this.hash).show();
			$('div#headline ul.headline-nav a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();
	
	
	// JQUERY TAB BIKINAN SENDIRI 
	var tabContainers = $('div.tabs > div');
		tabContainers.hide().filter(':first').show();
			
		$('div.tabs ul.tabNavigation a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();
	
	// Image SlideShow Spiderio
	var beritashow = $('#beritafoto > div');
		beritashow.hide().filter(':first').show();
			
		$('div#beritafoto ul.beritafoto-nav a').click(function () {
			beritashow.hide();
			beritashow.filter(this.hash).show();
			$('div#beritafoto ul.beritafoto-nav a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();
	//Jcarousel
	$(".jakfot").jCarouselLite({
		auto: 800,
     	speed: 500,
     	btnNext: ".next",
     	btnPrev: ".prev",
		visible: 5,
	 	btnGo: [".jakfot-1", ".jakfot-2", ".jakfot-3", ".jakfot-4", ".jakfot-5", ".jakfot-6"]
	});
	$(".jakhot").jCarouselLite({
		auto: 800,
     	speed: 500,
     	btnNext: ".next",
     	btnPrev: ".prev",
		visible: 5,
	 	btnGo: [".jakhot-1", ".jakhot-2", ".jakhot-3", ".jakhot-4", ".jakhot-5", ".jakhot-6"]
	});
	// HOTEL SPESIAL BIKINAN SENDIRI 
	var hotelshow = $('#hotel > div');
		hotelshow.hide().filter(':first').show();
			
		$('div#hotel ul.hotel-nav a').click(function () {
			hotelshow.hide();
			hotelshow.filter(this.hash).show();
			$('div#hotel ul.hotel-nav a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();
	
	
	 // Instantiate jTicker 
	$("#typewriter").ticker({
 		cursorList:  " ",
 		rate:        90,
 		delay:       8000
	}).trigger("play").trigger("stop");

    // Trigger events 
    $(".stop").click(function(){
        jQuery("#typewriter").trigger("stop");
        return false;
    });

    $(".style").click(function(){
        jQuery("#typewriter")
        .trigger({
            type: "control",
            cursor: jQuery("#typewriter").data("ticker").cursor.css({width: "4em", background: "#efefef", position: "relative", top: "1em", left: "-1em"})
        })
        return false;
    });
	//initMenus();
});
