$(document).ready(function() {		
	// initialize carousel
	$('#navthumb').jcarousel({
        scroll: 3
    });
	
	// style drop down menu for restaurant reservations
	$('#restdd').sSelect();

	// initialize scrollable/*.navigator({navi: ".scrollink", naviItem: 'a', activeClass: 'current', api: true})*/;
	var sApi = $("div.scrollable").scrollable({clickable:false, size: 1}).navigator({navi: ".scrollink", naviItem: 'a', activeClass: 'current', api: true});
	var lApi = $(".horizontal-1").scrollable({clickable:false, size:1, api:true});
	
	// initialize markers to show on group image
	if (sApi.getPageIndex() == 0) {
		$("#markers").show();
		$("#markers-hidden").show();
	};
	
	// hide markers before going to individual restaurant images
	sApi.onBeforeSeek(function(){
	  $('#markers').hide();
	  $("#markers-hidden").hide();
	});
	
	// show/hide markers depending on image being scrolled to
	sApi.onSeek(function(){
		var cur = this.getPageIndex();
		if (cur==0) {
			$('#markers').show();
			$("#markers-hidden").show();
	  	} else {
			$('#markers').hide();		
			$("#markers-hidden").hide();	
		};
    });
	
	/*$("a.marker").click(function () {
  		var index = $("a.marker").index(this);
		sApi.seekTo(index + 1);
		lApi.seekTo(index + 1);
	});*/
	
	$("a.scroll").click(function () {
  		var index = $("a.scroll").index(this);
		sApi.seekTo(index);
		lApi.seekTo(index);
	});
	
	// show tooltips on markers
	$("#markers a[title]").qtip({
	  content: { text: false, 'font-size': 12, 'font-weight':'bold' },
	  position: { corner: { tooltip: 'bottomMiddle' , target: 'topMiddle' } },
      style: { fontSize: 11, 'font-weight':'bold', name: 'dark', tip: 'bottomMiddle', title: { 'color': 'red', 'font-weight': 'bold' }, border: { width: 2, radius: 4 } }
    });
    
	// display colorbox
	$(".myIframe").colorbox({opacity: 0.5, innerWidth:584, innerHeight:400, iframe:true});
});
