﻿/// <reference path="jquery-1.4.4.min.js" />
var _defaultBgImage = '';
var _defaultBgColor = '';
var _movie;
function changeSpot() {
 //change bg
 if (_defaultBgImage == '') {
  _defaultBgImage = $('#ContainerMain').css("background-image");
  _defaultBgColor = $('#ContainerMain').css("background-color");
 }
 if (arrBG[_activeSpot - 1] != '') {
  $('#ContainerMain').css('background-image', 'url(' + arrBG[_activeSpot - 1] + ')');
 }
 else {
  $('#ContainerMain').css('background-image', _defaultBgImage);
 }

 if (arrBGColor[_activeSpot - 1] != '') {
  $('#ContainerMain').css('background-color', arrBGColor[_activeSpot - 1]);
 }
 else {
  $('#ContainerMain').css('background-color', _defaultBgColor);
 }


 if ($('#MainSpot .SpotContent ul li:eq(' + (_activeSpot - 1) + ') object').length > 0) {
  eval('movie = window.document.' + $('#MainSpot .SpotContent ul li:eq(' + (_activeSpot - 1) + ') object').attr("id"));

  setTimeout("movie.Rewind()", 133);
  setTimeout("movie.Play()", 133);
 }

 $('#MainSpot .SpotContent .Pager span').attr('class', '');
 $('#MainSpot .SpotContent .Pager span:eq(' + (_activeSpot - 1) + ')').attr('class', 'Active');
 _carousel.scroll(jQuery.jcarousel.intval(_activeSpot));

 // set depending on activeSpot next prev disabled

 $('#MainSpot a#RightArrow').attr('class', '');
 $('#MainSpot a#LeftArrow').attr('class', '');

 if (_activeSpot == _len) {
  $('#MainSpot a#RightArrow').attr('class', 'DRightArrow');
 }
 else if (_activeSpot == 1) {
  $('#MainSpot a#LeftArrow').attr('class', 'DLeftArrow');
 }

 if (_autoPlay) {
  clearInterval(_intAutoPlay);
  _intAutoPlay = setInterval("nextScene()", arrSpotTimer[(_activeSpot - 1)]);
 }

 return false;
}

function nextScene() {
 _activeSpot = ((_activeSpot) % _len) + 1; ;
 changeSpot();

}

var _carousel, _autoPlay = 1, _intAutoPlay = 0, _activeSpot = 1, arrSpotTimer = new Array(), arrBG = new Array(), arrBGColor = new Array(), _len = 0;

function mycarousel_initCallback(carousel) {

 //load
 _len = $('#MainSpot .SpotContent ul li').length;
 _carousel = carousel;
 for (i = 0; i < _len; i++) {
  arrSpotTimer[i] = $('#MainSpot .SpotContent ul li:eq(' + i + ')').attr("t") * 1000;
  arrBG[i] = $('#MainSpot .SpotContent ul li:eq(' + i + ')').attr("bg");
  arrBGColor[i] = $('#MainSpot .SpotContent ul li:eq(' + i + ')').attr("bcolor");

  $('#MainSpot .SpotContent .Pager').append('<span></span>');

 }
 changeSpot();
 $('#MainSpot .SpotContent ul').css('visibility', 'visible');


 //functions
 $('#MainSpot .SpotContent .Pager span').bind('click', function () {
  clearInterval(_intAutoPlay);
  _autoPlay = 0;
  _activeSpot = ($(this).index() - 1 + 2);
  changeSpot();
 });

 $('#MainSpot a#RightArrow').bind('click', function () {
  clearInterval(_intAutoPlay);
  if (_activeSpot < _len) {
   _autoPlay = 0;
   nextScene();
  }
 });

 $('#MainSpot a#LeftArrow').bind('click', function () {
  clearInterval(_intAutoPlay);
  if (_activeSpot > 1) {
   _autoPlay = 0;
   _activeSpot--;
   changeSpot();
  }
 });
};


