var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
$(document).ready(function(){
		
	$("#logo").click(function(){
		document.location.href = "/index.php";
	});
	
	/* FUNKTIONEN NEWS ANFANG */
	$("#linkAktuell").toggle(
		function(){
			$("#contentFrame, #contentFramePhilo").hide(300, function(){
				$("body").css("background","#d2d84b");
				$(".headline_unten").addClass("headline_unten_news");
				$(".headline_unten_news").removeClass("headline_unten");
				$("#aktuell_liste_1").show();
				$("#contentFrameNews").show(300);
				
			});
		},
		function(){
			$("#contentFrameNews").hide(300, function(){
				if(self.location.href == "http://www.look-werbeagentur.de/brandfarm/philosophie.php"){
					location.href  = self.location.href;
				}else{								  	
					$("body").css("background","#ffffff");
					$(".headline_unten_news").addClass("headline_unten");
					$(".headline_unten").removeClass("headline_unten_news");
					$("#contentFrame").show(300);
				};
			});
		}
	);
	
	
	$("#close_aktuell").click(function(){
		
		$("#contentFrameNews").hide(300, function(){
			$("body").css("background-color","#ffffff");
			$(".headline_unten_news").addClass("headline_unten");
			$(".headline_unten").removeClass("headline_unten_news");
			$("#contentFrame").show(300);
		});
	});
	
	
	$(".news_eintrag:even").css("background-color","#d9de66");
	
	$(".seitennavigation span").click(function(){
		var aktSeitenzahl = $(this).html();
		$(".aktuell_liste").hide();
		$("#aktuell_liste_"+aktSeitenzahl).show();
		$(".seitennavigation span").addClass("news_seitennavi");
		$(".seitennavigation span").removeClass("news_seitennavi_active");
		$(this).removeClass("news_seitennavi");
		$(this).addClass("news_seitennavi_active");
	});	
	/* FUNKTIONEN NEWS ENDE */
	
	
	
	/* Auswahlmenü in der Galerie */
	$("#gallerylist_button_select").hover(function(){
		$("#gallerylist_select").slideDown('fast');
		$("#gallerylist_select ul li").find("a:first").hover(
			function(){
				$(this).css({"font-weight":"bold","text-decoration":"underline"});
			},
			function(){
				$(this).css({"font-weight":"normal","text-decoration":"none"});
			}
		);
		return false;
	});


	/* Options für den Slider */
	$("#slider").easySlider({
		prevText : "",
		nextText : "",
		continuous: true,
		speed: 300,
		nextId : "button_gallery_next",
		prevId : "button_gallery_prev",
		/* Beginn eigene Options */
		gallerylist : true,
		gallerylistId : "gallerylist",
		gallerySelectDiv: "gallerylist_select"
	
	});
	
	
	/* Schreibt die Auswahl aus dem Auswahlmenü der Galerie in das Feld */
	$("#gallerylist_select ul li").click(function(){
		var name = $(this).find("a:first").html();
		$("#gallerylist_button_select span").text(name);
		$("#gallerylist_select").slideToggle('fast', function(){
		
		});
	});

	/* Blendet die Auswahlliste auf Mouseleave aus */
	$("#gallerylist_select").bind("mouseleave",function(){
		$("#gallerylist_select").slideUp('fast');
	});
	
	
	/* Zeigt das Infofeld an */
	$("#slider").hover(function(){
      $(".galleryInfoField").fadeIn(500);
    },function(){
     $(".galleryInfoField").fadeOut(500);
    });




});

	

function stopAnimation(){
	$("#contentFramePhilo").hide(300, function(){ 
		window.location.href = "/brandfarm/marken.php";
		return false;
	});
}


/* Tauschen der Hintergrundbilder in der Brandfarm-Animation */
function startNaviShowPhiloSite(command, args){
	$("#contentFrame").hide();	
	$("#objectContainer_philo").css({"background":"url(/standards/images/bg_verlauf.gif) repeat-x bottom"});
	if(args == "0"){
		
	}else{
		/* Variable, wann das Einblenden je nach Bild anfängt / wie lange es einblenden soll */
		var anfangszeit = "";
		var dauerFadeIn = "";
		if(!isInternetExplorer){
			
			$("#backgroundFlashAni").hide();
			$("#backgroundFlashAni").html("<img src='/standards/images/philomotive/philo"+args+".jpg' style='height:100%;width:100%;' />");
			switch (args) {
				case "1":
					anfangszeit = 9000;
					dauerFadeIn = 2000;
					break;
				case "2":
					anfangszeit = 2200;
					dauerFadeIn = 2200;
					break;
				case "3":
					anfangszeit = 4200;
					dauerFadeIn = 2000;
					break;	
				case "4":
					anfangszeit = 4800;
					dauerFadeIn = 2000;
					break;	
				case "5":
					anfangszeit = 2100;
					dauerFadeIn = 2100;
					break;
				case "6":
					anfangszeit = 4700;
					dauerFadeIn = 2000;
					break;	
			}
			setTimeout(function(){ 
				$("#backgroundFlashAni").fadeIn(dauerFadeIn);
				$("#objectContainer_philo").css({"background":"none"});
			}, 
			anfangszeit
			);
		}else{
			$("body").css("background","url(/standards/images/philomotive/IE_philo"+args+".jpg) no-repeat center center");
			$("#objectContainer_philo").css({"background":"none"});
		}
	}
};


function LOOKmain_DoFSCommand(command, args) {
	var LOOKmainObj = isInternetExplorer ? document.all.LOOKmain : document.LOOKmain;
	
		if(command == "stopanimation"){
			stopAnimation();
		}else{
			
			startNaviShowPhiloSite(command, args);
		}
}
// Hook für Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub LOOKmain_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call LOOKmain_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

