var footerActive = 1;
	var MOVactual = 1;
	var newHTML = "";
	var index = 0;
jQuery.noConflict();

jQuery(document).ready(function() {

	if (jQuery.browser.msie  && parseInt(jQuery.browser.version) == 7) {
		jQuery("#maincoll .csc-textpic").css({ "margin-top" : "19px" }); 
		jQuery("#footerBG").css({ "position" : "static" });
		jQuery("#impBox").css({ "position" : "static" });
		// alert("IE7");
	}

	jQuery("#sword").focus(function(){
	
		jQuery(this).val("");
		
	});
	
	var contentHeight = (jQuery("#contentleiste").height())-317;
	jQuery("#grafikBox").css({ "top" : contentHeight+"px" });
	
	jQuery("#footerClick").click(function(){
	
		if (footerActive==0) {
		
			jQuery("#footerBG").animate({ bottom: "0px"}, 500);
			jQuery("#copyrightContainer").css({"background-image":"url('fileadmin/template/mainsite/images/footer-bar.png')"});
			footerActive = 1;
			
		} else {
			jQuery("#footerBG").animate({bottom:"-200px"}, 500);
			jQuery("#copyrightContainer").css({"background-image":"url('fileadmin/template/mainsite/images/footer-bar-inactive.png')"});
			footerActive = 0;
		}
	
	});
	
	jQuery("#Logobox img").click(function(){
		window.location.href = "http://kunsthalle-schloss-isny.de";
	
	});
	
	// Für die Mediathek

	if (jQuery("table#tableMediathek").length > 0 ){
		newHTML = jQuery(".boxAbsolute:first").html();
		jQuery("table#tableMediathek tr:first").css({ "background-color" : "#efefef" });
		jQuery("#boxPlayer").html(newHTML);
		// jQuery(".boxAbsolute:first").animate({ opacity: 1.0 }, 500);
		
		
		jQuery("table#tableMediathek td").click(function(){
				jQuery("table#tableMediathek tr:eq("+index+")").css({ "background-color" : "#fffdf6" });
				index = jQuery("table#tableMediathek td").index(this);
				
				jQuery("#boxPlayer").animate({ opacity : 0 }, 500);
				setTimeout(function(){
						// alert(index);
						jQuery("table#tableMediathek tr:eq("+index+")").css({ "background-color" : "#efefef" });
						newHTML = jQuery(".boxAbsolute:eq("+index+")").html();

						// alert(newHTML);
						jQuery("#boxPlayer").html(newHTML);
						jQuery("#boxPlayer").animate({ opacity : 1 }, 500);
				}, 1500);
			
		});
	}
	
	VideoJS.setupAllWhenReady();




});


function switchContrast() {

	if (contrast==0){
	
		jQuery("#contentleiste").css({ "background-image":"none","background-color":"#f6f6f6" });
		jQuery(".teaserbox").css({ "background-image":"none","background-color":"#f6f6f6" });
		jQuery("ul#hauptnavi").css({ "background-color":"#FFF" });
		contrast=1;
	} else {
	
		jQuery("#contentleiste").css({ "background-image":"url(fileadmin/template/mainsite/images/body-bg.png)","background-color":"#e6e6e6" });
		jQuery(".teaserbox").css({ "background-image":"url(fileadmin/template/mainsite/images/teaser-bg.png)","background-color":"#f6f6f6" });
		jQuery("ul#hauptnavi").css({ "background-color":"#E9EEF4" });	
		contrast=0;
	}


}
