$(document).ready(function() {				// extern links	$("a[href^='http']").attr("target", "_blank");	// Thumbs hover	$(".thumbpic").css({opacity: "0"});		$(".thumb").hover(		function(){			$(this).children(".thumbpic").stop().animate({opacity: "1"}, 300, "easeOutQuad");		},		function() {			$(this).children(".thumbpic").animate({opacity: "0"}, 900, "easeOutQuad");		}	);		var hash = window.location.hash;        if(hash) {    	// alert(hash);        // show list?    	var list = hash.match("list");    	if(list) {    		refeRenzen();    	}    }         // navigation     if($.browser.msie) {    	$("#navi ul li").hover(function(){    			$(this).children("ul").css({display: "block"});    		},			function() {    			$(this).children("ul").css({display: "none"});			}		);        } else {    	$("#navi ul li ul").css({opacity: "0", display: "block"});    	$("#navi ul li").hover(function(){    			$(this).children("ul").stop().animate({opacity: "1"}, 200);    		},			function() {    			$(this).children("ul").stop().animate({opacity: "0"}, 300);			}		);        }		// Thumbs ein/ausfahren 	$(".arrow").click(function(){		    $("#thumbscontainer").fadeOut(600);	    	    window.setTimeout(function(){	    	$("#arrow").fadeIn(1200);	    },300);		// change links	    $("#prev a, #next a, .imgLink").each(function() {	    	$(this).attr("href", $(this).attr("href").replace("block","none"));	    }); 	    	});	$("#arrow").click(function(){		$("#thumbscontainer").fadeIn(400);		$("#arrow").hide();		// change links	    $("#prev a, #next a, .imgLink").each(function() {	    	$(this).attr("href", $(this).attr("href").replace("none","block"));	    }); 	});		// fade Img on thumbs in references	$("#thumbscontainer").hover(		function(){			if($("#pic").hasClass("refWrapper")) {				$(".imgWrapper img").stop().animate({opacity: "0.15"},300);			}		},		function() {			if($("#pic").hasClass("refWrapper")) {				$(".imgWrapper img").stop().animate({opacity: "1"},600);			}		}	);		// commissionsoverview	$(".commissionInfo").css({opacity: "0"});	$(".commission").hover(	    function(){	    	$(this).find(".commissionInfo").stop().animate({opacity: "1"},300, "easeInOutQuad");				    },	    function() {	    	$(this).find(".commissionInfo").stop().animate({opacity: "0"},600, "easeInOutQuad");		    }	);	if($.browser.msie) {		$("#commissions #arrowMore").css({display: "none"});		$(".refWrapper .imgWrapper").css({background: "#fff"});					}		// image navigation 	$("#next a,.refWrapper .imgWrapper a,.workWrapper .imgWrapper img").click(function(){		nextImg($(this));		return false;	});	$("#prev a").click(function(){		prevImg($(this));		return false;	});	$(".thumbpic").click(function(){		$imgId = $(this).attr("id");		$imgId = $imgId.replace("pic","");		fadeImg($imgId);		});		// Info	$("a#info").click(function(){		$(".infoclose,.infotext").show();	    $("#infotext").animate({	    	width: "240px"	    }, 400, "easeOutQuad");	    $("#info").hide();	}); 	$("a.infoclose").click(function(){		hideInfo();	}); 	// Menu	if($("body").hasClass("kontakt")) {				$("#menu").click(function(){		    $("#contact").fadeOut(600);		    $("#menu").fadeOut(400);		    window.setTimeout(function(){$("#navi").fadeIn(1800);},400);		    window.setTimeout(function(){$("#logo").fadeIn(1200);},300);		});				// Menu einfahren		$("#logo").click(function(){		    $("#navi").fadeOut(600);		    $("#logo").fadeOut(300);		    window.setTimeout(function(){$("#contact").fadeIn(1000);},600);		    window.setTimeout(function(){$("#menu").fadeIn(1200);},200);		});		} else if(!$("body").hasClass("home")) {				$("#menu").click(function(){		    menuSlideIn();		});		$("#logo,#back,#backToImg").click(function(){			menuSlideOut();		});					}		// Referenzen	$(".closeInfo,#downLoadsLink,#clientListLink").click(function(){		refeRenzen();	});	$("#commissions .arrowLink").click(function() {		nextRef();	});		// Faces	$("#faces .arrowLink,#facesInner").click(function() {		nextFace();	});				// Profil aus- und einfahren	$("#profil #arrowMore").click().toggle(function(){		$("#profilinfo").animate({			width: "240px"		}, 600);		window.setTimeout(function(){			$("#profiltext").animate({				width: "240px"			}, 600);		},250);	}, function() {		$("#profiltext").animate({			width: "0"		}, 600);		$("#profilinfo").animate({			width: "0"		}, 900);	}); 	// impressum schliessen	$("#windowclose").click(function(){		$("#impressum").fadeOut(400);	});			// custom cursor	if(!$.browser.msie) {		$('.imgWrapper img,#facesInner').mouseenter(function(){    			$('#myCursor').show();    	});    	$('.imgWrapper img,#facesInner').mouseleave(function(){    		$('#myCursor').hide();    	});    	$('.imgWrapper img,#facesInner').mousemove(function(e){    		$('#myCursor').css('left', e.clientX - 40).css('top', e.clientY);    	});    } else {    	$('.imgWrapper img,#facesInner').css({cursor: "e-resize"});    }});function menuSlideIn() {	$("#navicontainer").css({display: "block", width: "0"}).animate({	    width: "1940px"	}, 600);	$("#arrowMore").hide(0);	$("#menu").fadeOut(250);	window.setTimeout(function(){	    $("#thumbs,.infoWrapper").fadeOut(180);	},80);	window.setTimeout(function(){	    $("#logo").fadeIn(1200);	},400);}function menuSlideOut() {	$("#navicontainer").animate({	    width: "0"	}, 800);	$("#logo").hide();	window.setTimeout(function(){	    $("#thumbs,#arrowMore,.infoWrapper").fadeIn(800);	    $("#menu").fadeIn(1200);	},400);}function refeRenzen() {	if($("body").hasClass("infoed")) {		$("body").removeClass("infoed");		closeReferenzen();		} else {		$("body").addClass("infoed");		openReferenzen();	}}function openReferenzen() {	$("#referenzInfo").animate({	    width: "450px"	}, 600);	$(".w150").animate({	    width: "75px"	}, 600);	$(".w300").animate({	    width: "150px"	}, 600);	$(".commissionImg").animate({	    left: "-50px"	}, 600);	setTimeout(function(){	    $("#downLoads").animate({	    	width: "180px"	    }, 600);	},250);}function closeReferenzen() {		$("#downLoads").animate({	    width: "0"	}, 600);	$("#referenzInfo").animate({	    width: "0"	}, 900);	$(".w150").animate({	    width: "150px"	}, 600);	$(".w300").animate({	    width: "300px"	}, 600);	$(".commissionImg").animate({	    left: "0"	}, 600);}function nextRef(theId,theClass) {	var $active = $("#commissionsWrapper .active");	var $next =  $active.next().length ? $active.next()        : $(".innerCommissions").eq(0);			closeReferenzen();	   	    $active.animate({        opacity: 0    }, 300, "easeInOutQuad", function(){    	$active.css({width: "0px"});    });    $(".arrowMoreLink").animate({        opacity: 0    }, 300, "easeInOutQuad",function(){    	$(".arrowMoreLink").animate({        	opacity: 1        }, 600, "easeInOutQuad"); 	    });    		    window.setTimeout(function() {        $next.css({display: "block", opacity: "0", width: "900px"}).animate({        	opacity: "1"        }, 800, "easeInOutQuad");    		  	    }, 250);        window.setTimeout(function() {        $active.removeClass('active');        $next.addClass('active');	}, 600); 		}function nextFace() {	var $active = $("#facesInner .active");	var $next =  $active.next().length ? $active.next()        : $(".facesWrapper").eq(0);	            if($.browser.msie) {    	$active.css({display: "none"});    	$next.css({display: "block"});        } else {        	$active.animate({        opacity: 0    	}, 300, "easeInOutQuad");    	   		    	window.setTimeout(function() {    	    $next.css({display: "block", opacity: "0"}).animate({    	    	opacity: "1"    	    }, 800, "easeInOutQuad");    		  	    	}, 250);    }  	            window.setTimeout(function() {        $active.removeClass('active');        $next.addClass('active');	}, 300); 		}function hideInfo() {	$(".infoclose").hide();	$("#infotext").animate({	    width: "0px"	}, 600, "easeOutQuad");	$(".infotext").fadeOut(400, "easeOutQuad");	window.setTimeout(function(){	    $("#info").fadeIn(1000);	},400);}var $imgId = 1;var $lastId;function nextImg(theLink) {	$lastId = $(".imgWrapper").size();			if($imgId == $lastId) {		if($("#pic").hasClass("refWrapper")) {			nextReference(theLink);		} else {			$imgId = 1;				fadeImg($imgId);		}	} else {		$imgId++;		fadeImg($imgId);	}}function prevImg(theLink) {	$lastId = $(".imgWrapper").size();	if($imgId == 1) {		if($("#pic").hasClass("refWrapper")) {			nextReference(theLink);		} else {			$imgId = $lastId;			fadeImg($imgId);		}		} else {		$imgId--;		fadeImg($imgId);	}}function fadeImg(id) {		if(!$("body").hasClass("imaging")) {			hideInfo();			$("body").addClass("imaging");		    	var $active = $('#image div.active');    	var $next = $('#imgWrapper'+id);    	            	// fading image    	    	$active.animate({    		opacity: 0    	}, 300, "easeInOutQuad");      		    	window.setTimeout(function() {    		$next.css({display: "block", opacity: "0"}).animate({    			opacity: "1"    		}, 800, "easeInOutQuad");    		  	    	}, 250);                			window.setTimeout(function() {    	    $active.removeClass('active');    	    $next.addClass('active');			$("body").removeClass("imaging");		}, 600);   	}}function nextReference(theLink) {		hideInfo();		$("body").addClass("imaging");		    var $active = $('#image div.active');    var $nextPage = theLink.attr("href");        // fading image    	    $active.animate({        opacity: 0    }, 300, "easeInOutQuad");      		    window.setTimeout(function() {    	window.location.href = $nextPage;	  	    }, 300); }
