$(document).ready(function(){	
  	///*
	if($("#cycle")){
		//alert('cycle');
		$("#cycle, #cycle_cont").cycle({ 
			fx:    'fade', 
			timeout: 7500,
			speed:    1500, 
			easeing:  true,  
			prev:	'#sliderNext',
			next:	'#sliderPrev'
		  }); 
	}
	
	if($("#slider")){
		//alert('slider');
		$("#slider").easySlider({
			auto: true,
			continuous: true,
			speed: 500,
			pause: 7500,
			nextId: "sliderNext",
			prevId: "sliderPrev"
		});
	};
	
	if($("a.gallery")){
		$("a.gallery").fancybox({
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'hideOnContentClick': true,
			'overlayColor' 	:	'#282828',
			'showNavArrows'	: 	true
		 });
	};
	
	if($("a.overlay-flash")){
		
		$("a.overlay-flash").fancybox({
		 'padding'                : 0,
		 'zoomOpacity'            : true,
		 'zoomSpeedIn'            : 500,
		 'zoomSpeedOut'            : 500,
		 'overlayOpacity'        : 0.75,
		 'frameWidth'            : 530,
		 'frameHeight'            : 400,
		 'hideOnContentClick'    : false
		 });
	}
	
	if($("a.zoom")){
		$("a.zoom").fancyzoom();
	}

	
	/*
	$("#pano_slider").easySlider({
		auto: true,
		continuous: true,
		speed: 7500,
		pause: 500,
		nextId: "panoNext",
		prevId: "panoPrev"
	});
	*/
	
	/*
	// Actions-- Split screen Teaser
	$("#teaserTrinn2").mouseenter(function() {
		if(!$(this).hasClass('over')){
			$('#infoT1').fadeTo('fast', 0.2);
			$('#imageT1 li.blur').fadeIn('slow', function(){										  		
				$(this).addClass('over');
			});
		}					 
	}).mouseleave(function() {
		$('#infoT1').fadeTo('fast', 1);
		$('#imageT1 li.blur').fadeOut('slow', function(){			
			$(this).removeClass("over");
		});
	});
	
	$("#teaserTrinn1").mouseenter(function() {
										   
		if(! $(this).hasClass('over')){
			$('#infoT2').fadeTo('fast', 0.2);
			$('#imageT2 li.blur').fadeIn('slow', function(){													  
				
				$(this).addClass('over');
			});
		}
	}).mouseleave(function() {
		$('#infoT2').fadeTo('fast', 1);
		$('#imageT2 li.blur').fadeOut('slow', function(){
			
			$(this).removeClass("over");
		});
		return;
	});
	*/
	
	/*
	$("a.energy").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'width'			: 	480,
		'height'		:	300,
		'scrolling'		:	'no',
		'type'			:	'iframe',
		'hideOnContentClick': true,
		'overlayColor' 	:	'#282828',
		'showNavArrows'	: 	true
 	 });
	*/
	
	//$('.desc').hide();

});


function initialize(mapId) {
    //var latlng = new google.maps.LatLng(-34.397, 150.644);
	//alert(mapId);
	
	var tretaarn = new google.maps.LatLng(58.86948090417453,5.730346441268921);
    var image = new google.maps.MarkerImage('img/tretaarn_marker.png');
	var marker = new google.maps.Marker({
        position: tretaarn,
        map: map,
        icon: image
    });


	var myOptions = {
      zoom: 15,
      center: tretaarn,
      mapTypeId: google.maps.MapTypeId.SATELLITE
    };
    var map = new google.maps.Map(document.getElementById(mapId), myOptions);
  }
  
function callFancy(my_href) {
	var j1 = document.getElementById("hiddenclicker");
	j1.href = my_href;
	$('#hiddenclicker').trigger('click');
}

/*
function showInfo(my_id) {
	if($('#desc_'+ my_id).hasClass("hide")){		
		
		var jIn = $('#desc_'+ my_id);
		
		jIn.show('fast', function() {
			
			jIn.removeClass("hide");
			jIn.addClass("over");
			//jIn.style = ('z-index:999 !important;');
		});
	}
	//jIn.style('z-index:999 !important;');
	
}

function hideInfo(my_id) {
	var jOut = $('#desc_'+ my_id);
	
	if(jOut.hasClass("over")){		
		jOut.hide('fast', function(){
			jOut.removeClass("over");
			jOut.addClass("hide");
		});
			
	}
	//jOut.style('z-index:0 !important;');
	return;
	
}
*/
