if(!doc) var doc = document; if(!win) var win = window;
/*----------------------CUFON-------------------------------------*/

	Cufon.replace('#navi li a',{hover:'true',textShadow: '1px 1px rgba(0, 0, 0, 1)'});
	Cufon.replace('#navi-add',{ hover:'true',textShadow: '1px 1px rgba(0, 0, 0, 1)'});
	Cufon.replace('h3',{hover:'true',textShadow: '1px 1px rgba(255, 255, 255, 1)'});
	Cufon.replace('h2',{hover:'true',textShadow: '1px 1px rgba(255, 255, 255, 1)'});
	Cufon.replace('#content-sidebar',{hover:'true'});
	Cufon.replace('#footer-address',{hover:'true'});

/*-----------------------------------------------------------
    to encrypt e-mail address
    ---------------------------------------------------------*/
	
function noSpam() {
    if (doc.getElementById) {
		var at = "@";
	  	var links = doc.getElementsByTagName('a');
	  
	  	for (var i = 0; i < links.length; i++) {
		  	var linkElem = links[i];
			
		  	if (linkElem.className == 'escape') {
		  		var mail = linkElem.firstChild; var domain = linkElem.lastChild;
		  		mail.nextSibling.firstChild.innerHTML = at;
		  		linkElem.href = "mailto:" + mail.data + at + domain.data;
		  	}
			
	  	} 
	  
    } 
}

/*--- branding ------------------------------------*/

jQuery(doc).ready(function(){
var Duration = 1200; //time in milliseconds

	     
		  jQuery('h1')
		  	.mouseenter(function(){
				jQuery(this).not(':animated').animate({ left: 640 }, Duration);
			})
			.mouseleave(function(){
				jQuery(this).animate({ left: 660 }, Duration);   
			});
		  
		   /*jQuery('h1#branding a,').hover(function() {
	        jQuery(this).animate({ backgroundPosition: '-10px 0' }, Duration);
	      }, function() {
	        jQuery(this).animate({ backgroundPosition: '10px 0' }, Duration);   
		  });*/
				
});

/*-----------------------------------------------------------
    to start functions
    ---------------------------------------------------------*/
	 
jQuery(function(){ 
	noSpam();
});


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

/*--- fancybox ------------------------------------*/

		jQuery(doc).ready(function() {
			jQuery("a.zoom2").fancybox({
				'easingIn, easingOut': true, 
				'zoomSpeedIn'		:	500,
				'zoomSpeedOut'		:	500,
				'overlayOpacity'	:	0.2,
				'overlayColor'		:	'#666'
			});
		});




/*--- accordion ------------------------------------*/

function acc(){
	var active = 'activeClick';
	var toggle = 'click';
	var content = 'inhalt';
	var accAnchor = 'accAnchor';

	jQuery('.'+content).hide();
	jQueryactive = jQuery('#'+doc.URL.split("#")[1]);
	activeText = jQuery.trim(jQueryactive.text());
/*	jQueryactive = activeText.length == 0 ? jQuery('.'+toggle+':first') : jQueryactive;
	jQueryactive.addClass(active).next('.'+content).show(10,function(){
		if(activeText.length != 0){
			var top = jQueryactive.offset().top;
			jQuery(window).scrollTop(top);
		}
	});*/
	jQuery('.'+toggle+', .'+accAnchor).click(function(){
		jQuerythis = jQuery(this);
		jQuerytoggler = jQuerythis.hasClass(toggle) ? jQuerythis : jQuery(jQuery(this).attr('href'));
		var hidden = jQuerytoggler.next('.'+content).is(':hidden') ? true : false;
		jQuery('.'+content).slideUp(300);
		jQuery('.'+active).removeClass(active);
		if(hidden){
			jQuerytoggler.addClass(active).next('.'+content).slideDown(300);
		};
	});
};
