
/*

*/






//--------------- SECTIONS ------------ 

jQuery(function($){ 
	
	// -----------VIDEOS ------------------------------------------------------------------------------------

	$("object, embed").css({'width':'570px', 'margin-top':'20px', 'margin-bottom':'180px', 'height':'390px'});
	
	var klosett = $("embed").attr('src') + '&show_title=0&show_byline=0&show_portrait=0&color=&fullscreen=0&autoplay=1&color=ffffff';
	$("embed, object").attr('src', klosett);

	
	$("object").next("p").remove();
	
	$("ul[name='mobile.yellow.at']").remove();
	
	/*$(function(){ 
       	$('object').each( function() {
       		var $h = $(this);  
          	var html = $h.html(); 
          	html = html.replace( '/server/', 'ZUCKERHUT' );
       		$h.html( html );
       		alert(html)
       	}); 
    }); */
	
	var aktivesektion = $(".active").attr("name");
	$("ul[name='" +aktivesektion+ "']").children().animate({ paddingLeft: "15px" }, 1);
	$("ul[name='" +aktivesektion+ "']").children().css({ 'color': '#DDDE01' });
	$("ul[name='" +aktivesektion+ "']").children().css({'text-decoration':'none'});
	


	
	var dieurl = document.URL;				
	if(dieurl == "http://www.yellow.at/index.php" || dieurl == "http://www.yellow.at/index.php/" || dieurl == "http://yellow.at/index.php" || dieurl == "http://yellow.at/index.php/" || dieurl == "http://yellow.at/" || dieurl == "http://yellow.at" || dieurl == "http://www.yellow.at/" || dieurl == "http://www.yellow.at" || dieurl == "www.yellow.at" || dieurl == "www.yellow.at/" || dieurl == "yellow.at/" || dieurl == "yellow.at/" || dieurl == "yellow.at/index.php" || dieurl == "yellow.at/index.php/" || dieurl == "http://mobile.yellow.at/" || dieurl == "mobile.yellow.at/"){
		$("#content>.container>p:last").clone().prependTo($(".subsections_container>ul"));	
		$("#content>.container>p:last").remove();
		$(".subsections_container>ul>p:first").css({'width':'120px', 'color':'#000', 'font-style':'italic'});
		$(".subsections_container>ul>p:first").addClass('startseitentextlinks');
	}
	
	

	//--------------- Basics ------------

	
	$(".main_section + .main_section_divider").remove();
	
	$("#content>.container>p:not(:first)").css({'line-height':'16px'});
	
	$("#content>.container>p:first").css({'padding-top':'91px'});
	
	$("#content>.container>p:first>em").css({'margin-bottom':'2px'});
		
	$("#content>.container>p:not(:first)").before("<br/>");
	
	//$("#content>.container>p:first").before("<br/>");
	
	$("#content>.container>p:first>em").wrap("<span style='font-style: normal; padding-bottom:8px; display: block;'></span>")
	
	$("#content>.container>p:not(:first)").css({'width':'570px'});

	$("#content>.container>p:first>span>em").css({'display':'block', 'width':'300px','font-size':'18px', 'font-family':'Helvetica, Arial, sans-serif', 'font-weight':'bold', 'font-style':'normal', 'line-height':'22px', 'text-decoration':'none'});
	
	$("#content>.container>p:last").css({'padding-bottom':'30px', 'margin-bottom':'20px', 'border-bottom':'dotted #ccc 0px'});
	
	//$("#img-container>.nav").css({'border-top':'dotted #ccc 0px', 'padding-top':'20px', 'padding-bottom':'1px'}).before("<em style='font-size: 18px; font-family: Helvetica, Arial, sans-serif; font-weight: bold; font-style: normal;'>Bilder und Ansichten:</em>");
	
	$("#img-container>div:last").css({'padding-bottom':'150px'});
	
	
	var bla = $("#s1").children().length
	if (bla <= 1)
	{
		$("#img-container>.nav").hide();
	}
	
	
	//--------------- Click -------------


	$(".main_section_container>ul").click(function(){
		
		var sektionklasse = $(this).attr("name");
		
		$(".subsections_container>ul>li[name='" +sektionklasse+ "']").fadeIn(250);
		$(".subsections_container>ul>li:not([name='" +sektionklasse+ "'])").hide();
		
		//var wieviele2 = $(".subsections_container>ul>li[name='" +sektionklasse+ "']").length -1;	
		//$(".subsections_container>ul>li[name='" +sektionklasse+ "']:eq("+wieviele2+")").hide();
		

		
		//$(".subsections_container>ul>li[class='" +sektionklasse+ "']").children().animate({ color: "#D7D033" }, 220);
		//$(".subsections_container>ul>li:not([class='" +sektionklasse+ "'])").children().animate({ color: "#000000" }, 220);
		
		//alert(sektion);
		$(".startseitentextlinks").hide();
	});
	
	

	$("#showmenu").hide();
	
	
	$("#showmenu").scrollToTop(100);
	
	//$("#menu").hidemenu();
	
	
	/*$("#showmenu").mouseover(function(){	
		$(this).find("span").animate({ backgroundColor: "#E5DC33" }, 220);		
    	}).mouseout(function(){
			$(this).find("span").animate({ backgroundColor: "#fff" }, 220);
	});*/	
		
	

	
	$(".subsections_container>ul>li:not([name='" +aktivesektion+ "'])").hide();
	
	//var wieviele = $(".subsections_container>ul>li[name='" +aktivesektion+ "']").length -1;	
	//$(".subsections_container>ul>li[name='" +aktivesektion+ "']:eq("+wieviele+")").hide();
	
	$(".section-title").click(function(){		
		$(this).animate({ paddingLeft: "15px" }, 1);
		$(this).addClass('active-section');
		$(this).parent().siblings().children().animate({ paddingLeft: "0px" }, 150);
		$(this).parent().siblings().children().css({ 'text-decoration': 'none' });
		$(this).parent().siblings().not(".indexhibitlink").children().animate({ color: "#000" }, 150);
		
		$(".subsections_container>ul>li>a").animate({ paddingLeft: "0px" }, 1).css({ 'color': '#000' });
		
		//$("ul[name='" +aktivesektion+ "']").children().animate({ paddingLeft: "15px" }, 1);
		$(this).parent().siblings().children().removeClass('active-section');	
		
		$(this).css({'text-decoration':'none'});
		$(this).css({'color':'#DDDE01'});
		
		$("#content>.container").hide();
	});	

	
	var dieurl = document.URL;		
	var datum=new Date();
	var image="<a href='http://www.yellow.at/index.php'><img src='http://www.yellow.at/files/logo_animiert.gif?"+datum.getTime()+"'/></a>";
	var image2="<a href='http://www.yellow.at/index.php'><img src='http://www.yellow.at/files/logo.png'/></a>";
	$(".logo").html(image);
		
	if(dieurl == "http://www.yellow.at/index.php"){
		$(".logo").html(image);
	} else {
		$(".logo").html(image2);
	}
	
	
	//$(this).animate({ marginLeft: "100px" });
	
		
	$(".main_section_container>ul:last").after("<p class='indexhibitlink' style='margin-top:50px; color:#888;'>Die Imagination<br/>zuk&uuml;nftiger<br/>Gegenwarten</p>");
	

	
	//--------------- Mouseover, Mouseout -------------
		
			
	$(".section-title").mouseover(function(){	
		$(this).animate({ paddingLeft: "15px" }, 150);
		$(this).animate({ color: '#DDDE01' }, 100);
	
    	}).mouseout(function(){
    	
		if ($(this).hasClass('active-section') || ($(this).parent().attr("name") == aktivesektion)){
			$(this).animate({ paddingLeft: "15px" }, 150);
			$(this).animate({ color: '#DDDE01' }, 100);
		} else {
			$(this).animate({ paddingLeft: "0px" }, 150);
			$(this).animate({ color: '#000' }, 100);
		}
	});	
	
	
	$(".active").children().css({ 'color': '#d1d20d', 'padding-left': '15px' });	
		
	$(".subsections_container>ul>li").children().mouseover(function(){	
		
		if($(this).parent().hasClass('active')){		
			$(this).animate({ paddingLeft: "15px" }, 1);
		}	else {
			$(this).animate({ paddingLeft: "15px" }, 150);
			$(this).animate({ color: '#d1d20d' }, 100);

		}
		
    	}).mouseout(function(){
    	
		if($(this).parent().hasClass('active')){		
			$(this).animate({ paddingLeft: "15px" }, 150);
		}	else {
			$(this).animate({ paddingLeft: "0px" }, 150);
			$(this).animate({ color: '#000' }, 100);
		}
	});	
	
});







