jQuery(document).ready(function($){
/*$('ul.tableless li').hover(function() {
    var $img = $(this).css({
        'z-index': '10'
    }).find('img').addClass("hover").stop(),
        origSize = $img.data('orig-size'),
        size = origSize || {height: $img.height(), width: $img.width()};
    
    if (!origSize) $img.data('orig-size', size);
    
    $img.animate({
        marginTop: '-10px',
        marginLeft: '-14px',
        width: size.width*1.2,
        height: size.height*1.2
    }, 200);
}, function() {
    var $img = $(this).css({
        'z-index': '0'
    }).find('img').removeClass("hover").stop(),
        
        size = $img.data('orig-size');
    
    $img.animate({
        marginTop: '0',
        marginLeft: '0',
        width: size.width,
        height: size.height
    }, 400)
});
*/
$('.pdetail').hide();

$('.weiter').click(function(element) {
element.preventDefault();
});
$('#weiter-1').toggle(function() {
$('#Programmierung-cms-more').stop().fadeIn("slow");
$('#weiter-1').text("Weniger...");}, 
function(){
$('#Programmierung-cms-more').stop().fadeOut('slow');
$('#weiter-1').text("Mehr...");
});

$(window).scroll(function(){  
  if($(window).scrollTop() > 500){
    $('#back-top').stop().animate({opacity: 1}, 100);
  }else{
    $('#back-top').stop().animate({opacity: 0}, 100);
  }
});

$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
            }
        }
    });
});






$('.kontaktieren a').hover(function() {
    var $vcard = $(this).css({
        'z-index': '10'
    }).find('img').addClass("hover").stop(),
        origSize = $vcard.data('orig-size'),
        size = origSize || {height: $vcard.height(), width: $vcard.width()};
    
    if (!origSize) $vcard.data('orig-size', size);
    
    $vcard.animate({
        marginTop: '-10px',
        marginLeft: '-40px',
        width: size.width*1.33,
        height: size.height*1.33
    }, 200);
}, function() {
    var $vcard = $(this).css({
        'z-index': '0'
    }).find('img').removeClass("hover").stop(),
        
        size = $vcard.data('orig-size');
    
    $vcard.animate({
        marginTop: '0',
        marginLeft: '0',
        width: size.width,
        height: size.height
    }, 500)
});




//Larger thumbnail preview 

/*
$("ul.tableless li").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).find('img').addClass("hover").stop()
		.animate({
			marginTop: '-73px', 
			marginLeft: '-99px', 
			top: '50%', 
			left: '50%', 
			width: '180px', 
			height: '138px',
			padding: '1px' 
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			top: '0', 
			left: '0', 
			width: '130px', 
			height: '100px', 
			padding: '5px'
		}, 400);
});
*/
//Swap Image on Click
/*	$(".ce_gallery ul li a").click(function() {
		
		var mainImage = $(this).attr("href"); //Find Image Name
		$("#main_view img").attr({ src: mainImage });
		return false;		
	});
 */
});
