$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded */
    /*$("#center > div").css('display','none');
    $("#center > #home").css('display','');*/
	/* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */

	/* Binding a click event handler to the links: */
	$('.nav-slide').click(function(e){

		/* Finding the drop down list that corresponds to the current section: */
        var slide = $(this).attr("name");
        /*var dropDown = $(this).parent().next();*/

		/* Closing all other drop down sections, except the current one
		$('#center div').not(slide).slideUp('slow');
        $("#center > div").css('display','none');
        $(slide).css('display','');
        $(slide).fadeIn("slow");  */
        /*$("#center > div").css('display','none');
        $(slide).css('display','');
        $(slide).show("slide", { direction: "right" }, 1000);*/


        if (slide == "home"){
           $("#center").animate({left: "0"}, 3000, "easeOutBounce"  );
         } else if (slide == "service"){
           $("#center").animate({left: "-992px"}, 3000, "easeOutBounce" );
         } else if (slide == "theisland"){
           $("#center").animate({left: "-1984px"}, 3000, "easeOutBounce" );
         } else if (slide == "portfolio"){
           $("#center").animate({left: "-2976px"}, 3000, "easeOutBounce" );
         } else if (slide == "contact"){
           $("#center").animate({left: "-3968px"}, 3000, "easeOutBounce" );
         }

		/* Preventing the default event (which would be to navigate the browser to the link's address) */
		e.preventDefault();
	})
    $(".btn-slide1").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel1").fadeIn("slow");
        even.preventDefault();
		/*$(this).toggleClass("active"); return false;*/
	});
	$(".btn-slide2").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel2").fadeIn("slow");
        even.preventDefault();

	});
	$(".btn-slide3").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel3").fadeIn("slow");
        even.preventDefault();

	});
	$(".btn-slide4").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel4").fadeIn("slow");
        even.preventDefault();

	});

	$(".btn-slide5").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel5").fadeIn("slow");
        even.preventDefault();

	});

	$(".btn-slide6").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel6").fadeIn("slow");
        even.preventDefault();

	});

	$(".btn-slide7").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel7").fadeIn("slow");
        even.preventDefault();

	});

	$(".btn-slide8").click(function(even){
		$(".panelx").css("display", "none");
		$("#paneld").fadeIn("fast");
		$("#panel8").fadeIn("slow");
        even.preventDefault();

	});

	$(".lightclose").click(function(tutup){
		$("#paneld").fadeOut("fast");
		$(".panelx").fadeOut("slow");
        tutup.preventDefault();
	});
    $("#tabnav li").click(function(e){
      var i = thisindex(this);
      $("#tabnav li").removeClass("active");
      $("#tabnav li").addClass("hide");
      $(this).removeClass("hide");
      $(this).addClass("active");
      $("#tabcont div:visible").hide();
      $("#tabcont div:visible").removeClass("active");
      $("div.tabcont:eq(" + i + ")").fadeIn(2000);
      $("div.tabcont:eq(" + i + ")").addClass("active");
      e.preventDefault();

    });
    $(".serv li").click(function(e){
      var i = thisindex(this);
      $(".serv li a").removeClass("active");
      $("a", this).addClass("active");
      $("div.servcont").hide();
      $("div.servcont div:visible").removeClass("active");
      $("div.servcont:eq("+ i +")").fadeIn(1000);
      $("div.servcont:eq("+ i +")").addClass("active");
      e.preventDefault();
    });
    $(".servimg").hover(
    function(){
      $(this).animate({top: "-100px"}, 500, "easeOutBounce"  );
    },
    function(){
      $(this).animate({top: "-75px"}, 500);
    }
    );
    /*$(".tab1").click(function(){
      $("#tabcont div:visible").removeClass("active");
      $("#tabcont div:eq(0)").addclass("active")
    });*/

});

function thisindex(elm)
{
 var the_li = elm;
 var the_ul = elm.parentNode;
 var li_list = the_ul.childNodes;

 var count = 0; // Tracks the index of LI nodes

  // Step through all the child nodes of the UL
  for( var i = 0; i < li_list.length; i++ )
  {
    var node = li_list.item(i);
    if( node )
    {
      // Check to see if the node is a LI
      if( node.nodeName == "LI" )
      {
      // Increment the count of LI nodes
      count++;
      // Check to see if this node is the one passed in
        if( the_li == node )
        {
        // If so, alert the current count
        hasil=count-1;
        return(hasil);
        }
      }
    }
  }
}
        <!--
		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setPanel() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
				    var PanelElement = document.getElementById('paneld')
                    var yscroll  = self.pageYOffset;
					/*var contentHeight = document.getElementById('content').offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.position = 'relative';
						footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
					}
					else {
						footerElement.style.position = 'static';
					}
                    if($("body").height() > $("body").offset().height){
                            var sH = $("body").height();
                        }else{
                            var sH = $("body").offset().height;
                    }*/
                    PanelElement.style.position = 'absolute';
                    PanelElement.style.height = windowHeight + 'px';
                    PanelElement.style.top = yscroll + 'px';
				}
			}
		}
		window.onload = function() {
			setPanel();
		}
		window.onresize = function() {
			setPanel();
		}
        window.onscroll = function() {
			setPanel();
		}
		//-->



