﻿jQuery.fn.loadmain = function() {	 $(this).bind("click", function(){			$.get($(this).attr("lnk"), { solo: "true" },function(data){$("#id5").html(data);$(".list",$("#id5")).ajaxify();$("div.main").bilder();$("div.main").globlinx();});			$.get($(this).attr("lnk"), { solo:"true", page: "GET /menue[template='/templates/topline.xslt']" },function(data){$("h2",$("#id4")).html(data);});});};jQuery.fn.ajaxify = function() {	if($("#id0").html()==""){		$("a", $(this)).each(function(){			$(this).attr({lnk: $(this).attr("href")}).attr({href:"#main"}).loadmain();                        		});		flashdetect();	}};jQuery.fn.bilder2 = function() {	$("img",$(this)).each(function(){		$(this).css({cursor:"pointer"});	});};jQuery.fn.bilder1 = function() {	$("img",$(this)).each(function(){		$(this).css({cursor:"pointer"});		$(this).lightBox();	});};jQuery.fn.globlinx = function() {	$("a",$(this)).each(function(){		if($(this).attr("href")!= null){			var tmp = $(this).attr("href");			tmp2 = tmp.split("ttp://");if(tmp2.length ==2 ){if(tmp2[0]=="h"){			tmp4=tmp2[1];tmp3 = tmp4.split("paya");			if(tmp3[0]!="pa")$(this).attr({target:"_blank"}).addClass("glob");}}	}});};function flashdetect(){	$('.media').each(function(){		$(this).html("").flash({			src: $(this).attr("href"),			width: $(this).css("width"),			height: $(this).css("height")		});		$(this).removeClass("media");		$(this).addClass("flashbox");		$(this).replaceWith('<div class="'+$(this).attr("class")+'" style="'+$(this).attr("style")+'" title="'+$(this).attr("title")+'">'+$(this).html()+'</div>');	});}function str_replace(search,replace,subject){return subject.split(search).join(replace);}jQuery.fn.leonjspath=function(){return str_replace("/jquery.js","",jQuery(jQuery.grep(jQuery('script'),function(s){return(s.src&&s.src.match(/jquery.js(\?.*)?$/))})).attr('src'));};function lSQ(){	q=""+window.location;	qk=q.split("/");	$("#qv").focus(function(){		if($(this).val()=="Suchbegriff")$(this).val("");		$(this).css("color","#000");	});q=q.split("?");q=q[0].split("/");if(q[(q.length-1)]=="suche.html" && q[(q.length-2)]=="de")if(typeof lsq_loaded=='undefined'){$.ajaxSetup({async:false});$.getScript($(this).leonjspath()+"/plugin-search.js",function(){		q_start_search()});$.ajaxSetup({async: true});		}else  q_start_search();}$("document").ready(function(){$("#id3 p.link a span").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");		$('div.item').find(":first").each(function(){			if(this.nodeName == "P")				$(this).css({float:'left'});		});		var ort =  document.URL;		ort = ort.split("/");				if( ort[ort.length-2]=="aktuelles"){			if($("#id3 .termin").length>0){			$('div.item h1' ).prepend("<strong>» "+$("#id3 .termin").html()+"</strong>&nbsp;");}else{$('div.item h1' ).prepend("<strong>»</strong>&nbsp;");}		}		else{			$('div.item h1' ).prepend("<strong>»</strong>&nbsp;");		}							if( document.URL== "http://www.verkehrsakademie-muensterland.de/vam/de/klassen/uebersicht.html"){			$("#id1 > a.media" ).replaceWith('<img src="/vam/web/babel/media/fahrschule_top.jpg"  style="width:1004;height:227px;" />');		}		//$("#id6").append("<span>"+document.URL+":</span>");		flashdetect();     		$('#menu1').superfish({pathClass:  'activ' });				if( document.URL== "http://www.verkehrsakademie-muensterland.de/vam/de/akademie/bildergalerie.html"){												$("#id3 img").lightBox();			 $("#id3").bilder2();		}		else		{						 $("#id3").bilder1();		}			lSQ();});
