$(document).ready(function() {
	//$("img[title]").tooltip('#navtip'); 
	//$("#nav3 a[title]").tooltip('#navtip'); 
	var hoff=0;
	var hoff2=-10;
	if ($.browser.msie) {
	   hoff=-12; hoff2=-23;
	} else {
		$("#navtip_r").css("padding-top","18px");
	}
	$("#nav3 a[title]").tooltip({
		tip:'#navtip',
		effect: 'slide', 
		slideOffset: 5,
		offset: [15,hoff],
		position: "bottom center"
	});
	$("#topteaser a[title]").tooltip({
		tip:'#navtip_r',
		effect: 'slide', 
		slideOffset: 20,
		offset: [-53,5],
		position: "bottom left"
	});
	$("#right a[title]").tooltip({
		tip:'#navtip_r',
		effect: 'slide', 
		slideOffset: 5,
		offset: [3,hoff2],
		position: "center left"
	});
	$(document).pngFix();
	
	function teaser_fade() {
		$('#topteaser img').fadeTo('slow',0.5,function(){
			$('#topteaser img').fadeTo('slow',0.99);
		});
	}
	function teaser_fade2() {
		$('#topteaser img').animate({
		    //opacity: 0.5,
			width: "100",
			height: "100",
		    //left: '+=50'
		    //height: 'toggle'
		  }, 500, function() {
			    $('#topteaser img').animate({
				    //opacity: 0.99,
					width: "122",
					height: "122",
				    //left: '-=50'
				    //height: 'toggle'
				  }, 500
				);
		});
	}
	
	teaser_interval = setInterval(teaser_fade2,2000);
			
	$('#photos').galleryView({
		panel_width: 500,
		panel_height: 250,
		frame_width: 70,
		frame_height: 30,
		overlay_color: '#222',
		overlay_text_color: 'white',
		caption_text_color: '#222',
		background_color: 'black',
		border: '2px',
		nav_theme: 'dark',
		//easing: 'easeInOutQuad',
		transition_speed: 800,
		transition_interval: 4000,
		pause_on_hover: true,
		show_captions: true,
		paused: true,
		border: '1px solid black',
	});
	
		
	/*$("a.popup").fancybox({
			'hideOnContentClick': false,
			'overlayColor': '#C3B29D',
			'overlayOpacity'	:	0.7,
			'zoomSpeedIn'		:	500,
			'zoomSpeedOut'		:	500,
			'frameWidth'		: 	900, 
			'callbackOnStart'	: function(){
				//$('#pageframe').slideUp();
				$('#content').slideUp();
				$('#footer').slideUp();
			},
			'callbackOnClose'	: function(){
				//$('#pageframe').slideDown();
				$('#content').slideDown();
				$('#footer').slideDown();
			}
	});

	$("a.zoom1").fancybox({
		'overlayOpacity'	:	0.7,
		'overlayColor'		:	'#C3B29D'
	});

	$("a.zoom2").fancybox({
		'zoomSpeedIn'		:	500,
		'zoomSpeedOut'		:	500,
		'overlayShow'		:	false
	});*/
	/*
	$("a[rel]").overlay({ 

	        expose: 'white', 
	        effect: 'apple', 

	        onBeforeLoad: function() { 

	            // grab wrapper element inside content 
	            var wrap = this.getContent().find(".contentWrap"); 

	            // load the page specified in the trigger 
	            //wrap.load(this.getTrigger().attr("href")); 
				wrap.html('<img src="'+this.getTrigger().attr("href")+' width="100%"">');
	        } 

	  });*/
});
