/* Main Navigation hover for IE6 
-------------------------------------*/
sfHover = function() {
var sfEls = document.getElementById("main-nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


var GalleryObject = null;

$(document).ready(function(){
	$("li").hover(
      function () {
        $(this).addClass('active');
      }, 
      function () {
        $(this).removeClass('active');
      }
    );

  	
	
  jQuery(".myscene-list").jcarousel({scroll: 1});
  

   jQuery('.list-slideshow').jcarousel({
        scroll: 1,
        wrap: 'last',
        itemVisibleInCallback:{onBeforeAnimation: mycarousel_itemFirstInCallback}

  });

function display(s) {$('#current').html(s);};

function mycarousel_itemFirstInCallback(carousel, item, idx, state) { 
	display(idx);

};

	// GALLERY HEADER
		var CurrentSelectedID = 1;
		function mycarousel_initCallback(carousel) {
			jQuery('.galleryheader-control div').bind('click', function() {												
				carousel.scroll(parseInt(this.id.replace('Thumb','')));				
				document.getElementById('Thumb'+CurrentSelectedID).className = '';
				CurrentSelectedID = parseInt(this.id.replace('Thumb',''));
				this.className = 'selected';
				return false;
			});
		};
		
		function mycarousel_LoadCallback(carousel, item, idx, state) {	
			document.getElementById('Thumb'+CurrentSelectedID).className = '';
			CurrentSelectedID = idx;
			document.getElementById('Thumb'+CurrentSelectedID).className = 'selected';
		}
		
		
		jQuery(".gallery-slideshow").jcarousel({
			scroll: 1,
			auto: 5,
			wrap: 'last',
			initCallback:mycarousel_initCallback,
			itemVisibleInCallback:mycarousel_LoadCallback
		});
		
	
	// TOP 10
		var CurrentSelectedID = 1;
		function mycarousel_initCallbackTop10(carousel) {
			jQuery('.top10header-control div').bind('click', function() {												
				carousel.scroll(parseInt(this.id.replace('Thumb','')));				
				document.getElementById('Thumb'+CurrentSelectedID).className = '';
				CurrentSelectedID = parseInt(this.id.replace('Thumb',''));
				this.className = 'selected';
				return false;
			});
			jQuery('.top10header-arrow_left').bind('click', function() {
				carousel.prev();
				return false;
			});
		
			jQuery('.top10header-arrow_right').bind('click', function() {
				carousel.next();
				return false;
			});
	
		};
		
		function mycarousel_LoadCallbackTop10(carousel, item, idx, state) {	
			document.getElementById('Thumb'+CurrentSelectedID).className = '';
			CurrentSelectedID = idx;
			document.getElementById('Thumb'+CurrentSelectedID).className = 'selected';
		}
		
		
		jQuery(".top10header-slideshow").jcarousel({
			scroll: 1,
			wrap: 'last',
			buttonNextHTML: null,
      	    buttonPrevHTML: null,
			initCallback:mycarousel_initCallbackTop10,
			itemVisibleInCallback:mycarousel_LoadCallbackTop10
		});		
		
	// FLASH HEADER
		var CurrentSelectedID = 1;
		function mycarousel_initCallbackFlashHeader(carousel) {
			jQuery('.flashHeader-control div').bind('click', function() {												
				carousel.scroll(parseInt(this.id.replace('Thumb','')));				
				document.getElementById('Thumb'+CurrentSelectedID).className = '';
				CurrentSelectedID = parseInt(this.id.replace('Thumb',''));
				this.className = 'selected';
				carousel.startAuto(0);  
				return false;
			});
			jQuery('.flashHeader-arrow_left').bind('click', function() {
				carousel.prev();
				carousel.startAuto(0);
				return false;
			});
		
			jQuery('.flashHeader-arrow_right').bind('click', function() {
				carousel.next();
				carousel.startAuto(0);
				return false;
			});
	
		};
		
		function mycarousel_LoadCallbackFlashHeader(carousel, item, idx, state) {	
			document.getElementById('Thumb'+CurrentSelectedID).className = '';
			CurrentSelectedID = idx;
			document.getElementById('Thumb'+CurrentSelectedID).className = 'selected';
		}
		
		
		jQuery(".flashHeader-slideshow").jcarousel({
			scroll: 1,
			auto: 4,
			wrap: 'last',
			buttonNextHTML: null,
      	    buttonPrevHTML: null,
			initCallback:mycarousel_initCallbackFlashHeader,
			itemVisibleInCallback:mycarousel_LoadCallbackFlashHeader
		});			
		
		if(window.location.hash.substring(1)) {
			window.location.hash = "#"+window.location.hash.substring(1);
		}
		

});