$(document).ready(function () {
 
  $('#SitemapButton').click(function() {
	$(this).stop(true).toggleClass('out');
	$('.hov').stop(true).toggleClass('hovout');
    $("#PartSitemap").stop(true).toggleClass('bigger');
  return false;
  });

  $('#SitemapButton').hover(function() {

    if ( $(this).hasClass("out") ) {    
	  	  
      $(this).addClass("hovout"); 
		 
    } else {
		  
	  $(this).addClass("hov"); 
      $(this).removeClass("hovout");			 
		  
	}

  }, function(){
	 	 
	 $(this).removeClass("hovout");
	  $(this).removeClass("hov");
  });
  
  

 $("#MainSpot .SpotContent").jcarousel({
  scroll: 1,
  initCallback: mycarousel_initCallback,
  buttonNextHTML: null,
  buttonPrevHTML: null
 });

 $('#ActionMenu ul li a[class^="Icon"]').bind('mouseover', function () {

  if ($('span', this).length == 0) {
   $('<span class="tooltip">' + $(this).attr("title") + '</span>').hide().appendTo(this).show();
   $('span', this).animate({ marginTop: -23 });
  }

 });


 $('#ActionMenu ul li a[class^="Icon"]').bind('mouseleave', function () {
  $('span', this).remove();
 });


});


	$(document).ready(function(){
		$(".dp1").colorbox({rel:'dp1'});
		$(".dp2").colorbox({rel:'dp2'});
		$(".dp3").colorbox({rel:'dp3'});
		$(".dp4").colorbox({rel:'dp4'});
		$(".dp5").colorbox({rel:'dp5'});
		$(".dp6").colorbox({rel:'dp6'});
		$(".dp7").colorbox({rel:'dp7'});
		$(".dp8").colorbox({rel:'dp8'});
		$(".dp9").colorbox({rel:'dp9'});
		$(".dp10").colorbox({rel:'dp10'});
		$(".dp11").colorbox({rel:'dp11'});
		$(".dp12").colorbox({rel:'dp12'});

		$(".og1").colorbox({rel:'og1'});
		$(".og2").colorbox({rel:'og2'});
		$(".og3").colorbox({rel:'og3'});
		$(".og4").colorbox({rel:'og4'});
		$(".og5").colorbox({rel:'og5'});
		$(".og6").colorbox({rel:'og6'});
		$(".og7").colorbox({rel:'og7'});
		$(".og8").colorbox({rel:'og8'});
		$(".og9").colorbox({rel:'og9'});
		$(".og10").colorbox({rel:'og10'});
		$(".og11").colorbox({rel:'og11'});
		$(".og12").colorbox({rel:'og12'});
		$(".og13").colorbox({rel:'og13'});
		$(".og14").colorbox({rel:'og14'});
		$(".og15").colorbox({rel:'og15'});
		$(".og16").colorbox({rel:'og16'});
		$(".og17").colorbox({rel:'og17'});
    	$(".og18").colorbox({rel:'og18'});		
		$(".og19").colorbox({rel:'og19'});
		$(".og20").colorbox({rel:'og20'});
		$(".og21").colorbox({rel:'og21'});
    	$(".og22").colorbox({rel:'og22'});		
		
		$(".kt1").colorbox({rel:'kt1'});
		$(".kt2").colorbox({rel:'kt2'});
		$(".kt3").colorbox({rel:'kt3'});
		$(".kt4").colorbox({rel:'kt4'});
		$(".kt5").colorbox({rel:'kt5'});
		$(".kt6").colorbox({rel:'kt6'});
		$(".kt7").colorbox({rel:'kt7'});

		$(".yo1").colorbox({rel:'yo1'});
		$(".yo2").colorbox({rel:'yo2'});
		$(".yo3").colorbox({rel:'yo3'});
		$(".yo4").colorbox({rel:'yo4'});
		$(".yo5").colorbox({rel:'yo5'});
		$(".yo6").colorbox({rel:'yo6'});
		$(".yo7").colorbox({rel:'yo7'});
		$(".yo8").colorbox({rel:'yo8'});
		$(".yo9").colorbox({rel:'yo9'});
		$(".yo10").colorbox({rel:'yo10'});
		$(".yo11").colorbox({rel:'yo11'});
		$(".yo12").colorbox({rel:'yo12'});
		$(".yo13").colorbox({rel:'yo13'});
		$(".yo14").colorbox({rel:'yo14'});
		
		$(".yeo1").colorbox({rel:'yeo1'});
		$(".yeo2").colorbox({rel:'yeo2'});
		$(".yeo3").colorbox({rel:'yeo3'});
		$(".yeo4").colorbox({rel:'yeo4'});
		$(".yeo5").colorbox({rel:'yeo5'});
		$(".yeo6").colorbox({rel:'yeo6'});
		$(".yeo7").colorbox({rel:'yeo7'});
		$(".yeo8").colorbox({rel:'yeo8'});
		$(".yeo9").colorbox({rel:'yeo9'});
		$(".yeo10").colorbox({rel:'yeo10'});
		$(".yeo11").colorbox({rel:'yeo11'});		
	
		$(".kk1").colorbox({rel:'kk1'});
		$(".kk2").colorbox({rel:'kk2'});
		$(".kk3").colorbox({rel:'kk3'});
		$(".kk4").colorbox({rel:'kk4'});
		$(".kk5").colorbox({rel:'kk5'});
		$(".kk6").colorbox({rel:'kk6'});
		$(".kk7").colorbox({rel:'kk7'});
		
		$(".cu1").colorbox({rel:'cu1'});
		$(".cu2").colorbox({rel:'cu2'});
		$(".cu3").colorbox({rel:'cu3'});
		$(".cu4").colorbox({rel:'cu4'});
		$(".cu5").colorbox({rel:'cu5'});
		$(".cu6").colorbox({rel:'cu6'});
		$(".cu7").colorbox({rel:'cu7'});
        $(".ajax").colorbox();
	});
  

