$(document).ready(function() {
	$("li.on").each(function() {
		if ($(this).find("li#lev3_aktiv").length > 0) {
			$(this).removeClass("on").addClass("off");
		}
		else if ($(this).find("ul.level3").length > 0) {
			$(this).find("ul.level3").hide();
		}
	});
	
	$("li.off > a").click( function() { return false; } );
	
	if ($(".accordion").length > 0) {
		if ($("#acc_clients").length > 0) {
			$('#acc_clients').accordion({
			  	header: 'div.acc_header',
			  	collapsible: true,
			  	autoHeight: false,
			  	alwaysOpen: false,
				active:false
			});
		}
		else {
			$('.accordion').accordion({
			  	header: 'div.acc_header',
			  	collapsible: true,
			  	autoHeight: false,
			  	alwaysOpen: false
			});
		}
	}
	if ($(".accordion_left").length > 0) {
		$('.accordion_left').accordion({
			  header: 'div.acc_header_small',
			  autoHeight: false,
			  active: false,
			  alwaysOpen: false
		}).bind('accordionchange', function(event, ui) {
			var temp = "#" + ui.newHeader.attr("id");
			if (temp == "#head1" && $(temp).next("div").find("iframe").length != 1) {
				$(temp).next("div").html('<iframe width="370" height="330" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.de/maps?f=q&amp;source=s_q&amp;hl=de&amp;geocode=&amp;q=Perusastra%C3%9Fe+2,+M%C3%BCnchen&amp;sll=52.486661,13.33281&amp;sspn=0.008493,0.022724&amp;ie=UTF8&amp;hq=&amp;hnear=Perusastra%C3%9Fe+2,+Altstadt-Lehel+80333+M%C3%BCnchen,+Bayern&amp;ll=48.147649,11.580791&amp;spn=0.009307,0.022724&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.de/maps?f=q&amp;source=embed&amp;hl=de&amp;geocode=&amp;q=Perusastra%C3%9Fe+2,+M%C3%BCnchen&amp;sll=52.486661,13.33281&amp;sspn=0.008493,0.022724&amp;ie=UTF8&amp;hq=&amp;hnear=Perusastra%C3%9Fe+2,+Altstadt-Lehel+80333+M%C3%BCnchen,+Bayern&amp;ll=48.147649,11.580791&amp;spn=0.009307,0.022724&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Größere Kartenansicht</a></small><br><br>');
			}
			if (temp == "#head2" && $(temp).next("div").find("iframe").length != 1) {
				$(temp).next("div").html('<iframe width="370" height="330" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.de/maps?f=q&amp;source=s_q&amp;hl=de&amp;geocode=&amp;q=Bundesallee+171,+Berlin&amp;sll=51.151786,10.415039&amp;sspn=17.955057,46.538086&amp;ie=UTF8&amp;hq=&amp;hnear=Bundesallee+171,+Wilmersdorf+10715+Berlin&amp;ll=52.492292,13.335514&amp;spn=0.008493,0.022724&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.de/maps?f=q&amp;source=embed&amp;hl=de&amp;geocode=&amp;q=Bundesallee+171,+Berlin&amp;sll=51.151786,10.415039&amp;sspn=17.955057,46.538086&amp;ie=UTF8&amp;hq=&amp;hnear=Bundesallee+171,+Wilmersdorf+10715+Berlin&amp;ll=52.492292,13.335514&amp;spn=0.008493,0.022724&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Größere Kartenansicht</a></small><br><br>');
			}
		});
	}
	
	if ($(".flash_border").length > 0) {
		$("#side_light").css("width","68px");
	}
	
 $("#content table,#content_small table").each(function() {
	if ($(this).parent("form").length == 0) {  
		$(this).addClass("styled_table");
		$(this).find("tr:first").addClass("first");
		$(this).find("tr:even").addClass("even").find("td:first").addClass("first_td");
		$(this).find("tr:odd").addClass("odd").find("td:first").addClass("first_td");
	}
}); 

if ($.browser.msie && $.browser.version < 7) {
	$("#left .link,#right .link").hover(
		function() { $(this).css("background-color","#A9A9A9"); },
		function() { $(this).css("background-color","#D6D6D6"); }
	);
}

});
