/**
 * Javascript-Functions - PROJECT
 * (c) CLICKSPORTS DIGITAL SOLUTIONS
 * http://www.clicksports.de
 * 
 * $Rev: 2184 $
 * $Author: mw $
 * $Date: 2010-07-19 15:07:42 +0200 (Mo, 19 Jul 2010) $
 */
 
Cufon.replace('.contents h1');
Cufon.replace('.contents h2');
Cufon.replace('.contents h3');
Cufon.replace('#slider_text h1', { textShadow: '#333 1px 1px' });
Cufon.replace('#navigation li a',{ hover: { hover: true, color: '#0193d0' } });
Cufon.replace('#subnavigation li a em', { hover: { hover: true, color: '#0193d0' }, hoverables: { em: true } });
Cufon.replace('#subnavigation li a span', { hover: { hover: true, color: '#FFFFFF' }, hoverables: { span: true } });

		var CS = {};

		/**
		 * Create placeholder attributes for browsers that don`t support them
		 */
		CS.createPlaceHolders = function() {
			
			$('[placeholder]').focus(function() {
			
				var input = $(this);
				if (input.val() == input.attr('placeholder')) {
			
					input.val('');
					input.removeClass('placeholder');
				}
			}).blur(function() {
			
				var input = $(this);
				if(input.val() === '' || input.val() == input.attr('placeholder')) {
			
					input.addClass('placeholder');
					input.val(input.attr('placeholder'));
				}
			})
			.blur()
			.parents('form').submit(function() {
			
				$(this).find('[placeholder]').each(function() {
			
					var input = $(this);
					if (input.val() == input.attr('placeholder')) {
						
						input.val('');
					}
				});
			});
		}

jQuery(document).ready(function() {
		
		//FANCYBOX SECTION
        jQuery('.contents a img').removeAttr('ismap');

        var allowedExtensions = ['jpg', 'jpeg', 'png', 'gif'];
        jQuery.each(jQuery('.contents a'), function() {
          
                var myext_arr = jQuery(this).attr('href').split('.');
                if(jQuery.inArray(myext_arr[myext_arr.length-1], allowedExtensions) !== -1) {
                        
                        jQuery(this).select
                        jQuery(this).fancybox();
                        $(this).addClass('no_bg');
                        $('<span class="zoom"></span>').appendTo(this);
                }
        });

        jQuery('.images a').fancybox();
    	$(".image_carousel").jcarousel();
		CS.createPlaceHolders();
});