// ----------- FIREFOX & OPERA HACKS ----------------------------------------------------------------------------------------


$(document).ready(function(){

	//--------------- Firefox ------------
	
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 
			if(navigator.platform.indexOf("Win32") != -1){
				$(".main_section_divider").css({'padding-top' : '8px'});
				$(".main_section").css({'padding-top' : '13px'});
				$("#menu ul").css({'margin-top' : '4px'});
				$(".subsections_container>ul").css({'padding-top' : '7px'});
			}
				else {
					$(".main_section_divider").css({'padding-top' : '1px'});
					$(".main_section").css({'padding-top' : '6px'});
					$("#menu ul").css({'margin-top' : '4px'});
					$(".unterstreichung").css({'margin-top' : '30px'});
					$(".subsections_container>ul").css({'padding-top' : '5px'});
 				}	
	}
});

$(document).ready(function(){

	//--------------- Safari ------------
	
	if (/Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 
		$("#content>.container>p:first").css({'padding-top':'89px'});		
		$("#content>.container>p:first>span>em").css({'display':'block', 'width':'300px','font-size':'18px', 'font-family':'Helvetica, Arial, sans-serif', 'font-weight':'bold', 'font-style':'normal', 'line-height':'22px', 'text-decoration':'none', 'margin-bottom':'5px'});
		$(".subsections_container").css({'padding-top':'91px'});
		$(".main_section_container>ul").css({'line-height' : '47px'});
		$(".startseitentextlinks").css({'padding-top':'0px'});
		$(".main_section_container").css({'margin-top':'-1px'});
	}
});


$(document).ready(function(){

	//--------------- Internet Explorer ------------
	
	if (/MSIE[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 
		$(".startseitentextlinks").css({'padding-top':'0px'});
		$(".main_section_container").css({'margin-top':'3px'});
		$(".subsections_container").css({'padding-top':'93px'});
	}
});


$(document).ready(function(){

	//--------------- Opera ------------

	if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
				
		if(navigator.platform.indexOf("Win32") != -1){
				$(".main_section_divider").css({'padding-top' : '3px'});
				$(".main_section").css({'padding-top' : '6px'});
				//$("#menu").css({'width':'780px'});
				$("#menu ul").css({'margin-top' : '3px'});
				$(".startseitentextlinks").css({'padding-top':'7px'});
		}
			else {
					$(".main_section_divider").css({'padding-top' : '3px'});
					$(".main_section").css({'padding-top' : '5px'});
					//$("#menu").css({'width':'780px'})
					$("#menu ul").css({'margin-top' : '4px'});
					$(".startseitentextlinks").css({'padding-top':'6px'});
					$(".subsections_container").css({'padding-top':'88px'});
			}
	}
});
