jQuery(function() {

	jQuery('#dropdown > li').hover(
		function(){
			jQuery(this).find('ul').slideDown('fast');
			jQuery(this).find('a:eq(0)').addClass('activated');												
		},
		function(){
			jQuery(this).find('ul').slideUp(0.001);
			jQuery(this).find('a:eq(0)').removeClass('activated');	
		}
	);

	jQuery('#slide_0').fadeOut(0);
	jQuery('#slide_53').fadeOut(0);
	//$('#slide_106').fadeOut(0);
	jQuery('#slide_159').fadeOut(0);
	jQuery('#slide_212').fadeOut(0);
		   
	jQuery(".newsticker-jcarousellite").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 1,
		auto:1500,
		speed:1000
	});

	
	jQuery('.info').tooltip({
		track: true,
		delay: 500,
		showURL: false,
		extraClass: "right"
	});
	
	jQuery('.slide_left').click(function() {
		
		var left_position = jQuery(this).parent().position().left;
		jQuery(document).stopTime('mytimer');
		
		jQuery('#slide_master').animate({
		    left: jQuery(this).parent().position().left
			}, 400, function() {
			
			showhide(left_position);
			
			
		});
		return false;
	});

	function mygoto(io) {
	
			jQuery('#slide_master').animate({
				left: io
				}, 400, function() {
				
				showhide(io);
				
			});
	
	}
	

	jQuery(document).everyTime(4000, 'mytimer', function() {
		var myrandom = jQuery.random(6);
		if(myrandom == 5) mygoto(0);
		if(myrandom == 1) mygoto(53);
		if(myrandom == 2) mygoto(106);
		if(myrandom == 3) mygoto(159);
		if(myrandom == 4) mygoto(212);
	});
	
});


function showhide(io) {
	
	if(io != 0) jQuery('#slide_0').fadeOut(0);
	if(io != 53) jQuery('#slide_53').fadeOut(0);
	if(io != 106) jQuery('#slide_106').fadeOut(0);
	if(io != 159) jQuery('#slide_159').fadeOut(0);
	if(io != 212) jQuery('#slide_212').fadeOut(0);	

	if(io == 0) jQuery('#slide_0').fadeIn(0);
	if(io == 53) jQuery('#slide_53').fadeIn(0);
	if(io == 106) jQuery('#slide_106').fadeIn(0);
	if(io == 159) jQuery('#slide_159').fadeIn(0);
	if(io == 212) jQuery('#slide_212').fadeIn(0);

}

		jQuery(document).ready(function(){
			//Examples of how to assign the ColorBox event to elements
			jQuery("a[rel='example1']").colorbox();
			jQuery(".example5").colorbox();

			
			//Example of preserving a JavaScript event for inline calls.
			jQuery("#click").click(function(){ 
				jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		});

	  function initialize() {
		var latlng = new google.maps.LatLng(49.58225,17.247248);
		var myOptions = {
		  zoom: 12,
		  scrollwheel: false,
		  center: latlng,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
		  var marker = new google.maps.Marker({
			  position: latlng, 
			  map: map, 
			  title:"Hello World!"
		  });	
	  }
