res = document.URL.split(/.com/)[1]

$(document).ready(function() { 


	expandingMenu(1); /*<--- falls Sektion Aktuell vorhanden auskommentieren! */
	expandingMenu(2);
	expandingMenu(3);
	expandingMenu(4);
	expandingMenu(5);
	expandingMenu(6);
	expandingMenu(7);
	expandingMenu(8);
	expandingMenu(9);
	expandingMenu(10);
	expandingMenu(11);
	expandingMenu(12);
	expandingMenu(13);
	expandingMenu(14);
	expandingMenu(15);
	expandingMenu(16);
	expandingMenu(17);
	expandingMenu(18);
	expandingMenu(19);
	expandingMenu(20);
	expandingMenu(21);
	expandingMenu(22);
	expandingMenu(23);
	expandingMenu(24);
		

	
	$(".artstripe-th").css({'float':'left', 'margin-right':'14px'});
	$(".artstripe-th").parent(".container").css({'width':'450px'});
	
	
	// Aktuell - auskommentieren falls Kategorie nicht vorhanden! ==============================================================
	
	$(".exception").after("<span class='suckit' style='font-weight: bold; cursor:default; line-height:12px;'>Produktionen</span><br/><br/>");

	$('.suckit').after("<br/>")
	
	$('.suckit').siblings(".section-title, .active, br:last").remove();
		
	var aktuellesprojektname = $("a:contains('Aktuell')").html();
	var aktuellesprojektlink = $("a:contains('Aktuell')").attr("href");
	
	var aktuellesprojektnameohne = aktuellesprojektname.replace(/Aktuell/, "");
	
	$("a:contains('Aktuell')").parent().parent().addClass("aktuellhidden");
	
	$("a:contains('Aktuell')").html($("a:contains('Aktuell')").html().replace(/Aktuell/, ""));
	

	$(".exception>.section-title").css('font-weight','bold');
	
	$('.suckit').before("<span class='aktuell-kategorie' style='font-weight:bold;'>Aktuell</span><br><ul id='aktuell'><li class='aktuell-titel'><a href='" + aktuellesprojektlink + "' style='text-decoration:none; color:#000;'>artstripe No. 11, Michael Part</a></li></ul>");
	
	



	

	
	
	// =========================================================================================================================
	
	if(document.URL.indexOf("marke") != -1){
		$("#content .container div a").hover(function(){
			$(this).css({'text-decoration':'none'});
		},function(){
			$(this).css({'text-decoration':'none'});
		});
	}
	
	
	
	
	$("li:contains('The Vienna Fashion Observ')").html("The Vienna Fashion Observatory, 2009");
	//$("li:contains('Polimekanos')").html("Polimekanos");
	$("#content>.container>p:contains('The Vienna Fashion Observatory')").css({'width':'450px'});
	

	if(document.URL.indexOf('massstab-11') >=0) {
$("#img-container").children("a:nth-child(18)").before("<img src='http://www.liquidfrontiers.com/files/line.gif'><br/><span class='nicetitle'>Ausstellungsansichten:</span><br/><br/>");
	}
	
	if(document.URL.indexOf('stateofflux') >=0) {
$("#img-container").css({'width':'420px'});
	}
	

	if ($('body').attr('class') == "section-17"){
			$("#img-container").children("a:nth-child(22)").before("<img src='http://www.liquidfrontiers.com/files/line.gif'><br/><span class='nicetitle'>Kampagne im Ort:</span><br/><br/>");
	};
	
	/*if(document.URL.indexOf('wurm') >=0) {
	$(".thickbox").eq(0).append("<br/><span style='color:#000; text-decoration:none;'>1</span><br/>");

$("#img-container").after("<br/>1 \„Abriss. Ein neuer Aufbruch.\“ Juli 2009 <br/>");
	}
	if(document.URL.indexOf('helnwein') >=0) {
	$(".thickbox").not(":last-child").css({'float':'left', 'line-height':'5px', 'text-decoration':'none'});
	$(".thickbox:nth-child(3)").css({'float':'none', 'text-decoration':'none'});
$(".thickbox").eq(0).append("<br/><span style='color:#000; text-decoration:none;'>1</span><br/>");
$(".thickbox").eq(1).append("<br/><span style='color:#000; text-decoration:none;'>2</span><br/>");
$(".thickbox").eq(2).append("<br/><span style='color:#000; text-decoration:none;'>3</span><br/><br/><br/><br/><br/>");
$(".thickbox").eq(3).append("<br/><span style='color:#000; text-decoration:none;'>4</span><br/>");

//$(".thickbox").eq(2).after("<br/>\„Unaufhaltsamer Baufortschritt.\“<br/><span style='color:#ccc;'>Februar 2010</span><br/><br/>");
//$(".thickbox").eq(3).after("<br/>\„Fertigstellung der Basis.\“<br/><span style='color:#ccc;'>Februar 2010</span><br/><br/>");


$("#img-container").after("<br/>1 \„Arbeiten im Untergrund. Fertigstellung der Basis.\“ November 2009<br/>2 \„Am Wendepunkt.\“ Dezember 2009<br/>3 „Unaufhaltsamer Baufortschritt.\“ Februar 2010<br/>4 \„Fertigstellung der Basis.\“ Februar 2010");
	}
	*/
	$("title").html("Liquid Frontiers.");


// CURRENT YEAR COPYRIGHT  ____________________________________________________________________

$("#copyright").text("© " + (new Date).getFullYear() );

// SELECTBOX - FILTER ____________________________________________________________________

if(window.location.pathname == "/" || window.location.pathname == ""){
    	$.cookie('bereichsfiltercookie', "Alle Bereiche", {path: '/'});
    	$.cookie('produktionfiltercookie', "Alle Produktionen", {path: '/'});
}



//============================================================


$("#bereichsfilter").change(function () {
		
		$("#produktionfilter").val("Alle Produktionen");

        bereich = $("#bereichsfilter").val();
		bereichklasse = "." + bereich.toLowerCase();
				
		$("li:nth-child(2)").children("a").not(bereichklasse).parent().parent("ul").not('.exception, #aktuell, .sektionstitelliste').hide();
		$(bereichklasse).parent().parent("ul").show();				
        
        if(bereich == "Alle Bereiche"){
        	$("#menu>.container>ul").show();
        }

    	$.cookie('bereichsfiltercookie', bereich, {path: '/'});
    	$.cookie('produktionfiltercookie', "Alle Produktionen", {path: '/'});
    	
    	//console.log("im bereichsfiltercookie: " + $.cookie('bereichsfiltercookie'));
		//console.log("im produktionfiltercookie: " + $.cookie('produktionfiltercookie'));

});

$("#produktionfilter").change(function () {
	
		$("#bereichsfilter").val("Alle Bereiche");

        produktion = $("#produktionfilter").val();
		produktionklasse = "." + produktion.toLowerCase();
				
		$("li:nth-child(2)").children("a").not(produktionklasse).parent().parent("ul").not('.exception, #aktuell, .sektionstitelliste').hide();
		$(produktionklasse).parent().parent("ul").show();				
        
        if(produktion == "Alle Produktionen"){
        	$("#menu>.container>ul").show();
        }
        
    	$.cookie('bereichsfiltercookie', "Alle Bereiche", {path: '/'});
    	$.cookie('produktionfiltercookie', produktion, {path: '/'});
    	
    	//console.log("im bereichsfiltercookie: " + $.cookie('bereichsfiltercookie'));
		//console.log("im produktionfiltercookie: " + $.cookie('produktionfiltercookie'));
});

//============================================================

		bereichincookie = $.cookie('bereichsfiltercookie');
		$("#bereichsfilter").val(bereichincookie);
		
		produktionincookie = $.cookie('produktionfiltercookie');
		$("#produktionfilter").val(produktionincookie);


//============================================================


		bereichklasse2 = "." + bereichincookie.toLowerCase();
		
		if(bereichincookie != "Alle Bereiche"){
        	$("li:nth-child(2)").children("a").not(bereichklasse2).parent().parent("ul").not('.exception, #aktuell, .sektionstitelliste').hide();
			$(bereichklasse2).parent().parent("ul").show();	
        }			
		
		produktionklasse2 = "." + produktionincookie.toLowerCase();

		if(produktionincookie != "Alle Produktionen"){
			$("li:nth-child(2)").children("a").not(produktionklasse2).parent().parent("ul").not('.exception, #aktuell, .sektionstitelliste').hide();
			$(produktionklasse2).parent().parent("ul").show();			
		}

        if(bereichincookie == "Alle Bereiche" && produktionincookie == "Alle Produktionen"){
        	$("#menu>.container>ul").show();
        }
        
        
//============================================================
		
		
		//console.log("im bereichsfiltercookie: " + $.cookie('bereichsfiltercookie'));
		//console.log("im produktionfiltercookie: " + $.cookie('produktionfiltercookie'));


// REFERENZEN DROPDOWN LISTEN ============================================================


	$(".sektionstitel").siblings("li").hide();

	$(".sektionstitel").click(function(){
		
		if (!$(this).hasClass("offen")){
			$(this).parent("ul").siblings("ul").children(".sektionstitel").siblings("li").slideUp(200);
			$(this).siblings("li").slideDown(200);
			$(this).addClass("offen").parent("ul").siblings("ul").children(".sektionstitel").removeClass("offen").css('text-decoration','none');;
		} else {
			$(this).siblings("li").slideUp(200);
			$(this).removeClass("offen");
			$(this).css('text-decoration','none');
		}
		
	});

	$(".sektionstitel, .sektionstitel~li").hover(function(){
		$(this).css('text-decoration','underline');
		
		}, function(){
		
		if ($(this).hasClass("offen")){
			$(this).css('text-decoration','underline');
		} else {
			$(this).css('text-decoration','none');
		}
	});


	//$(".aktuellhidden").css({'display':'none'});





});
