$(document).ready(function(){	
	//Slider for Portfolio
	$(".btn-slide-internet").click(function(){
		$("#panel-internet").slideToggle("slow");
	});	
		$(".btn-slide-print").click(function(){
		$("#panel-print").slideToggle("slow");
	});	
	// activates the lightbox page, if you are using a dark color scheme use another theme parameter
	my_lightbox("a[rel^='prettyPhoto'], a[rel^='lightbox']");
	
	//Bild bewegen (in Pixel)
	var move = -20;
	
	//Zoom, 1.2 =120%
	var zoom = 1.2;

	//On mouse hover
	$('.item').hover(function() {
		
		//Breite und Hoehe mit Zoom berechnen
		width = $('.item').width() * zoom;
		height = $('.item').height()* zoom;
		
		//Bilder bewegen und zoomen
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		
		//Caption anzeigen
		$(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
		//Reset Bild
		$(this).find('img').stop(false,true).animate({'width':$('.item').width(), 'height':$('.item').height(), 'top':'0', 'left':'0'}, {duration:100});	

		//Caption verstecken
		$(this).find('div.caption').stop(false,true).fadeOut(200);
	});
	
});
// Top Slider for Landingpage		
$(function() {
		$('#topslider').tabs({ fx: [{opacity:'toggle', duration:'slow'},{opacity:'toggle', duration:'fast'}] }).tabs('rotate', 4000);
	});
//Lightbox
function my_lightbox($elements)
{
	jQuery($elements).prettyPhoto({
			"theme": 'light_square' /* light_rounded / dark_rounded / light_square / dark_square */																
		});
	jQuery($elements).each(function()
	{	
		var $image = jQuery(this).contents("img");
		$newclass = 'lightbox_video';
		if(jQuery(this).attr('href').match(/(jpg|gif|jpeg|png|tif)/)) $newclass = 'lightbox_image';
		if ($image.length > 0)
		{	
			if(jQuery.browser.msie &&  jQuery.browser.version < 7) jQuery(this).addClass('ie6_lightbox');			
			var $bg = jQuery("<span class='"+$newclass+" ie6fix'></span>").appendTo(jQuery(this));
			jQuery(this).bind('mouseenter', function(){
				$height = $image.height();
				$width = $image.width();
				$pos =  $image.position();		
				$bg.css({height:$height, width:$width, top:$pos.top, left:$pos.left});
			});
		}
	});	
jQuery($elements).contents("img").hover(function(){
			jQuery(this).stop().animate({opacity:0.5},400);
		},function(){
			jQuery(this).stop().animate({opacity:1},400);
		});
}
