jQuery.noConflict();

var obj = null;

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');	
	} //if
} //checkHover


function slideSwitch() {
    var $active = jQuery('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = jQuery('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : jQuery('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

jQuery(document).ready(function(){
    jQuery(".kklein").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 840,
		'height'			: 600

    });

    jQuery('.sf-menu > li').hover(function() {
      if (obj) {
		    obj.find('ul').fadeOut('fast');
		    obj = null;
	    } //if
	    jQuery(this).find('ul').fadeIn('fast');
	    jQuery(this).find('>a').addClass('inpath');
    }, function() {
	    obj = jQuery(this);
	    jQuery(this).find('>a').removeClass('inpath');
	    setTimeout(
		    "checkHover()",
		    400);
    });


	jQuery('.rahmen-kontakt, .rahmen-startseite, .rahmen-gallery, #body8 .news-list-item, .bilderrahmen, #hauptnav, #hauptnav .menu-level2, .right #inhalt, .right #inhalt h1, #body69 #inhalt, #body69 #inhalt h1, #body69 .csc-frame-frame2, #start-links #c193, #start-links #c435, #start-mitte #c196, #wrapperContent .right .inright .kein-rahmen .csc-default').corner("round 8px").parent().corner("round 10px");
	

	
	
	if(jQuery("#slideshow img").length > 1) {
		jQuery(function() {
    		setInterval( "slideSwitch()", 5000 );
		});
	}
	
	//if (jQuery) { alert("jQuery loaded"); } 
	
	jQuery(".spacer").click(function(){
		jQuery(".spacer").removeClass("active");
		jQuery(this).addClass("active");
	});

	jQuery("#spacer1").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c197").css('display', 'block');


	});

	jQuery("#spacer2").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c199").css('display', 'block');


	});

	jQuery("#spacer3").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c200").css('display', 'block');


	});
	
	jQuery("#spacer4").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c201").css('display', 'block');


	});
	
	jQuery("#spacer5").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c202").css('display', 'block');


	});
	
	jQuery("#spacer6").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c203").css('display', 'block');


	});
	
	jQuery("#spacer7").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c428").css('display', 'block');
	});

	jQuery("#spacer8").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c429").css('display', 'block');


	});

	jQuery("#spacer9").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c430").css('display', 'block');


	});
	
	jQuery("#spacer10").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c431").css('display', 'block');


	});
	
	jQuery("#spacer11").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c432").css('display', 'block');


	});
	
	jQuery("#spacer12").click(function(){
		jQuery("#start-rechts .csc-default").css('display', 'none');
		jQuery("#c433").css('display', 'block');
	});
	

	
	


});







