/* ****************SOCIAL INK CUSTOM JQUERYDO NOT REPRODUCE WITHOUT PERMISSION********************************************** */jQuery(document).ready(function($) {	/* ******		CLEAR /REPLACE INPUT	****************************** */		var clearMePrevious = '';				// clear input on focus		$('.clearMeFocus').focus(function(){			$(this).addClass('fancyfocus_on');			if($(this).val()==$(this).attr('title')){				clearMePrevious = $(this).val();				$(this).val('');			}		});				// if field is empty afterward, add text again		$('.clearMeFocus').blur(function(){			$(this).removeClass('fancyfocus_on');			if($(this).val()=='') {				$(this).val(clearMePrevious);			}		});						/* ******		BASIC PAGE FUNCTIONS - MENUBAR & SCROLLING & IMAGE FADE	****************************** */					$(".topmenu li.toplevel").click(function(event) {		event.preventDefault();				$(".sub-menu").fadeOut('fast');		$('#contact_popup').fadeOut("fast");				$(".topmenu li.toplevel").not(this).removeClass("auto_expanded");				$(this).toggleClass("auto_expanded");				if($(this).hasClass('auto_expanded'))			$(this).children(".sub-menu").fadeIn('medium');		else			$(this).children(".sub-menu").fadeOut('fast');		});						$(".topmenu .sub-menu").click(function(e) {		e.stopPropagation();		$(this).fadeOut('fast');		$(".topmenu ul li").removeClass("auto_expanded");				});					$('.topmenu .sub-menu a').click(function (e) {  		e.stopPropagation();	});				//contact button	$('#menu-item-2458').click(function (e) {  		e.stopPropagation();								$(".sub-menu").fadeOut('fast');		$(".topmenu li.toplevel").removeClass("auto_expanded");		$(this).toggleClass("contact_expanded");				if($(this).hasClass('contact_expanded'))			$('#contact_popup').fadeIn("medium");		else				$('#contact_popup').fadeOut("fast");					return false;	});		$("#contact_popup").click(function(e) {		e.stopPropagation();		$(this).fadeOut('fast');		$("#menu-item-2458").removeClass("contact_expanded");		});						$("#contactform_content").click(function(e) {		e.stopPropagation();		});									/* HEADER TEASER */		$(window).scroll(function () { 		if(isScrolledIntoView($("#document_end")))			 $("#header_teaser").fadeIn();		else			$("#header_teaser").fadeOut();			});					function isScrolledIntoView(elem)		{			var docViewTop = $(window).scrollTop();			var docViewBottom = docViewTop + $(window).height();			var elemTop = $(elem).offset().top;			var elemBottom = elemTop + $(elem).height();			return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));		}	$("#headerteaser_close").click(function(e) {				$("#header_teaser").fadeOut();		e.preventDefault();		});										/* IMAGE FADE */		$(".rippleimage").hover(function() {		$(this).fadeTo("fast", 0.8);		}, function() {		$(this).fadeTo("fast", 1);	});				/* NICE INPUT FOCUS */		$(".searchsite_box").focus(function () {			$('.headersearch_explanation').fadeIn();		});				$(".searchsite_box").blur(function () {			$('.headersearch_explanation').fadeOut();		});							/* ******		PORTFOLIO	****************************** */			// PORTFOLIO TABS FADE IN AND OUT		$('li#port_button_non-profit').addClass("current_tab");	$('#portfolio_tab0').slideDown();		portfolio_tabs = $(".portfolio_clickers").size();	$('.portfolio_clickers').each(function(index) {		 jQuery(this).bind (		 "click",			 function(){				$('.portfolio_buttons').removeClass('current_tab');				$(this).parents('.portfolio_buttons').addClass("current_tab");				$('.portfolio_tab').fadeOut();				$('#portfolio_tab'+index).fadeIn();								return false;			 }		 );		  	  });				/* ******		INFOCHUNK	****************************** */			// FUNCTIONS FOR EXPANDING AND SO ON	$(".auto_expand_hide").hide();							$(".autoexpand_click").click(function() {			$(this).parents().children(".auto_expand_hide").slideToggle('medium');			$(this).toggleClass("auto_expanded");		});			//always expand first chunk	$("#infochunk1").addClass("auto_expanded");	$("#infochunk1").children('.autoexpand_click').addClass("auto_expanded");	$("#infochunk1").children(".auto_expand_hide").slideToggle('medium');				$(".auto_expand_hide").click(function() {			//$(this).children("h3").removeClass("auto_expanded");			//return false;		});							/* ******		PORTFOLIO SCROLLING	****************************** */			//CYCLE SINGLE  SNIPPETS		$('.portfolio_slideshow').cycle({			fx:       	'scrollHorz',			speed:		500,			timeout:   	0,			next:	'.portfolio_nav_next',			prev:	'.portfolio_nav_prev',			pager:	'.portfolio_thumb_list',							pagerAnchorBuilder: function(idx, slide) { 					return '<li><a href="#"><img src="' + $(slide).find('img').attr('src') + '" class="shadow_module" /></a></li>'; 				} 							});		$(".portfolio_gallery").hover(function() {			$(this).children('.portfolio_navigator').fadeTo("fast", 1);			}, function() {			$(this).children('.portfolio_navigator').hide();		});			$(".portfolio_navbuttons").click(function(e) {		e.preventDefault();		});								/* ******		FRONTPAGE SCROLLING	****************************** */								$('.content_teaser_headersnippets').cycle({			fx:       	'fade',			speed: 		1000,			next:		'.snipclick',			timeout:   	6000,			pause:   	1,		});							$('#fp_slideshow').cycle({			fx:       	'fade',			prev:		"#fp_featured_left",			next:		"#fp_featured_right",			speed: 		500,			timeout:   	0,			pager:  '#fp_slideshow_nav_dots', 			pagerAnchorBuilder: function(idx, slide) { 				return '<a href="#">&#8226;</a>'; 			}				});					/* ******		TEASER AREA	****************************** */			$("#teaserbutton1").hover(		  function () {			$(this).addClass("teaserbutton_active");			$("#teaserbutton2").removeClass("teaserbutton_active");			$("#teasertab1").show();			$("#teasertab2").hide();		  }		);									$("#teaserbutton2").hover(		  function () {					$(this).addClass("teaserbutton_active");			$("#teaserbutton1").removeClass("teaserbutton_active");			$("#teasertab1").hide();			$("#teasertab2").show();					  }		);			$(".teaserbutton").click(function(e) { e.preventDefault();	});					$('.portfolio_module').children('.module_desc').hide();				$(".portfolio_module").hover(function() { 			$(this).children('.module_desc').fadeIn('medium');			}, function() {			$(this).children('.module_desc').fadeOut('fast');		});				});
