/* Author: 

*/


jQuery.noConflict();
	jQuery(document).ready(function($) {
								  
		$("#gmkm-home #CU3ER").cu3er({
		  vars: {
			width: 905,
			height: 278,
			flash_version : "10.0.0",
			xml_location : '/CU3ER/HOME/CU3ER-config.xml',
			swf_location: '/js/libs/CU3ER.swf',
			js_location: '/js/libs/jquery.cu3er.player.js',
			folder_images: '/CU3ER/HOME/images',
			folder_fonts: '/CU3ER/HOME/fonts'
		  },
		  params: {
			wmode: 'transparent'
		  },
		  attributes: {
			id: "CU3ER",
			name: "CU3ER"
		  }
		});
		
		
		$("#gmkm-gaz #CU3ER").cu3er({
		  vars: {
			width: 905,
			height: 572,
			flash_version : "10.0.0",
			xml_location : '/CU3ER/GAZ/CU3ER-config.xml',
			swf_location: '/js/libs/CU3ER.swf',
			js_location: '/js/libs/jquery.cu3er.player.js',
			folder_images: '/CU3ER/GAZ/images',
			folder_fonts: '/CU3ER/GAZ/fonts'
		  },
		  params: {
			wmode: 'transparent'
		  },
		  attributes: {
			id: "CU3ER",
			name: "CU3ER"
		  }
		});	
		
		
		$("#gmkm-infocontact #CU3ER").cu3er({
		  vars: {
			width: 905,
			height: 278,
			flash_version : "10.0.0",
			xml_location : '/CU3ER/CONTACT/CU3ER-config.xml',
			swf_location: '/js/libs/CU3ER.swf',
			js_location: '/js/libs/jquery.cu3er.player.js',
			folder_images: '/CU3ER/CONTACT/images',
			folder_fonts: '/CU3ER/CONTACT/fonts'
		  },
		  params: {
			wmode: 'transparent'
		  },
		  attributes: {
			id: "CU3ER",
			name: "CU3ER"
		  }
		});	
		
		
			
		$("#gmkm-work #CU3ER").cu3er({
		  vars: {
			width: 905,
			height: 572,
			flash_version : "10.0.0",
			xml_location : '/CU3ER/WORK/CU3ER-config.xml',
			swf_location: '/js/libs/CU3ER.swf',
			js_location: '/js/libs/jquery.cu3er.player.js',
			folder_images: '/CU3ER/WORK/images',
			folder_fonts: '/CU3ER/WORK/fonts'
		  },
		  params: {
			wmode: 'transparent'
		  },
		  attributes: {
			id: "CU3ER",
			name: "CU3ER"
		  }
		
		
		});	
		var count = 1;
		CU3ER['CU3ER'].onSlide = function(slideNo) {
		//CU3ER['CU3ER'].onTransition = function(slideNo) {
			if( $("#gmkm-work #CU3ER").length > 0 )
			{
					/*
					if(count == 1) {
						setTimeout(function() {CU3ER['CU3ER'].skipTo( 6 );}, 100);
						count++;
					}
					*/
					if( document.location.hash != "" && ! $("#gmkm-work").hasClass('has_shown_startingproject') )
					{
						//alert('load complete and has hash');
						var projectid = document.location.hash;
						//alert(projectid);
						position = $('#CU3ER-no-js li').index( $(projectid) ) ;
						
						//alert(positie);
						// jquery = zero based
						position = position + 1;
						if( position > 0 )
						{
							//alert ('YES asking cu3er to skip to position '+ position  );
							setTimeout(function() {CU3ER['CU3ER'].skipTo( position );}, 100);
							$("#gmkm-work").addClass('has_shown_startingproject');
						}
					}
				
				
				
				var titletext = $('#CU3ER-no-js li').eq(slideNo -1 ).find('h2').html();
				var projecttext = $('#CU3ER-no-js li').eq(slideNo -1 ).find('.project-text').html();
				$("#CU3ER-title").html( titletext );
				$("#CU3ER-text").html( projecttext );
			}
			
		}
		
	//	$('#central').append('<a href="#" class="play-pause playbutton">Play/Pause</a>');
	
	/*	$('#central a.play-pause').click(function(event){
		
			event.preventDefault();
			$(this).toggleClass('playbutton');
			$(this).toggleClass('pausebutton');
			
			if( $(this).hasClass('playbutton') )
			{
				CU3ER['CU3ER'].pause();
			}
			else
			{
				CU3ER['CU3ER'].play();
			}
		
		});
	
		$('#central a.play-pause').mouseenter( function(){ $(this).animate({opacity : 1 }, 300); } );
		$('#central a.play-pause').mouseleave( function(){ $(this).animate({opacity : 0.3 }, 300); } );
	*/		
		$('#main').mouseenter( function(){
			
			CU3ER['CU3ER'].pause();
			$('#central a.play-pause').addClass('playbutton');
			$('#central a.play-pause').removeClass('pausebutton');
			
		});
		
		$('#main').mouseleave ( function(){
			
			CU3ER['CU3ER'].play();
			$('#central a.play-pause').removeClass('playbutton');
			$('#central a.play-pause').addClass('pausebutton');
			
		});
	
  });
	
	
	function workCuberLoaded()
	{
	}

