/* created_at: 2013-08-30 15:07:58 */ try { console.log(); } catch(e) { console = { log: function() {} } }; function ausgewaehlteGenres() { // checkboxen holen var inputs = jQuery('form#genreauswahl ul li .genreButton input[type=checkbox]'); var genres = new Array(); // inputs durchgehen und nach markierten suchen for(var i in inputs) { if(inputs[i].checked == true) { genres[genres.length] = inputs[i].value; } } if(genres.length == 7) { return false; } return genres; } function ausgewaehlteSortierung() { // sortierungen holen var sortierung = jQuery('input#sortierung').val(); return sortierung; } jQuery( function ($) { $('input.blurFocus').focus(function(){ if(this.value == this.defaultValue){ this.value = ''; } }); $('input.blurFocus').blur(function(){ if(this.value == ''){ this.value = this.defaultValue; } }); var alleli = $().find('form#genreauswahl ul li'); $().find('form#genreauswahl ul li').mouseover(function(){ if ($(this).hasClass('ausgewaehlt')) { $(this).addClass('abgewaehlt'); } else { $(this).addClass("over"); } }); $().find('form#genreauswahl ul li').mouseout(function(){ if ($(this).hasClass('ausgewaehlt')) { $(this).removeClass('abgewaehlt'); } else { $(this).removeClass('over'); } }); $().find('form#genreauswahl ul li label').mouseover(function(){ var parent = $(this); while(!parent.is('li')) { parent = parent.parent(); } $(parent).addClass('wow'); $('form#genreauswahl ul li').each(function() { if (!$(this).hasClass('wow')) { if ($(this).hasClass('ausgewaehlt')) { $(this).removeClass("ausgewaehlt"); $(this).addClass("abgewaehlt"); } } }); }); $().find('form#genreauswahl ul li label').mouseout(function(){ var parent = $(this); while(!parent.is('li')) { parent = parent.parent(); } $('form#genreauswahl ul li').each(function() { if ($(this).hasClass('abgewaehlt')) { $(this).removeClass("abgewaehlt"); $(this).addClass("ausgewaehlt"); } }); $(parent).removeClass('wow'); }); // genre-link-klick $('form#genreauswahl ul li a').click(function(){ var parent = $( this ); $( 'form#genreauswahl ul li .genreButton input[type=checkbox]' ).prop( "checked", "" ); while(!parent.is('li')) { parent = parent.parent(); } $( parent ).find( ".genreButton input[type=checkbox]" ).prop( "checked", "checked" ); $('form#genreauswahl ul li').removeClass("ausgewaehlt"); $('form#genreauswahl ul li').removeClass("abgewaehlt"); $('form#genreauswahl ul li').removeClass("wow"); $('form#genreauswahl ul li').removeClass("over"); $(parent).addClass("ausgewaehlt"); formularAbschicken(); return false; }); // auswahl-bestaetigungesbuttons $('#filterauswahl button, #sortierungsauswahl button').click(function(){ // genres und filter-einstellungen holen var genres = ausgewaehlteGenres(); var filter = ausgewaehlteFilter(); var sortierung = ausgewaehlteSortierung(); filter.push('f=1'); // parameter mergen if(genres.length > 0) { filter.push('genres=' + genres.join(',')); } // sortierung anhaengen (nur wenn eine auswahl zur verfuegung steht) if(document.getElementById('sortierungsauswahl')) { if(sortierung && sortierung.length > 0) { filter[filter.length] = 'sortierung=' + sortierung; } else { filter[filter.length] = 'sortierung=veroeffentlichung,ab'; } } formularAbschicken(); return false; }); // genre-checkbox-klick $( 'form#genreauswahl ul li .genreButton input[type=checkbox]' ).click( function(){ var timeout = 0; $( this ).parents().filter( 'li' ).removeClass( "over" ); $( this ).parents().filter( 'li' ).removeClass( "abgewaehlt" ); $( this ).parents().filter( 'li' ).removeClass( "wow" ); if ( ( this.checked == "checked" ) || ( this.checked == true ) ) { $( this ).parents().filter( 'li' ).addClass( "ausgewaehlt" ); } else { $( this ).parents().filter( 'li' ).removeClass( "ausgewaehlt" ); // war es das letzte? dann alle auswaehlen if ( $( 'form#genreauswahl ul li.ausgewaehlt' ).length == 0 ) { $( 'form#genreauswahl ul li' ).addClass( 'ausgewaehlt' ); $( 'form#genreauswahl input[type=checkbox]' ).prop( 'checked', 'checked' ); } } // genreliste holen var p = $( "#genreauswahl" )[0]; if( timeout === 0 ) { window.clearTimeout( timeout ); } if( timeout === 0 ) { timeout = setTimeout( function() { formularAbschicken(); }, 1000); } return true; }); function formularAbschicken() { $ = jQuery; // hier muessen in allen widgets der seite alle zustaende neu // befuellt werden. // array anlegen, in dem wir alle zu erneuernden elemente sichern var neu = []; // seitenindex standardmaessig deaktivieren var si = false; // alle widgets holen und zustaende holen und string erstellen, der sie zurueckgibt var ws = $('.widget'); ws.each(function(){ var w = this.id; this.zs = $(this).find('.zustaende').each(function(){ //if($(this).css('display') != 'none'){ neu.push(w + '.' + this.className.match(/zustand_[a-z0-9_]+/)[0].replace(/zustand_/, '')); if($(this).find('.seitenIndex').length == 0){ neu[(neu.length-1)] += '#false'; } //} }); }); var zs = neu.join(','); // pruefen auf welcher seite wir sind var rubrik = window.location.pathname.split('/')[1]; if(!rubrik || rubrik == ''){ rubrik = 'home'; } // konfig fuer ajax-abfrage erstellen var p = { aktion: 9, zs: zs, r: rubrik, si: si } // genres und filter-einstellungen holen var genres = ausgewaehlteGenres(); var filter = ausgewaehlteFilter(); var sortierung = ausgewaehlteSortierung(); filter.push('f=1'); // parameter mergen if(genres.length > 0) { filter.push('genres=' + genres.join(',')); } // sortierung anhaengen (nur wenn eine auswahl zur verfuegung steht) if(document.getElementById('sortierungsauswahl')) { if(sortierung && sortierung.length > 0) { filter[filter.length] = 'sortierung=' + sortierung; } else { filter[filter.length] = 'sortierung=veroeffentlichung,ab'; } } // query vervollstaendigen q = filter.join('&'); laut.ajax.senden(p, function(d){ // zustaende neu laden if(d.zs){ for(var i in d.zs){ var tmp = d.zs[i]; var z = $('#' + tmp.w + ' .zustand_' + tmp.z); laut.aktualisiereZustand(d.zs[i], z); } } // teaserband aktualisieren if(d.tb && d.tb.length > 0 && laut.teaser && typeof(laut.teaser.arrayRefresh) == 'function'){ laut.teaser.arrayRefresh(d.tb); } }, q); // aktion: formularAbschicken laut.trackClick('','genre'); return false; } window.ausgewaehlteFilter = function() { var filter = new Array(); // redaktionswertung? var redwert = $('form input[name=redaktionswertung]:checkbox'); if($(redwert).length > 0) { var redawert = ''; for (var i=0; i<$(redwert).length; i++) { if (($(redwert)[i].checked) && ($(redwert)[i].value > 0)){ if (redawert != '') redawert += ',' + $(redwert)[i].value; else redawert = $(redwert)[i].value; } } if (redawert == '') { redawert = '1,2,3,4,5'; $('form input[name=redaktionswertung]:checkbox').prop('checked','checked'); } filter[filter.length] = 'redaktionswertung=' + redawert; } // autor gewaehlt? if ($('#filterauswahl select[name=id_autor]').length > 0) { autor = $('#filterauswahl select[name=id_autor] option:selected'); if(autor[0].value > 0) { filter[filter.length] = 'id_autor=' + autor[0].value; } } // zeitangaben holen if ($('#filterauswahl select[name=monat]').length > 0) { monat = $('#filterauswahl #monat'); jahr = $('#filterauswahl #jahr'); if($(monat[0]).val() > 0 || $(jahr[0]).val() > 0) { filter[filter.length] = 'monat=' + $(monat[0]).val(); filter[filter.length] = 'jahr=' + $(jahr[0]).val(); } } // pruefen ob nur deutsche texte gewuenscht sind if ($('#deutschCheckbox').length > 0) { if($('#deutschCheckbox')[0].checked == true) { filter[filter.length] = 'deutsch=true'; } } return filter; } // sortierbuttons $("#sort_aktualitaet, #sort_popularitaet").live('click', function(){ var t = ''; var charts = $(laut.widgets).find('.zustand_teaser_charts'); var artikel = $(laut.widgets).find('.zustand_artikel_teaser'); // a wird durch b ersetzt (ausgeblendet) var wechsel = function(a,b){ // parent finden und position korrekt setzen var pos = a.parent().css('position'); a.parent().css('position', 'relative'); a.css('background', '#ffffff'); a.css('position', 'absolute'); a.css('z-index', 1); a.css('top', '0px'); b.css('display', 'block'); a.fadeOut(500, function(){ $(this).css('background', 'transparent'); $(this).css('position', 'relative'); $(this).css('z-index', 0); $(this).parent().css('position', pos); }); }; if(charts.length > 0 && artikel.length > 0){ if(this.id == 'sort_aktualitaet'){ wechsel(charts, artikel); } if(this.id == 'sort_popularitaet'){ wechsel(artikel, charts); } } if(this.id == 'sort_aktualitaet'){ $("input#sortierung").attr("value","veroeffentlichung,ab"); t = 'Neu | Charts'; } else if(this.id == 'sort_popularitaet'){ $("input#sortierung").attr("value","popularitaet,ab"); t = 'Neu | Charts'; } var p = $(this).parent(); var form = $(p).find('form'); $(p).empty(); $(p).html(t); $(p).prepend(form); formularAbschicken(); return false; }); } ); jQuery('.__ajaxmehr a').live('click', function($){ var thisLink = jQuery(this); laut.ajax.get(this.href, function(response){ if(thisLink.attr('callback') && typeof(thisLink.attr('callback')) == 'function'){ thisLink.attr('callback')(response); } else{ thisLink.parents('.__ajaxmehr').replaceWith(response); } // aktion: neuer mehrklick laut.trackClick('','nochmehr'); }); return false; }); // vorhandene navigationselemente der albumuebersicht mit ajax-funktionalitaet versehen jQuery('.__seitenindex').live('click', function($){ // flag setzen, damit kein weiterer user-initialisierter aufruf erfolgt, bis // vorhergegangener abgeschlossen ist var href = this.href.split('/'); var query = href.pop().split('?').pop(); var query = query.substr(0,1) == '?' ? query.substr(1) : query; var rubrik = window.location.href.split('/')[3]; $ = jQuery; // der zu erneuernde zustand muss automatisch bestimmt werden var p = $(this); while(p = p.parent()){ if(p.hasClass('widget')){ var w = p[0].id; break; } if(p.hasClass('zustaende')){ var oZ = p; var z = p[0].className.match(/zustand_[a-z0-9_]+/)[0].replace(/zustand_/, ''); } } // neue parameter erstellen var p = { aktion: 9, zs: w + '.' + z, r: rubrik } laut.ajax.senden(p, function(d){ for(var i in d.zs){ var tmp = d.zs[i]; var z = $('#' + tmp.w + ' .zustand_' + tmp.z); // wenn das widget nicht oben steht, wird es hoch geholt if($('.widget')[0] != $('#' + w)[0]){ $('#' + w)[0].widget.nachOben(); } laut.aktualisiereZustand(d.zs[i], z, true); // aktion: Umblaettern laut.trackClick('','pagination'); } }, query); return false; }); laut.HTMLtoDOM = function(h){ // container zum umwandeln des codes erstellen var tmp = document.createElement('div'); // html-code einfuegen (wird vom browser umgewandelt) tmp.innerHTML = h; // tueckgabearray erstellen var re = new Array(); // childnodes des containers durchgehen und sollten sie ein elementknoten // sein an das rueckgabearray anhaengen if(tmp.childNodes && tmp.childNodes.length > 0){ for(var i = 0; tmp.childNodes[i]; i++){ if(tmp.childNodes[i].nodeType == 1){ re.push(tmp.childNodes[i]); } } } return re; } laut.aktualisiereZustand = function(d, z, scrollTo){ $ = jQuery; var anzeigen = function(z){ var ul = z.find('*:not(.clear)')[0]; // die erste liste im zustand wird die auszutauschende sein var w = $(z).parents('.widget'); // wir brauchen auch das widget in dem sich der zustand befindet var e = w[0].id; // die id des widgets als e(lement) var r = window.location.href.split('/')[3]; // unsere aktuelle rubrik var si = $('#' + e + ' .__seitenindex'); // pruefen ob wir einen seitenindex in diesem zustand haben // a wird durch b ersetzt (ausgeblendet) var wechsel = function(a,b){ // parent finden und position korrekt setzen var pos = a.parent().css('position'); a.parent().css('position', 'relative'); a.css('background', '#ffffff'); a.css('position', 'absolute'); a.css('z-index', 1); a.css('top', '0px'); b.css('display', 'block'); a.fadeOut(500, function(){ $(this).css('background', 'transparent'); $(this).css('position', 'relative'); $(this).css('z-index', 0); $(this).parent().css('position', pos); }); }; // gibt es seitenindex, muss er entfernt werden if(si && si.length > 0){ $(ul).next().remove(); // anzahl der vorhandenen elemente holen, damit wir den seitenindex richtig // bestimmen koennen var lis = z.find('.boxListe li.scrolltop').length; } // liste absolut positionieren und den hintergrund undurchsichtig machen $(ul).css('width', $(ul).parent().width() + 'px'); $(ul).css('overflow', 'hidden'); $(ul).css('position', 'absolute'); $(ul).css('background', '#ffffff'); $(ul).css('z-index', 1); // neue liste anhaengen z.append(d.html); // alte liste ausblenden und anschliessend entfernen $(ul).fadeOut(500, function(){ $(this).remove(); }); // widget events neu setzen if($(w)[0] && $(w)[0].widget){ $( window ).trigger( 'lb:reset' ); $(w)[0].widget.initEvents(); } }; if(z == undefined || z == '' || z.length == 0){ return false; } if(scrollTo && scrollTo == true){ laut.scrollTo(z, 500, function(){ anzeigen(z); }); } else{ anzeigen(z); } } // ------------------------------------------ // Allgemeine Funktionen // ------------------------------------------ jQuery(document).ready(function($){ // timeout-funktion (function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var e=d.call(arguments),f=b.apply(this,[c+e[0]].concat(e));return typeof e[0]==="number"||typeof e[1]==="number"?this:f};function b(l){var m=this,h,k={},n=arguments,i=4,g=n[1],j=n[2],o=n[3];if(typeof g!=="string"){i--;g=l=0;j=n[1];o=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(g){k=a[g]||(a[g]={})}}k.id&&clearTimeout(k.id);delete k.id;function f(){if(l){h.removeData(l)}else{if(g){delete a[g]}}}function e(){k.id=setTimeout(function(){k.fn()},j)}if(o){k.fn=function(p){o.apply(m,d.call(n,i))&&!p?e():f()};e()}else{if(k.fn){j===undefined?f():k.fn(j===false);return true}else{f()}}}})(jQuery); // funktion zum scrollen zu bestimmtem element auf der seite // ziel, dauer, callback laut.scrollTo = function(z,d,c){ if(typeof(z) == 'string'){ z = $('#' + z); } if(!d){ d = 1000; } if(!c || typeof(c) != 'function'){ c = function(){}; } $('body').animate( { scrollTop: $(z).offset().top }, d, c ); }; // erstellt ein confirm-fenster laut.confirm = function(n,c){ // abstand zum oberen ende des dokuments ermitteln var top = $('html').scrollTop(); // nach browser unterscheiden und anzeigemasse holen if(jQuery.browser.msie){ laut.browser = { breite: document.documentElement.offsetWidth, hoehe: document.documentElement.offsetHeight } } else { // brauchen wir, weil safari bei der jquery-funktion // keinen wert liefert var top = window.pageYOffset; laut.browser = { breite: window.innerWidth, hoehe: window.innerHeight } } // pruefen ob wir ein confirm-element haben var ob = document.getElementById('lautConfirm'); //$('body').css('overflow', 'hidden'); // sollte unser confirmfeld noch nicht exisitieren, wird es angelegt if(!ob){ var dunkel = document.createElement('div'); dunkel.id = 'lautDunkel'; dunkel.style.background = '#000000'; dunkel.style.display = 'none'; dunkel.style.left = '0px'; dunkel.style.position = 'fixed'; dunkel.style.zIndex = 999; dunkel.style.opacity = 0.2; dunkel.style.MozOpacity = 0.2; dunkel.style.filter = 'alpha(opacity=20)'; dunkel.innerHTML = ' '; var ob = document.createElement('div'); ob.id = 'lautConfirm'; ob.style.background = '#f1f1f1'; ob.style.border = '4px solid #000000'; ob.style.borderRadius = '8px'; ob.style.MozBorderRadius = '8px'; ob.style.display = 'none'; ob.style.height = 'auto'; ob.style.overflow = 'hidden'; ob.style.position = 'fixed'; ob.style.width = '250px'; ob.style.zIndex = '1000'; ob.style.WebkitBorderRadius = '8px'; var text = document.createElement('div'); text.className = 'text'; text.style.background = '#ffffff'; text.style.padding = '10px'; text.style.borderBottom = '1px dashed #909090'; text.style.MozBorderRadiusTopleft = '8px'; text.style.MozBorderRadiusTopright = '8px'; text.style.WebkitBorderTopLeftRadius = '8px'; text.style.WebkitBorderTopRightRadius = '8px'; ob.appendChild(text); var span = document.createElement('span'); span.style.display = 'block'; span.style.cssFloat = 'left'; span.style.styleFloat = 'left'; span.style.cursor = 'pointer'; span.style.height = '100%'; span.style.padding = '5px 0px'; span.style.overflow = 'hidden'; span.style.textAlign = 'center'; span.style.width = '50%'; var ok = span.cloneNode(true); ok.innerHTML = 'Ja'; ob.appendChild(ok); var ab = span.cloneNode(true); ab.innerHTML = 'Nein'; ob.appendChild(ab); // anhaengen $('body').append(dunkel); $('body').append(ob); } // existiert es schon, suchen wir die buttons else { var spans = ob.getElementsByTagName('span'); var ab = spans[1]; var ok = spans[0]; var text = ob.getElementsByTagName('div')[0]; var dunkel = $('#lautDunkel')[0]; } // jetzt die nachricht einfuegen text.innerHTML = n; // die position bestimmen ob.style.top = Math.round((laut.browser.hoehe/2)-($(ob).height()/2))+'px'; //ob.style.top = 0 + 'px'; ob.style.left = Math.round((laut.browser.breite/2)-($(ob).width()/2))+'px'; //dunkel.style.top = Math.round(top-(laut.browser.hoehe/2))+'px'; dunkel.style.top = '0px'; dunkel.style.height = (laut.browser.hoehe*2)+'px'; dunkel.style.width = (laut.browser.breite*2)+'px'; // buttons mit funktion versehen $(ab).click(function(){ $(this.parentNode).fadeOut(300, function(){ $('#lautDunkel').fadeOut(300, function(){ $('body').css('overflow', 'auto'); }); }); }); $(ok).unbind('click'); $(ok).click(function(){ $(this.parentNode).fadeOut(300, function(){ $('#lautDunkel').fadeOut(300, function(){ //$('body').css('overflow', 'auto'); }); }); c(); }); // einblenden $(dunkel).fadeIn(300, function(){ $(ob).fadeIn(300); }); return false; } }); // ------------------------------------ // Ajax-Schnittstelle // ------------------------------------ window.laut.ajax = { // funktion zum senden von anfragen an den server // @param p parameterobjekt; wird an den server uebergeben // @param c callbackfunktion, die nach abschluss der // transaktion ausgefuehrt wird // @param g (optional) get-variablen // @param t (optional) typ der rueckgabe // @param w (optional) soll das warteflag beachtet werden // (default: true) senden: function(p, c, g, t, w) { if(w == undefined || w == true){ if(laut.ajax.warten == 1){ return false; } else{ laut.ajax.warten = 1; } } if(t == undefined){ t = 'json'; } jQuery.post('/php/ajax.php' + (g != undefined ? '?' + g : ''), p, function(d){ laut.ajax.warten = 0; c(d); }, t); p.q = g; this.requests.parameter.push(p); this.requests.anzahl++; }, get: function(url, callback){ if(laut.ajax.warten == 1){ return false; } else { laut.ajax.warten = 1; } jQuery.get(url, '', function(responseData){ laut.ajax.warten = 0; callback(responseData); }) }, post: function(url, params, callback){ if(laut.ajax.warten == 1){ return false; } else { laut.ajax.warten = 1; } jQuery.post(url, params, function(responseData){ laut.ajax.warten = 0; callback(responseData); }) }, requests: { anzahl: 0, parameter: new Array() }, info: function(){ $ = jQuery; // gibt es schon ein ajax-info-div? if($('#lautAjaxInfo').length == 0){ var div = $(document.createElement('div')); div.attr('id','lautAjaxInfo'); div.css('display','none'); div.css('position','absolute'); div.css('top','-100px'); div.css('height','44px'); div.css('width','44px'); div.css('z-index','2'); div.css('background','url(/grafiken/layout/ajaxLoader_back.png)'); var img = $(document.createElement('img')); img.attr('src','/grafiken/layout/ajaxLoader.gif'); img.css('margin','6px'); div.append(img); $('body').append(div); div.ajaxStart(function(){ laut.ajax.infoTimeout = window.setTimeout(function(){ $(div).fadeIn(100); }, 100); }); div.ajaxStop(function(){ $(this).fadeOut(100); if(laut.ajax.infoTimeout){ clearTimeout(laut.ajax.infoTimeout); $(laut.ajax).removeAttr('infoTimeout'); } }); this.infoGrafik = div; } var div = this.infoGrafik; // position setzen $('body').mousemove(function(){ if(laut && laut.seite && laut.seite.maus && laut.seite.maus.x && laut.seite.maus.y){ var x = laut.seite.maus.x+25 > $(window).width()-44 ? $(window).width()-44 : laut.seite.maus.x+25; var y = laut.seite.maus.y+25 > $(window).height()-44+$(window).scrollTop() ? $(window).height()-44+$(window).scrollTop() : laut.seite.maus.y+25; div.css('top', y + 'px'); div.css('left', x + 'px'); } }); } }; // ------------------------------------ // Werbe-Frame geladen // ------------------------------------ window.laut.werbung.laden = function(){ }; window.laut.werbung.reloadAds = function(auto){ window.laut.werbung.ord = Math.random()*10000000000000000; $.each($('.werbeFrame'), function() { $(this).attr({ src: '/elemente/werbung/frameWerbung.inc.php?kategorie=' + window.laut.seite.kategorie + '&ad_genres=' }); }); }; window.laut.werbung.geladen = function(werbemittelName,werbemittelBreite,werbemittelHoehe){ if (werbemittelHoehe > 1) { // AUSNAHME: IE 7.0 verrechnet sich bei der Hoehe um 4 Pixel if ($.browser.msie && $.browser.version == '7.0') { werbemittelHoehe = werbemittelHoehe - 4; } $('div#werbung' + werbemittelName).height(werbemittelHoehe); $('div#werbung' + werbemittelName).width(werbemittelBreite); $('div#werbung' + werbemittelName).css('visibility', 'visible'); } else { $('div#werbung' + werbemittelName).height('0px'); $('div#werbung' + werbemittelName).css('visibility', 'hidden'); } }; window.laut.flashMachen = function(src, id, width, height, version, install, flashvars, params, attributes){ var div = $(document.createElement('div')); div.attr('id', id + Math.round(Math.random()*100)); $('#' + id).empty().append(div); swfobject.embedSWF(src, div.attr('id'), width, height, version, install, flashvars, params, attributes); } // ------------------------------------ // Benutzersteuerung // ------------------------------------ /** * ueberprueft ob ein benutzer eingeloggt ist * uebergibt boolean an callback-funktion * @param c callback-funktion */ window.laut.pruefeLogin = function(c){ // cookie holen var coo = document.cookie.split('; '); for(var i = 0; i < coo.length; i++) { if(coo[i].substr(0, 11) == 'laut3_login') { // schluessel von wert trennen coo = unescape(coo[i].split('=')[1]); coo = eval('(' + coo + ')'); // relevante infos sichern laut.benutzer = { id: coo.benutzer, hash: coo.hash, auth: coo.auth } break; } } // pruefen ob daten vorhanden sind if(laut.benutzer && laut.benutzer.id && laut.benutzer.id > 0) { var re = true; } else { var re = false; } if(re == true && c && typeof(c) == 'function'){ c(); } else{ laut.community.loginForm.zeigen(c); } return re; // wenn callbackfunktion exisitiert wird diese mit dem ergebnis der // pruefung aufgerufen if(c && typeof(c) == 'function') { c(re); } return re; }; /** * zum anmelden eines benutzers im js * @param d logindaten * @param c callback-funktion */ window.laut.login = function(d,c){ // falls jquery nicht existiert wird es gesetzt if(!$) { $ = jQuery; } // benutzername und passwort holen var p = { aktion: 2, passwort: d.passwort, benutzer: d.benutzer } laut.ajax.senden(p, function(data){ if(c && typeof(c) == 'function'){ if(data && data.code == 1){ laut.benutzer = { id: data.benutzer, hash: data.hash, auth: data.auth, name: data.name, bild: data.bild, url: data.url } laut.community.loginstatus(); } c(data); } }); }; // // allgemeine funktionen unter laut.seite // if(!laut.seite){ laut.seite = {}; } /** * loggt die aktuelle position des mauszeigers * @param e event des mauszeigers */ laut.seite.mousemove = function(e){ var $ = jQuery; laut.seite.maus = {}; laut.seite.maus.x = e.pageX; laut.seite.maus.y = e.pageY; } jQuery(document).ready(function(){ laut.ajax.info(); jQuery('body').mousemove(laut.seite.mousemove); }); /** * sendet tracking-anfragen an ivw und googleanalytics * @param string cat kategorie, die bei ivw gesetzt wird * @param string path pfad, der getrackt wird (google-category) * @param boolean ivw track ivw * @param boolean ga track googleanalytics * @return void */ window.laut.trackClick = function(cat, path, ivw, ga){ if (window.laut.seite.device != 'ipad' && window.laut.werbung.status == 1) { //laut.werbung.reloadAds(); } if((typeof(ivw) == 'undefined' && typeof(ga) == 'undefined')){ var ivw = true; var ga = true; } if(typeof(cat) == 'undefined' || cat == ''){ var cat = ''; switch(laut.seite.typ){ case 'home': cat = 'homepage'; break; case 'news-uebersicht': cat = 'vl_start'; break; case 'news': cat = 'vl_news'; break; case 'album-uebersicht': cat = 'ls_start'; break; case 'album': cat = 'ls_cd'; break; case 'artist-uebersicht': cat = 'wl_start'; break; case 'artist': cat = 'wl_artist'; break; case 'artist-az': cat = 'wl_archiv'; break; case 'event-uebersicht': cat = 'lh_start'; break; case 'tour': cat = 'lh_termine'; break; case 'event': cat = 'lh_suche'; break; case 'genre-uebersicht': cat = 'lw_start'; break; case 'genre': cat = 'lw_genre'; break; case 'meta': cat = 'kl_sonstiges'; break; default: cat = 'laut'; } } if(ivw === true){ var pixel = new Image(); pixel.src = 'http://laut.ivwbox.de/cgi-bin/ivw/CP/' + cat + ';' + (new Date).getTime() + '?r=' + escape(document.referrer)+"&d="+(Math.random()*100000); } if(ga === true){ if(typeof(pageTracker) != 'undefined' && pageTracker) { // protokoll und anker abschneiden var dir_path = '/' + window.location.href.split('://')[1].split('/').slice(1).join('/').split('#')[0]; // wenn das letzte zeichen ein / ist, wird er entfernt if(dir_path.substr((dir_path.length-1)) == '/'){ dir_path = dir_path.substr(0, dir_path.length-1); } // eingeloggt-status if (laut.benutzer && laut.benutzer.auth == 1){ var GA_User_Type = 'Member'; } else{ var GA_User_Type = 'Visitor'; } if (typeof(pageTracker._setCustomVar) !== 'function') { return; } pageTracker._setCustomVar( 1, "User Type", GA_User_Type, 2 ); pageTracker._trackPageview(dir_path + '#' + path); } } return; } /** * open external links in new window */ $(function(){ $('a.extern').click(function(){ $(this).attr('target', '_blank'); }); }); /* * add shuffle-function to jquery */ (function($){ $.fn.shuffle = function() { return this.each(function(){ var items = $(this).children(); return (items.length) ? $(this).html($.shuffle(items)) : this; }); } $.shuffle = function(arr) { for( var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x ); return arr; } })(jQuery); // Global functions for cookie handling function setCookie(name,value,seconds) { if (seconds) { var date = new Date(); date.setTime(date.getTime()+(seconds*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function deleteCookie(name) { setCookie(name,"",-1); }/*! * jQuery Cookie Plugin v1.3 * https://github.com/carhartl/jquery-cookie * * Copyright 2011, Klaus Hartl * Dual licensed under the MIT or GPL Version 2 licenses. * http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/GPL-2.0 */ (function ($, document, undefined) { var pluses = /\+/g; function raw(s) { return s; } function decoded(s) { return decodeURIComponent(s.replace(pluses, ' ')); } var config = $.cookie = function (key, value, options) { // write if (value !== undefined) { options = $.extend({}, config.defaults, options); if (value === null) { options.expires = -1; } if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } value = config.json ? JSON.stringify(value) : String(value); return (document.cookie = [ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // read var decode = config.raw ? raw : decoded; var cookies = document.cookie.split('; '); for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); if (decode(parts.shift()) === key) { var cookie = decode(parts.join('=')); return config.json ? JSON.parse(cookie) : cookie; } } return null; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) !== null) { $.cookie(key, null, options); return true; } return false; }; })(jQuery, document);/* ColorBox v1.1.1 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 (c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php */ jQuery(document).ready(function($){ var clone, loadedWidth, loadedHeight, interfaceHeight, interfaceWidth, index, related, closeModal, loadingElement, modal, modalWrap, modalOverlay, modalLoadingOverlay, modalContent, loaded, modalClose, btc, bml, bmr, bbc; function setModalOverlay(){ $([modalOverlay]).css({"position":"absolute", width:$(window).width(), height:$(window).height(), top:$(window).scrollTop(), left:$(window).scrollLeft()}); } function keypressEvents(e){ if(e.keyCode == 37){ $(document).unbind('keydown', keypressEvents); $("a#contentPrevious").click(); } else if(e.keyCode == 39){ $(document).unbind('keydown', keypressEvents); $("a#contentNext").click(); } } closeModal = function(){ if($("#colorboxInlineTemp").length > 0){ $(loaded).children().insertAfter("#colorboxInlineTemp"); } $([modalOverlay, modal]).css({cursor:"auto"}).fadeOut("fast", function(){ $(loaded).remove(); $(modal).removeData("open"); }); if(loadingElement){$(loadingElement).remove();} $(document).unbind('keydown', keypressEvents); $(window).unbind('resize scroll', setModalOverlay); }; // Convert % values to pixels function setSize(size, dimension){ return (typeof size == 'string') ? (size.match(/%/) ? (dimension/100)*parseInt(size, 10) : parseInt(size, 10)) : size; } //Initialize the modal: store common calculations, preload the interface graphics, append the html. $(function(){ $("body").append( $([ modalOverlay = $('
')[0], modal = $('
')[0] ]).hide() ); $(modal).append( $([ modalWrap = $('
')[0] ]) ); $(modalWrap).append( $([ $('
')[0], bml = $('
')[0], modalContent = $('
')[0], bmr = $('
')[0], $('
')[0] ]) ); $(modalContent).append( $([ loaded = $('

')[0], modalLoadingOverlay = $('
')[0], modalClose = $('')[0] ]) ); $(modalClose).click(function(){ closeModal(); return false; }); btc = $("#borderTopCenter")[0]; bbc = $("#borderBottomCenter")[0]; $(document).bind('keydown', function(e){if(e.keyCode == 27){closeModal();}}); $(modal).css("opacity", 0).show(); interfaceHeight = $(btc).height()+$(bbc).height()+$(modalContent).outerHeight(true) - $(modalContent).height();//Subtraction needed for IE6 interfaceWidth = $(bml).width()+$(bmr).width()+$(modalContent).outerWidth(true) - $(modalContent).width(); loadedHeight = $(loaded).outerHeight(true); loadedWidth = $(loaded).outerWidth(true); $(loaded).empty(); $(modal).css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();//the padding removes the need to do size conversions during the animation step. }); $.fn.colorbox = function(settings, callback) { settings = $.extend({}, $.fn.colorbox.settings, settings); //sets the position of the modal on screen. A transition speed of 0 will result in no animation. function modalPosition(mWidth, mHeight, speed, loadedCallback){ var winHeight = document.documentElement.clientHeight; var posTop = winHeight/2 - mHeight/2 + $(window).scrollTop(); var posLeft = document.documentElement.clientWidth/2 - mWidth/2 + $(window).scrollLeft(); //keeps the box from expanding to an inaccessible area offscreen. if(mHeight > winHeight){posTop -=(mHeight - winHeight);} if(posTop < 0){posTop = 0;} if(posLeft < 0){posLeft = 0;} mWidth = mWidth - interfaceWidth; mHeight = mHeight - interfaceHeight; function modalDimensions(that){ modalContent.style.width = btc.style.width = bbc.style.width = that.style.width; modalContent.style.height = bml.style.height = bmr.style.height = that.style.height; } $(modal).animate({height:mHeight, width:mWidth, top:posTop, left:posLeft}, {duration: speed, complete: function(){ if (loadedCallback) {loadedCallback();} modalDimensions(this); $(document).bind('keydown', keypressEvents); if ($.browser.msie && $.browser.version < 7) {setModalOverlay();} }, step: function(){ modalDimensions(this); } }); } var preloads = []; function preload(){ if(settings.preloading !== false && related.length>1){ var previous, next; previous = index > 0 ? related[index-1].href : related[related.length-1].href; next = index < related.length-1 ? related[index+1].href : related[0].href; return [$("").attr("src", next), $("").attr("src", previous)]; } } function centerModal(object, contentInfo){ var speed = settings.transition=="none" ? 0 : settings.transitionSpeed; $(loaded).remove(); loaded = $(object)[0]; $(loaded).hide().appendTo('body').css({width:(settings.fixedWidth)?settings.fixedWidth - loadedWidth - interfaceWidth:$(loaded).width()}).css({height:(settings.fixedHeight)?settings.fixedHeight - loadedHeight - interfaceHeight:$(loaded).height()}) .attr({id:"modalLoadedContent"}).append(contentInfo).prependTo($(modalContent)); function setPosition(s){ modalPosition(parseInt(loaded.style.width, 10)+loadedWidth+interfaceWidth, parseInt(loaded.style.height, 10)+loadedHeight+interfaceHeight, s, function(){ $(loaded).show(); $(modalLoadingOverlay).hide(); if (callback) {callback();} if (settings.transition == "fade"){$(modal).animate({"opacity":1}, speed);} }); } if (settings.transition == "fade") { $(modal).animate({"opacity":0}, speed, function(){setPosition(0);}); } else { setPosition(speed); } //var preloads = preload(); } function buildGallery(that){ var href = settings.href ? settings.href : that.href; var info = that.title.split("|"); var contentInfo = "

"; if (info[0]){ contentInfo += info[0] + "
"; } if (info[1]){ contentInfo += "" + info[1] + ""; } contentInfo += "

"; if(related.length>1){ //contentInfo += " " + settings.contentCurrent + ""; contentInfo = contentInfo.replace(/\{current\}/, index+1).replace(/\{total\}/, related.length); contentInfo += ""+settings.contentPrevious+""+settings.contentNext+" "; } if (settings.inline) { loadingElement = $('
').hide().insertBefore($(href)[0]); clone = $(href).clone(true); centerModal($(href).wrapAll("
").parent(), contentInfo); } else if (settings.iframe) { centerModal($("
"), contentInfo);//timestamp to prevent caching. } else if (href.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)){ loadingElement = $(" 1)?"style='cursor:pointer;' class='modalPhoto'":"")+" alt='' />").load(function(){ centerModal($("
").append($(this)), contentInfo); }).attr("src",href); }else { loadingElement = $('
').load(href, function(data, textStatus){ if(textStatus == "success"){ centerModal($(this), contentInfo); } else { centerModal($("

Request unsuccessful.

")); } }); } } function contentNav(){ $(modalLoadingOverlay).show(); if($(this).attr("id") == "contentPrevious"){ index = index > 0 ? index-1 : related.length-1; } else { index = index < related.length-1 ? index+1 : 0; } buildGallery(related[index]); // aktion: bildwechsel if(typeof(settings.trackContent) != 'object' && settings.trackContent !== false){ laut.trackClick('wl_foto','foto'); } else { laut.trackClick(settings.trackContent[0], settings.trackContent[1]); } return false; } $(this).bind("click.colorbox", function () { if ($(modal).data("open") !== true) { $(modal).data("open", true); if(settings.fixedWidth){ settings.fixedWidth = setSize(settings.fixedWidth, document.documentElement.clientWidth);} if(settings.fixedHeight){ settings.fixedHeight = setSize(settings.fixedHeight, document.documentElement.clientHeight);} $(modalClose).html(settings.modalClose); $(modalOverlay).css({"opacity": settings.bgOpacity}); $([modal, modalLoadingOverlay, modalOverlay]).show(); modalPosition(setSize(settings.initialWidth, document.documentElement.clientWidth), setSize(settings.initialHeight, document.documentElement.clientHeight), 0); if (this.rel && 'nofollow' != this.rel) { related = $("a[rel='" + this.rel + "']"); index = $(related).index(this); } else { related = $(this); index = 0; } $(modal).css({"opacity":1}); buildGallery(related[index]); $("a#contentPrevious, a#contentNext, .modalPhoto").die().live("click", contentNav); $(document).bind('keydown', keypressEvents); if ($.browser.msie && $.browser.version < 7) { $(window).bind("resize scroll", setModalOverlay); } } if(settings.overlayClose!==false){ $(modalOverlay).css({"cursor":"pointer"}).click(function(){closeModal();}); } // aktion: galerie oeffnen if(typeof(settings.trackOpen) != 'object' && settings.trackOpen !== false){ laut.trackClick('wl_foto','galerie'); } else { laut.trackClick(settings.trackOpen[0], settings.trackOpen[1]); } $('#modalClose, #modalBackgroundOverlay').die('mousedown'); $('#modalClose, #modalBackgroundOverlay').live('mousedown', function(){ // aktion: galerie schliessen if(typeof(settings.trackClose) != 'object' && settings.trackClose !== false){ laut.trackClick('wl_foto','galeriex'); } else { laut.trackClick(settings.trackClose[0], settings.trackClose[1]); } }); return false; }); if(settings.open!==false && $(modal).data("open")!==true){ $(this).triggerHandler('click.colorbox'); } return this.each(function() { }); }; /* ColorBox Default Settings. The colorbox() function takes one argument, an object of key/value pairs, that are used to initialize the modal. Please do not change these settings here, instead overwrite these settings when attaching the colorbox() event to your anchors. Example (Global) : $.fn.colorbox.settings.transition = "fade"; //changes the transition to fade for all colorBox() events proceeding it's declaration. Example (Specific) : $("a[href='http://www.google.com']").colorbox({fixedWidth:"90%", fixedHeight:"450px", iframe:true}); */ $.fn.colorbox.settings = { transition : "elastic", // Transition types: "elastic", "fade", or "none". transitionSpeed : 350, // Sets the speed of the fade and elastic transitions, in milliseconds. initialWidth : "400", // Set the initial width of the modal, prior to any content being loaded. initialHeight : "400", // Set the initial height of the modal, prior to any content being loaded. fixedWidth : false, // Set a fixed width for div#loaded. Example: "500px" fixedHeight : false, // Set a fixed height for div#modalLoadedContent. Example: "500px" inline : false, // Set this to the selector of inline content to be displayed. Example "#myHiddenDiv" or "body p". iframe : false, // If 'true' specifies that content should be displayed in an iFrame. href : false, // This can be used as an alternate anchor URL for ColorBox to use, or can be used to assign a URL for non-anchor elments such as images or form buttons. bgOpacity : 0.85, // The modalBackgroundOverlay opacity level. Range: 0 to 1. preloading : true, // Allows for preloading of 'Next' and 'Previous' content in a shared relation group (same values for the 'rel' attribute), after the current content has finished loading. Set to 'false' to disable. contentCurrent : "image {current} of {total}", // the format of the contentCurrent information contentPrevious : "previous", // the anchor text for the previous link in a shared relation group (same values for 'rel'). contentNext : "next", // the anchor text for the next link in a shared relation group (same 'rel' attribute'). modalClose : "close", // the anchor text for the close link. Esc will also close the modal. open : false, //Automatically opens ColorBox. (fires the click.colorbox event without waiting for user input). overlayClose : true //If true, enables closing ColorBox by clicking on the background overlay. }; }); /*! jQuery UI - v1.8.23 - 2012-08-15 * https://github.com/jquery/jquery-ui * Includes: jquery.ui.core.js * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ (function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15 * https://github.com/jquery/jquery-ui * Includes: jquery.ui.slider.js * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ (function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("
").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.23"})})(jQuery);;/** * jQuery.smoothDivScroll - Smooth div scrolling using jQuery. * This plugin is for turning a set of DIV's into a smooth scrolling area. * * Copyright (c) 2009 Thomas Kahn - thomas.kahn(at)karnhuset(dot)net * * This plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. . * * Date: 2009-03-26 * @author Thomas Kahn * @version 0.7 * * Changelog * --------------------------------------------- * 0.7 - Added support for autoscrolling after the page has loaded. * Added support for making the hotspots visible at start for X number of seconds * or visible all the time. * * 0.6 - First version. */ jQuery(document).ready(function($) { jQuery.fn.smoothDivScroll = function(options){ var defaults = { scrollingHotSpotLeft: "div.scrollingHotSpotLeft", // The hotspot that triggers scrolling left scrollingHotSpotRight: "div.scrollingHotSpotRight", // The hotspot that triggers scrolling right scrollWrapper: "div.scrollWrapper", // The wrapper element that surrounds the scrollable area scrollableArea: "div.scrollableArea", // The actual element that is scrolled left or right hiddenOnStart: false, // True or false. Determines whether the element should be visible or hidden on start ajaxContentURL: "", // Optional. If supplied, content is fetched through AJAX using the supplied URL countOnlyClass: "", // Optional. If supplied, the function that calculates the width of the scrollable area will only count elements of this class mouseDownSpeedBooster: 0.25, // 1 is normal speed (no speed boost), 2 is twice as fast, 3 is three times as fast, and so on autoScrollOnStart: false, // True or false. Determines if scrolling right should start automatically after the page has loaded . The scrollable area will keep on scrolling until the user moves the mouse over the left or right hotspot autoScrollSpeed: 1, // 1-2 = slow, 3-4 = medium, 5-13 = fast -- anything higher = superfast visibleHotSpots: "", // Optional. Leave it blank for invisible hotspots. Otherwise use the values onstart or always. Onstart makes the hotspots visible for X-number of seconds after tha page has loaded and then they become invisible. Always is for making them visible all the time. hotSpotsVisibleTime: 5 // If you have selected onstart, you set the number of seconds that you want the hotspots to be visible. After this time they will become invisible again. }; options = $.extend(defaults, options); /* Identify global variables so JSLint won't raise errors when verifying the code */ /*global autoScrollInterval, autoScrollRight, clearInterval, doScrollLeft, doScrollRight, hideHotSpotBackgrounds, hideHotSpotBackgroundsInterval, hideLeftHotSpot, hideRightHotSpot, jQuery, makeHotSpotBackgroundsVisible, setHotSpotHeightForIE, setInterval, showHideHotSpots, window, windowIsResized */ // Iterate and reformat each matched element return this.each(function() { // Create a variable for the current "mother element" var $mom = $(this); // Load the content of the scrollable area using the optional URL. // If no ajaxContentURL is supplied, we assume that the content of // the scrolling area is already in place /* if(options.ajaxContentURL.length !== 0){ $mom.scrollableAreaWidth = 0; $mom.find(options.scrollableArea).load((options.ajaxContentURL), function(){ $mom.find(options.scrollableArea).children((options.countOnlyClass)).each(function() { $mom.scrollableAreaWidth = $mom.scrollableAreaWidth + $(this).outerWidth(true); }); // Set the width of the scrollable area $mom.find(options.scrollableArea).css("width", ($mom.scrollableAreaWidth + "px")); // Hide the mother element if it shouldn't be visible on start if(options.hiddenOnStart) { $mom.hide(); } windowIsResized(); setHotSpotHeightForIE(); }); } */ // Some variables used for working with the scrolling var scrollXpos; var booster; // The left offset of the container on which you place // the scrolling behavior. // This offset is used when calculating the mouse x-position // in relation to scroll hotspots var motherElementOffset = $mom.offset().left; // A variable used for storing the current hotspot width. // It is used when calculating the scroll speed var hotSpotWidth = 0; // Set the booster value to normal (doesn't change until the user // holds down the mouse button over one of the hotspots) booster = 0.25; // Stuff to do once on load //$(window).one("load", lautFotoInit); lautFotoInit(); function lautFotoInit(){ // If the content of the scrolling area is not loaded through ajax, // we assume it's already there and can run the code to calculate // the width of the scrolling area, resize it to that width if(options.ajaxContentURL.length === 0) { $mom.scrollableAreaWidth = 0; $mom.find(options.scrollableArea).children((options.countOnlyClass)).each(function() { $mom.scrollableAreaWidth = $mom.scrollableAreaWidth + $(this).outerWidth(true); }); $mom.find(options.scrollableArea).css("width", $mom.scrollableAreaWidth + "px"); if(options.hiddenOnStart) { $mom.hide(); } } } function makeHotSpotBackgroundsVisible() { // Alter the CSS (SmoothDivScroll.css) if you want to customize // the look of the visible hotspots // The left hotspot $mom.find(options.scrollingHotSpotLeft).addClass("scrollingHotSpotLeftVisible"); // The right hotspot $mom.find(options.scrollingHotSpotRight).addClass("scrollingHotSpotRightVisible"); } function hideHotSpotBackgrounds() { clearInterval(hideHotSpotBackgroundsInterval); // The left hotspot $mom.find(options.scrollingHotSpotLeft).fadeTo("slow", 0.0, function(){ $mom.find(options.scrollingHotSpotLeft).removeClass("scrollingHotSpotLeftVisible"); }); // The right hotspot $mom.find(options.scrollingHotSpotRight).fadeTo("slow", 0.0, function(){ $mom.find(options.scrollingHotSpotRight).removeClass("scrollingHotSpotRightVisible"); }); } // EVENT - window resize /* $(window).bind("resize",function(){ windowIsResized(); }); */ // A function for doing the stuff that needs to be // done when the browser window is resized function windowIsResized() { // If the scrollable area is not hidden on start, reset and recalculate the // width of the scrollable area if(!(options.hiddenOnStart)) { $mom.scrollableAreaWidth = 0; $mom.find(options.scrollableArea).children((options.countOnlyClass)).each(function() { $mom.scrollableAreaWidth = $mom.scrollableAreaWidth + $(this).outerWidth(true); }); $mom.find(options.scrollableArea).css("width", $mom.scrollableAreaWidth + 'px'); } // Reset the left offset of the scroll wrapper $mom.find(options.scrollWrapper).scrollLeft("0"); // Get the width of the page (body) var bodyWidth = $("body").innerWidth(); // If the scrollable area is shorter than the current // window width, both scroll hotspots should be hidden. // Otherwise, check which hotspots should be shown. if($mom.scrollableAreaWidth < bodyWidth) { hideLeftHotSpot(); hideRightHotSpot(); } else { showHideHotSpots(); } } // HELPER FUNCTIONS FOR SHOWING AND HIDING HOT SPOTS function hideLeftHotSpot(){ $mom.find(options.scrollingHotSpotLeft).hide(); } //hideLeftHotSpot(); function hideRightHotSpot(){ $mom.find(options.scrollingHotSpotRight).hide(); } function showLeftHotSpot(){ $mom.find(options.scrollingHotSpotLeft).show(); // Recalculate the hotspot width. Do it here because you can // be sure that the hotspot is visible and has a width if(hotSpotWidth <= 0) { hotSpotWidth = $mom.find(options.scrollingHotSpotLeft).width(); } } function showRightHotSpot(){ $mom.find(options.scrollingHotSpotRight).show(); // Recalculate the hotspot width. Do it here because you can // be sure that the hotspot is visible and has a width if(hotSpotWidth <= 0) { hotSpotWidth = $mom.find(options.scrollingHotSpotRight).width(); } } function setHotSpotHeightForIE() { // Some bugfixing for IE 6 jQuery.each(jQuery.browser, function(i, val) { if(i=="msie" && jQuery.browser.version.substr(0,1)=="6") { $mom.find(options.scrollingHotSpotLeft).css("height", ($mom.find(options.scrollableArea).innerHeight())); $mom.find(options.scrollingHotSpotRight).css("height", ($mom.find(options.scrollableArea).innerHeight())); } }); } /* $mom.find(options.scrollingHotSpotRight).bind('mousemove',function(e){ var x = e.pageX - (this.offsetLeft + motherElementOffset); x = Math.round(x/(hotSpotWidth/15)); scrollXpos = x; }); // scrolling speed booster right $mom.find(options.scrollingHotSpotRight).bind('mousedown',function(e){ booster = options.mouseDownSpeedBooster; }); // stop boosting the scrolling speed $("*").bind('mouseup',function(e){ booster = 0.25; }); // The function that autoscrolls right var autoScrollRight = function() { $mom.find(options.scrollWrapper).scrollLeft($mom.find(options.scrollWrapper).scrollLeft() + options.autoScrollSpeed); showHideHotSpots(); }; // scrolling speed booster left $mom.find(options.scrollingHotSpotLeft).bind('mousedown',function(e){ booster = options.mouseDownSpeedBooster; }); // mousemove left hotspot $mom.find(options.scrollingHotSpotLeft).bind('mousemove',function(e){ var x = $mom.find(options.scrollingHotSpotLeft).innerWidth() - (e.pageX - motherElementOffset); x = Math.round(x/(hotSpotWidth/15)); scrollXpos = x; }); */ // EVENTS - scroll right var rightScrollInterval; // mouseover right hotspot $mom.find(options.scrollingHotSpotRight).bind('mouseover',function(e){ if(options.autoScrollOnStart) { clearInterval(autoScrollInterval); } rightScrollInterval = setInterval(doScrollRight, 15); }); // mouseout right hotspot $mom.find(options.scrollingHotSpotRight).bind('mouseout',function(e){ clearInterval(rightScrollInterval); scrollXpos = 0; }); // The function that does the actual scrolling right var doScrollRight = function() { //$mom.find(options.scrollWrapper).scrollLeft($mom.find(options.scrollWrapper).scrollLeft() + (scrollXpos*booster)); $mom.find(options.scrollWrapper).scrollLeft($mom.find(options.scrollWrapper).scrollLeft() + 4); showHideHotSpots(); }; // EVENTS - scroll left var leftScrollInterval; // mouseover left hotspot $mom.find(options.scrollingHotSpotLeft).bind('mouseover',function(e){ if(options.autoScrollOnStart) { clearInterval(autoScrollInterval); } leftScrollInterval = setInterval(doScrollLeft, 15); }); // mouseout left hotspot $mom.find(options.scrollingHotSpotLeft).bind('mouseout',function(e){ clearInterval(leftScrollInterval); scrollXpos = 0; }); // The function that does the actual scrolling left var doScrollLeft = function() { $mom.find(options.scrollWrapper).scrollLeft($mom.find(options.scrollWrapper).scrollLeft() - 4); showHideHotSpots(); }; // Function for showing and hiding hotspots depending on the // offset of the scrolling function showHideHotSpots() { // When you can't scroll further left // the left scroll hotspot should be hidden // and the right hotspot visible if($mom.find(options.scrollWrapper).scrollLeft() === 0) { hideLeftHotSpot(); showRightHotSpot(); } // When you can't scroll further right // the right scroll hotspot should be hidden // and the left hotspot visible else if(($mom.scrollableAreaWidth) <= ($mom.find(options.scrollWrapper).innerWidth() + $mom.find(options.scrollWrapper).scrollLeft())) { hideRightHotSpot(); showLeftHotSpot(); } // If you are somewhere in the middle of your // scrolling, both hotspots should be visible else { showRightHotSpot(); showLeftHotSpot(); } } }); }; });/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.4 * * Requires: 1.2.2+ */ (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);/*! * jScrollPane - v2.0.0beta12 - 2012-07-24 * http://jscrollpane.kelvinluck.com/ * * Copyright (c) 2010 Kelvin Luck * Dual licensed under the MIT and GPL licenses. */ // Script: jScrollPane - cross browser customisable scrollbars // // *Version: 2.0.0beta12, Last updated: 2012-07-24* // // Project Home - http://jscrollpane.kelvinluck.com/ // GitHub - http://github.com/vitch/jScrollPane // Source - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.js // (Minified) - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.min.js // // About: License // // Copyright (c) 2012 Kelvin Luck // Dual licensed under the MIT or GPL Version 2 licenses. // http://jscrollpane.kelvinluck.com/MIT-LICENSE.txt // http://jscrollpane.kelvinluck.com/GPL-LICENSE.txt // // About: Examples // // All examples and demos are available through the jScrollPane example site at: // http://jscrollpane.kelvinluck.com/ // // About: Support and Testing // // This plugin is tested on the browsers below and has been found to work reliably on them. If you run // into a problem on one of the supported browsers then please visit the support section on the jScrollPane // website (http://jscrollpane.kelvinluck.com/) for more information on getting support. You are also // welcome to fork the project on GitHub if you can contribute a fix for a given issue. // // jQuery Versions - tested in 1.4.2+ - reported to work in 1.3.x // Browsers Tested - Firefox 3.6.8, Safari 5, Opera 10.6, Chrome 5.0, IE 6, 7, 8 // // About: Release History // // 2.0.0beta12 - (In progress) // 2.0.0beta11 - (2012-05-14) // 2.0.0beta10 - (2011-04-17) cleaner required size calculation, improved keyboard support, stickToBottom/Left, other small fixes // 2.0.0beta9 - (2011-01-31) new API methods, bug fixes and correct keyboard support for FF/OSX // 2.0.0beta8 - (2011-01-29) touchscreen support, improved keyboard support // 2.0.0beta7 - (2011-01-23) scroll speed consistent (thanks Aivo Paas) // 2.0.0beta6 - (2010-12-07) scrollToElement horizontal support // 2.0.0beta5 - (2010-10-18) jQuery 1.4.3 support, various bug fixes // 2.0.0beta4 - (2010-09-17) clickOnTrack support, bug fixes // 2.0.0beta3 - (2010-08-27) Horizontal mousewheel, mwheelIntent, keyboard support, bug fixes // 2.0.0beta2 - (2010-08-21) Bug fixes // 2.0.0beta1 - (2010-08-17) Rewrite to follow modern best practices and enable horizontal scrolling, initially hidden // elements and dynamically sized elements. // 1.x - (2006-12-31 - 2010-07-31) Initial version, hosted at googlecode, deprecated (function($,window,undefined){ $.fn.jScrollPane = function(settings) { // JScrollPane "class" - public methods are available through $('selector').data('jsp') function JScrollPane(elem, s) { var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY, verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition, verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown, horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight, reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth, wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false, originalElement = elem.clone(false, false).empty(), mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp'; originalPadding = elem.css('paddingTop') + ' ' + elem.css('paddingRight') + ' ' + elem.css('paddingBottom') + ' ' + elem.css('paddingLeft'); originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) + (parseInt(elem.css('paddingRight'), 10) || 0); function initialise(s) { var /*firstChild, lastChild, */isMaintainingPositon, lastContentX, lastContentY, hasContainingSpaceChanged, originalScrollTop, originalScrollLeft, maintainAtBottom = false, maintainAtRight = false; settings = s; if (pane === undefined) { originalScrollTop = elem.scrollTop(); originalScrollLeft = elem.scrollLeft(); elem.css( { overflow: 'hidden', padding: 0 } ); // TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should // come back to it later and check once it is unhidden... paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); elem.width(paneWidth); pane = $('
').css('padding', originalPadding).append(elem.children()); container = $('
') .css({ 'width': paneWidth + 'px', 'height': paneHeight + 'px' } ).append(pane).appendTo(elem); /* // Move any margins from the first and last children up to the container so they can still // collapse with neighbouring elements as they would before jScrollPane firstChild = pane.find(':first-child'); lastChild = pane.find(':last-child'); elem.css( { 'margin-top': firstChild.css('margin-top'), 'margin-bottom': lastChild.css('margin-bottom') } ); firstChild.css('margin-top', 0); lastChild.css('margin-bottom', 0); */ } else { elem.css('width', ''); maintainAtBottom = settings.stickToBottom && isCloseToBottom(); maintainAtRight = settings.stickToRight && isCloseToRight(); hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight; if (hasContainingSpaceChanged) { paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); container.css({ width: paneWidth + 'px', height: paneHeight + 'px' }); } // If nothing changed since last check... if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) { elem.width(paneWidth); return; } previousContentWidth = contentWidth; pane.css('width', ''); elem.width(paneWidth); container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end(); } pane.css('overflow', 'auto'); if (s.contentWidth) { contentWidth = s.contentWidth; } else { contentWidth = pane[0].scrollWidth; } contentHeight = pane[0].scrollHeight; pane.css('overflow', ''); percentInViewH = contentWidth / paneWidth; percentInViewV = contentHeight / paneHeight; isScrollableV = percentInViewV > 1; isScrollableH = percentInViewH > 1; // console.log(paneWidth, paneHeight, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableH, isScrollableV); if (!(isScrollableH || isScrollableV)) { elem.removeClass('jspScrollable'); pane.css({ top: 0, width: container.width() - originalPaddingTotalWidth }); removeMousewheel(); removeFocusHandler(); removeKeyboardNav(); removeClickOnTrack(); } else { elem.addClass('jspScrollable'); isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition); if (isMaintainingPositon) { lastContentX = contentPositionX(); lastContentY = contentPositionY(); } initialiseVerticalScroll(); initialiseHorizontalScroll(); resizeScrollbars(); if (isMaintainingPositon) { scrollToX(maintainAtRight ? (contentWidth - paneWidth ) : lastContentX, false); scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false); } initFocusHandler(); initMousewheel(); initTouch(); if (settings.enableKeyboardNavigation) { initKeyboardNav(); } if (settings.clickOnTrack) { initClickOnTrack(); } observeHash(); if (settings.hijackInternalLinks) { hijackInternalLinks(); } } if (settings.autoReinitialise && !reinitialiseInterval) { reinitialiseInterval = setInterval( function() { initialise(settings); }, settings.autoReinitialiseDelay ); } else if (!settings.autoReinitialise && reinitialiseInterval) { clearInterval(reinitialiseInterval); } originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false); originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false); elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]); } function initialiseVerticalScroll() { if (isScrollableV) { container.append( $('
').append( $('
'), $('
').append( $('
').append( $('
'), $('
') ) ), $('
') ) ); verticalBar = container.find('>.jspVerticalBar'); verticalTrack = verticalBar.find('>.jspTrack'); verticalDrag = verticalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowUp = $('').bind( 'mousedown.jsp', getArrowScroll(0, -1) ).bind('click.jsp', nil); arrowDown = $('').bind( 'mousedown.jsp', getArrowScroll(0, 1) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp)); arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown)); } appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown); } verticalTrackHeight = paneHeight; container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each( function() { verticalTrackHeight -= $(this).outerHeight(); } ); verticalDrag.hover( function() { verticalDrag.addClass('jspHover'); }, function() { verticalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function(e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); verticalDrag.addClass('jspActive'); var startY = e.pageY - verticalDrag.position().top; $('html').bind( 'mousemove.jsp', function(e) { positionDragY(e.pageY - startY, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); sizeVerticalScrollbar(); } } function sizeVerticalScrollbar() { verticalTrack.height(verticalTrackHeight + 'px'); verticalDragPosition = 0; scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth(); // Make the pane thinner to allow for the vertical scrollbar pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth); // Add margin to the left of the pane if scrollbars are on that side (to position // the scrollbar on the left or right set it's left or right property in CSS) try { if (verticalBar.position().left === 0) { pane.css('margin-left', scrollbarWidth + 'px'); } } catch (err) { } } function initialiseHorizontalScroll() { if (isScrollableH) { container.append( $('
').append( $('
'), $('
').append( $('
').append( $('
'), $('
') ) ), $('
') ) ); horizontalBar = container.find('>.jspHorizontalBar'); horizontalTrack = horizontalBar.find('>.jspTrack'); horizontalDrag = horizontalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowLeft = $('').bind( 'mousedown.jsp', getArrowScroll(-1, 0) ).bind('click.jsp', nil); arrowRight = $('').bind( 'mousedown.jsp', getArrowScroll(1, 0) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft)); arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight)); } appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight); } horizontalDrag.hover( function() { horizontalDrag.addClass('jspHover'); }, function() { horizontalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function(e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); horizontalDrag.addClass('jspActive'); var startX = e.pageX - horizontalDrag.position().left; $('html').bind( 'mousemove.jsp', function(e) { positionDragX(e.pageX - startX, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); horizontalTrackWidth = container.innerWidth(); sizeHorizontalScrollbar(); } } function sizeHorizontalScrollbar() { container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each( function() { horizontalTrackWidth -= $(this).outerWidth(); } ); horizontalTrack.width(horizontalTrackWidth + 'px'); horizontalDragPosition = 0; } function resizeScrollbars() { if (isScrollableH && isScrollableV) { var horizontalTrackHeight = horizontalTrack.outerHeight(), verticalTrackWidth = verticalTrack.outerWidth(); verticalTrackHeight -= horizontalTrackHeight; $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each( function() { horizontalTrackWidth += $(this).outerWidth(); } ); horizontalTrackWidth -= verticalTrackWidth; paneHeight -= verticalTrackWidth; paneWidth -= horizontalTrackHeight; horizontalTrack.parent().append( $('
').css('width', horizontalTrackHeight + 'px') ); sizeVerticalScrollbar(); sizeHorizontalScrollbar(); } // reflow content if (isScrollableH) { pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px'); } contentHeight = pane.outerHeight(); percentInViewV = contentHeight / paneHeight; if (isScrollableH) { horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth); if (horizontalDragWidth > settings.horizontalDragMaxWidth) { horizontalDragWidth = settings.horizontalDragMaxWidth; } else if (horizontalDragWidth < settings.horizontalDragMinWidth) { horizontalDragWidth = settings.horizontalDragMinWidth; } horizontalDrag.width(horizontalDragWidth + 'px'); dragMaxX = horizontalTrackWidth - horizontalDragWidth; _positionDragX(horizontalDragPosition); // To update the state for the arrow buttons } if (isScrollableV) { verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight); if (verticalDragHeight > settings.verticalDragMaxHeight) { verticalDragHeight = settings.verticalDragMaxHeight; } else if (verticalDragHeight < settings.verticalDragMinHeight) { verticalDragHeight = settings.verticalDragMinHeight; } verticalDrag.height(verticalDragHeight + 'px'); dragMaxY = verticalTrackHeight - verticalDragHeight; _positionDragY(verticalDragPosition); // To update the state for the arrow buttons } } function appendArrows(ele, p, a1, a2) { var p1 = "before", p2 = "after", aTemp; // Sniff for mac... Is there a better way to determine whether the arrows would naturally appear // at the top or the bottom of the bar? if (p == "os") { p = /Mac/.test(navigator.platform) ? "after" : "split"; } if (p == p1) { p2 = p; } else if (p == p2) { p1 = p; aTemp = a1; a1 = a2; a2 = aTemp; } ele[p1](a1)[p2](a2); } function getArrowScroll(dirX, dirY, ele) { return function() { arrowScroll(dirX, dirY, this, ele); this.blur(); return false; }; } function arrowScroll(dirX, dirY, arrow, ele) { arrow = $(arrow).addClass('jspActive'); var eve, scrollTimeout, isFirst = true, doScroll = function() { if (dirX !== 0) { jsp.scrollByX(dirX * settings.arrowButtonSpeed); } if (dirY !== 0) { jsp.scrollByY(dirY * settings.arrowButtonSpeed); } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq); isFirst = false; }; doScroll(); eve = ele ? 'mouseout.jsp' : 'mouseup.jsp'; ele = ele || $('html'); ele.bind( eve, function() { arrow.removeClass('jspActive'); scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; ele.unbind(eve); } ); } function initClickOnTrack() { removeClickOnTrack(); if (isScrollableV) { verticalTrack.bind( 'mousedown.jsp', function(e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageY - offset.top - verticalDragPosition, scrollTimeout, isFirst = true, doScroll = function() { var offset = clickedTrack.offset(), pos = e.pageY - offset.top - verticalDragHeight / 2, contentDragY = paneHeight * settings.scrollPagePercent, dragY = dragMaxY * contentDragY / (contentHeight - paneHeight); if (direction < 0) { if (verticalDragPosition - dragY > pos) { jsp.scrollByY(-contentDragY); } else { positionDragY(pos); } } else if (direction > 0) { if (verticalDragPosition + dragY < pos) { jsp.scrollByY(contentDragY); } else { positionDragY(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function() { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } if (isScrollableH) { horizontalTrack.bind( 'mousedown.jsp', function(e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageX - offset.left - horizontalDragPosition, scrollTimeout, isFirst = true, doScroll = function() { var offset = clickedTrack.offset(), pos = e.pageX - offset.left - horizontalDragWidth / 2, contentDragX = paneWidth * settings.scrollPagePercent, dragX = dragMaxX * contentDragX / (contentWidth - paneWidth); if (direction < 0) { if (horizontalDragPosition - dragX > pos) { jsp.scrollByX(-contentDragX); } else { positionDragX(pos); } } else if (direction > 0) { if (horizontalDragPosition + dragX < pos) { jsp.scrollByX(contentDragX); } else { positionDragX(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function() { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } } function removeClickOnTrack() { if (horizontalTrack) { horizontalTrack.unbind('mousedown.jsp'); } if (verticalTrack) { verticalTrack.unbind('mousedown.jsp'); } } function cancelDrag() { $('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp'); if (verticalDrag) { verticalDrag.removeClass('jspActive'); } if (horizontalDrag) { horizontalDrag.removeClass('jspActive'); } } function positionDragY(destY, animate) { if (!isScrollableV) { return; } if (destY < 0) { destY = 0; } else if (destY > dragMaxY) { destY = dragMaxY; } // can't just check if(animate) because false is a valid value that could be passed in... if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(verticalDrag, 'top', destY, _positionDragY); } else { verticalDrag.css('top', destY); _positionDragY(destY); } } function _positionDragY(destY) { if (destY === undefined) { destY = verticalDrag.position().top; } container.scrollTop(0); verticalDragPosition = destY; var isAtTop = verticalDragPosition === 0, isAtBottom = verticalDragPosition == dragMaxY, percentScrolled = destY/ dragMaxY, destTop = -percentScrolled * (contentHeight - paneHeight); if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) { wasAtTop = isAtTop; wasAtBottom = isAtBottom; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateVerticalArrows(isAtTop, isAtBottom); pane.css('top', destTop); elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll'); } function positionDragX(destX, animate) { if (!isScrollableH) { return; } if (destX < 0) { destX = 0; } else if (destX > dragMaxX) { destX = dragMaxX; } if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(horizontalDrag, 'left', destX, _positionDragX); } else { horizontalDrag.css('left', destX); _positionDragX(destX); } } function _positionDragX(destX) { if (destX === undefined) { destX = horizontalDrag.position().left; } container.scrollTop(0); horizontalDragPosition = destX; var isAtLeft = horizontalDragPosition === 0, isAtRight = horizontalDragPosition == dragMaxX, percentScrolled = destX / dragMaxX, destLeft = -percentScrolled * (contentWidth - paneWidth); if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) { wasAtLeft = isAtLeft; wasAtRight = isAtRight; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateHorizontalArrows(isAtLeft, isAtRight); pane.css('left', destLeft); elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll'); } function updateVerticalArrows(isAtTop, isAtBottom) { if (settings.showArrows) { arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled'); arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled'); } } function updateHorizontalArrows(isAtLeft, isAtRight) { if (settings.showArrows) { arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled'); arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled'); } } function scrollToY(destY, animate) { var percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); } function scrollToX(destX, animate) { var percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); } function scrollToElement(ele, stickToTop, animate) { var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX; // Legal hash values aren't necessarily legal jQuery selectors so we need to catch any // errors from the lookup... try { e = $(ele); } catch (err) { return; } eleHeight = e.outerHeight(); eleWidth= e.outerWidth(); container.scrollTop(0); container.scrollLeft(0); // loop through parents adding the offset top of any elements that are relatively positioned between // the focused element and the jspPane so we can get the true distance from the top // of the focused element to the top of the scrollpane... while (!e.is('.jspPane')) { eleTop += e.position().top; eleLeft += e.position().left; e = e.offsetParent(); if (/^body|html$/i.test(e[0].nodeName)) { // we ended up too high in the document structure. Quit! return; } } viewportTop = contentPositionY(); maxVisibleEleTop = viewportTop + paneHeight; if (eleTop < viewportTop || stickToTop) { // element is above viewport destY = eleTop - settings.verticalGutter; } else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport destY = eleTop - paneHeight + eleHeight + settings.verticalGutter; } if (destY) { scrollToY(destY, animate); } viewportLeft = contentPositionX(); maxVisibleEleLeft = viewportLeft + paneWidth; if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport destX = eleLeft - settings.horizontalGutter; } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter; } if (destX) { scrollToX(destX, animate); } } function contentPositionX() { return -pane.position().left; } function contentPositionY() { return -pane.position().top; } function isCloseToBottom() { var scrollableHeight = contentHeight - paneHeight; return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10); } function isCloseToRight() { var scrollableWidth = contentWidth - paneWidth; return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10); } function initMousewheel() { container.unbind(mwEvent).bind( mwEvent, function (event, delta, deltaX, deltaY) { var dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollBy(deltaX * settings.mouseWheelSpeed, -deltaY * settings.mouseWheelSpeed, false); // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ); } function removeMousewheel() { container.unbind(mwEvent); } function nil() { return false; } function initFocusHandler() { pane.find(':input,a').unbind('focus.jsp').bind( 'focus.jsp', function(e) { scrollToElement(e.target, false); } ); } function removeFocusHandler() { pane.find(':input,a').unbind('focus.jsp'); } function initKeyboardNav() { var keyDown, elementHasScrolled, validParents = []; isScrollableH && validParents.push(horizontalBar[0]); isScrollableV && validParents.push(verticalBar[0]); // IE also focuses elements that don't have tabindex set. pane.focus( function() { elem.focus(); } ); elem.attr('tabindex', 0) .unbind('keydown.jsp keypress.jsp') .bind( 'keydown.jsp', function(e) { if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)){ return; } var dX = horizontalDragPosition, dY = verticalDragPosition; switch(e.keyCode) { case 40: // down case 38: // up case 34: // page down case 32: // space case 33: // page up case 39: // right case 37: // left keyDown = e.keyCode; keyDownHandler(); break; case 35: // end scrollToY(contentHeight - paneHeight); keyDown = null; break; case 36: // home scrollToY(0); keyDown = null; break; } elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition; return !elementHasScrolled; } ).bind( 'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls... function(e) { if (e.keyCode == keyDown) { keyDownHandler(); } return !elementHasScrolled; } ); if (settings.hideFocus) { elem.css('outline', 'none'); if ('hideFocus' in container[0]){ elem.attr('hideFocus', true); } } else { elem.css('outline', ''); if ('hideFocus' in container[0]){ elem.attr('hideFocus', false); } } function keyDownHandler() { var dX = horizontalDragPosition, dY = verticalDragPosition; switch(keyDown) { case 40: // down jsp.scrollByY(settings.keyboardSpeed, false); break; case 38: // up jsp.scrollByY(-settings.keyboardSpeed, false); break; case 34: // page down case 32: // space jsp.scrollByY(paneHeight * settings.scrollPagePercent, false); break; case 33: // page up jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false); break; case 39: // right jsp.scrollByX(settings.keyboardSpeed, false); break; case 37: // left jsp.scrollByX(-settings.keyboardSpeed, false); break; } elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition; return elementHasScrolled; } } function removeKeyboardNav() { elem.attr('tabindex', '-1') .removeAttr('tabindex') .unbind('keydown.jsp keypress.jsp'); } function observeHash() { if (location.hash && location.hash.length > 1) { var e, retryInt, hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS ; try { e = $('#' + hash + ', a[name="' + hash + '"]'); } catch (err) { return; } if (e.length && pane.find(hash)) { // nasty workaround but it appears to take a little while before the hash has done its thing // to the rendered page so we just wait until the container's scrollTop has been messed up. if (container.scrollTop() === 0) { retryInt = setInterval( function() { if (container.scrollTop() > 0) { scrollToElement(e, true); $(document).scrollTop(container.position().top); clearInterval(retryInt); } }, 50 ); } else { scrollToElement(e, true); $(document).scrollTop(container.position().top); } } } } function hijackInternalLinks() { // only register the link handler once if ($(document.body).data('jspHijack')) { return; } // remember that the handler was bound $(document.body).data('jspHijack', true); // use live handler to also capture newly created links $(document.body).delegate('a[href*=#]', 'click', function(event) { // does the link point to the same page? // this also takes care of cases with a -Tag or Links not starting with the hash # // e.g. when the current url already is index.html var href = this.href.substr(0, this.href.indexOf('#')), locationHref = location.href, hash, element, container, jsp, scrollTop, elementTop; if (location.href.indexOf('#') !== -1) { locationHref = location.href.substr(0, location.href.indexOf('#')); } if (href !== locationHref) { // the link points to another page return; } // check if jScrollPane should handle this click event hash = escape(this.href.substr(this.href.indexOf('#') + 1)); // find the element on the page element; try { element = $('#' + hash + ', a[name="' + hash + '"]'); } catch (e) { // hash is not a valid jQuery identifier return; } if (!element.length) { // this link does not point to an element on this page return; } container = element.closest('.jspScrollable'); jsp = container.data('jsp'); // jsp might be another jsp instance than the one, that bound this event // remember: this event is only bound once for all instances. jsp.scrollToElement(element, true); if (container[0].scrollIntoView) { // also scroll to the top of the container (if it is not visible) scrollTop = $(window).scrollTop(); elementTop = element.offset().top; if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) { container[0].scrollIntoView(); } } // jsp handled this event, prevent the browser default (scrolling :P) event.preventDefault(); }); } // Init touch on iPad, iPhone, iPod, Android function initTouch() { var startX, startY, touchStartX, touchStartY, moved, moving = false; container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind( 'touchstart.jsp', function(e) { var touch = e.originalEvent.touches[0]; startX = contentPositionX(); startY = contentPositionY(); touchStartX = touch.pageX; touchStartY = touch.pageY; moved = false; moving = true; } ).bind( 'touchmove.jsp', function(ev) { if(!moving) { return; } var touchPos = ev.originalEvent.touches[0], dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY); moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5; // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ).bind( 'touchend.jsp', function(e) { moving = false; /*if(moved) { return false; }*/ } ).bind( 'click.jsp-touchclick', function(e) { if(moved) { moved = false; return false; } } ); } function destroy(){ var currentY = contentPositionY(), currentX = contentPositionX(); elem.removeClass('jspScrollable').unbind('.jsp'); elem.replaceWith(originalElement.append(pane.children())); originalElement.scrollTop(currentY); originalElement.scrollLeft(currentX); // clear reinitialize timer if active if (reinitialiseInterval) { clearInterval(reinitialiseInterval); } } // Public API $.extend( jsp, { // Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it // was initialised). The settings object which is passed in will override any settings from the // previous time it was initialised - if you don't pass any settings then the ones from the previous // initialisation will be used. reinitialise: function(s) { s = $.extend({}, settings, s); initialise(s); }, // Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so // that it can be seen within the viewport. If stickToTop is true then the element will appear at // the top of the viewport, if it is false then the viewport will scroll as little as possible to // show the element. You can also specify if you want animation to occur. If you don't provide this // argument then the animateScroll value from the settings object is used instead. scrollToElement: function(ele, stickToTop, animate) { scrollToElement(ele, stickToTop, animate); }, // Scrolls the pane so that the specified co-ordinates within the content are at the top left // of the viewport. animate is optional and if not passed then the value of animateScroll from // the settings object this jScrollPane was initialised with is used. scrollTo: function(destX, destY, animate) { scrollToX(destX, animate); scrollToY(destY, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the left of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToX: function(destX, animate) { scrollToX(destX, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the top of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToY: function(destY, animate) { scrollToY(destY, animate); }, // Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentX: function(destPercentX, animate) { scrollToX(destPercentX * (contentWidth - paneWidth), animate); }, // Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentY: function(destPercentY, animate) { scrollToY(destPercentY * (contentHeight - paneHeight), animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollBy: function(deltaX, deltaY, animate) { jsp.scrollByX(deltaX, animate); jsp.scrollByY(deltaY, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByX: function(deltaX, animate) { var destX = contentPositionX() + Math[deltaX<0 ? 'floor' : 'ceil'](deltaX), percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByY: function(deltaY, animate) { var destY = contentPositionY() + Math[deltaY<0 ? 'floor' : 'ceil'](deltaY), percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); }, // Positions the horizontal drag at the specified x position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragX: function(x, animate) { positionDragX(x, animate); }, // Positions the vertical drag at the specified y position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragY: function(y, animate) { positionDragY(y, animate); }, // This method is called when jScrollPane is trying to animate to a new position. You can override // it if you want to provide advanced animation functionality. It is passed the following arguments: // * ele - the element whose position is being animated // * prop - the property that is being animated // * value - the value it's being animated to // * stepCallback - a function that you must execute each time you update the value of the property // You can use the default implementation (below) as a starting point for your own implementation. animate: function(ele, prop, value, stepCallback) { var params = {}; params[prop] = value; ele.animate( params, { 'duration' : settings.animateDuration, 'easing' : settings.animateEase, 'queue' : false, 'step' : stepCallback } ); }, // Returns the current x position of the viewport with regards to the content pane. getContentPositionX: function() { return contentPositionX(); }, // Returns the current y position of the viewport with regards to the content pane. getContentPositionY: function() { return contentPositionY(); }, // Returns the width of the content within the scroll pane. getContentWidth: function() { return contentWidth; }, // Returns the height of the content within the scroll pane. getContentHeight: function() { return contentHeight; }, // Returns the horizontal position of the viewport within the pane content. getPercentScrolledX: function() { return contentPositionX() / (contentWidth - paneWidth); }, // Returns the vertical position of the viewport within the pane content. getPercentScrolledY: function() { return contentPositionY() / (contentHeight - paneHeight); }, // Returns whether or not this scrollpane has a horizontal scrollbar. getIsScrollableH: function() { return isScrollableH; }, // Returns whether or not this scrollpane has a vertical scrollbar. getIsScrollableV: function() { return isScrollableV; }, // Gets a reference to the content pane. It is important that you use this method if you want to // edit the content of your jScrollPane as if you access the element directly then you may have some // problems (as your original element has had additional elements for the scrollbars etc added into // it). getContentPane: function() { return pane; }, // Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the // animateScroll value from settings is used instead. scrollToBottom: function(animate) { positionDragY(dragMaxY, animate); }, // Hijacks the links on the page which link to content inside the scrollpane. If you have changed // the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the // contents of your scroll pane will work then call this function. hijackInternalLinks: $.noop, // Removes the jScrollPane and returns the page to the state it was in before jScrollPane was // initialised. destroy: function() { destroy(); } } ); initialise(s); } // Pluginifying code... settings = $.extend({}, $.fn.jScrollPane.defaults, settings); // Apply default speed $.each(['mouseWheelSpeed', 'arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function() { settings[this] = settings[this] || settings.speed; }); return this.each( function() { var elem = $(this), jspApi = elem.data('jsp'); if (jspApi) { jspApi.reinitialise(settings); } else { $("script",elem).filter('[type="text/javascript"],:not([type])').remove(); jspApi = new JScrollPane(elem, settings); elem.data('jsp', jspApi); } } ); }; $.fn.jScrollPane.defaults = { showArrows : false, maintainPosition : true, stickToBottom : false, stickToRight : false, clickOnTrack : true, autoReinitialise : false, autoReinitialiseDelay : 500, verticalDragMinHeight : 0, verticalDragMaxHeight : 99999, horizontalDragMinWidth : 0, horizontalDragMaxWidth : 99999, contentWidth : undefined, animateScroll : false, animateDuration : 300, animateEase : 'linear', hijackInternalLinks : false, verticalGutter : 4, horizontalGutter : 4, mouseWheelSpeed : 0, arrowButtonSpeed : 0, arrowRepeatFreq : 50, arrowScrollOnHover : false, trackClickSpeed : 0, trackClickRepeatFreq : 70, verticalArrowPositions : 'split', horizontalArrowPositions : 'split', enableKeyboardNavigation : true, hideFocus : false, keyboardSpeed : 0, initialDelay : 300, // Delay before starting repeating speed : 30, // Default speed when others falsey scrollPagePercent : .8 // Percent of visible area scrolled when pageUp/Down or track area pressed }; })(jQuery,this);/* * jQuery Autocomplete plugin 1.1 * * Copyright (c) 2009 Jörn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */ eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.2e.1u({19:3(b,d){5 c=W b=="1B";d=$.1u({},$.M.1T,{Y:c?b:P,y:c?P:b,1J:c?$.M.1T.1J:10,X:d&&!d.1D?10:48},d);d.1y=d.1y||3(a){6 a};d.1v=d.1v||d.1R;6 A.I(3(){1M $.M(A,d)})},L:3(a){6 A.11("L",a)},1k:3(a){6 A.14("1k",[a])},2b:3(){6 A.14("2b")},28:3(a){6 A.14("28",[a])},24:3(){6 A.14("24")}});$.M=3(o,r){5 t={2Y:38,2S:40,2N:46,2I:9,2E:13,2B:27,2x:3I,2v:33,2p:34,2n:8};5 u=$(o).3r("19","3o").Q(r.2Q);5 p;5 m="";5 n=$.M.3c(r);5 s=0;5 k;5 h={1F:C};5 l=$.M.32(r,o,1Z,h);5 j;$.1Y.2X&&$(o.2U).11("45.19",3(){4(j){j=C;6 C}});u.11(($.1Y.2X?"43":"42")+".19",3(a){s=1;k=a.2M;3V(a.2M){O t.2Y:a.1d();4(l.N()){l.30()}w{12(0,D)}R;O t.2S:a.1d();4(l.N()){l.2D()}w{12(0,D)}R;O t.2v:a.1d();4(l.N()){l.2C()}w{12(0,D)}R;O t.2p:a.1d();4(l.N()){l.2A()}w{12(0,D)}R;O r.17&&$.1c(r.S)==","&&t.2x:O t.2I:O t.2E:4(1Z()){a.1d();j=D;6 C}R;O t.2B:l.Z();R;3J:1P(p);p=1O(12,r.1J);R}}).2t(3(){s++}).3E(3(){s=0;4(!h.1F){2r()}}).2q(3(){4(s++>1&&!l.N()){12(0,D)}}).11("1k",3(){5 c=(1r.7>1)?1r[1]:P;3 1N(q,a){5 b;4(a&&a.7){16(5 i=0;i1){5 f=r.S.7;5 c=$(o).18().1I;5 d,1H=0;$.I(b,3(i,a){1H+=a.7;4(c<=1H){d=i;6 C}1H+=f});b[d]=v;v=b.3f(r.S)}v+=r.S}u.K(v);1l();u.14("L",[e.y,e.F]);6 D}3 12(b,c){4(k==t.2N){l.Z();6}5 a=u.K();4(!c&&a==m)6;m=a;a=1m(a);4(a.7>=r.29){u.Q(r.26);4(!r.1s)a=a.J();21(a,3a,1l)}w{1q();l.Z()}};3 15(b){4(!b)6[""];4(!r.17)6[$.1c(b)];6 $.4h(b.23(r.S),3(a){6 $.1c(b).7?$.1c(a):P})}3 1m(a){4(!r.17)6 a;5 c=15(a);4(c.7==1)6 c[0];5 b=$(o).18().1I;4(b==a.7){c=15(a)}w{c=15(a.22(a.37(b),""))}6 c[c.7-1]}3 1G(q,a){4(r.1G&&(1m(u.K()).J()==q.J())&&k!=t.2n){u.K(u.K()+a.37(1m(m).7));$(o).18(m.7,m.7+a.7)}};3 2r(){1P(p);p=1O(1l,4g)};3 1l(){5 c=l.N();l.Z();1P(p);1q();4(r.36){u.1k(3(a){4(!a){4(r.17){5 b=15(u.K()).1n(0,-1);u.K(b.3f(r.S)+(b.7?r.S:""))}w{u.K("");u.14("L",P)}}})}};3 3a(q,a){4(a&&a.7&&s){1q();l.35(a,q);1G(q,a[0].F);l.20()}w{1l()}};3 21(f,d,g){4(!r.1s)f=f.J();5 e=n.31(f);4(e&&e.7){d(f,e)}w 4((W r.Y=="1B")&&(r.Y.7>0)){5 c={4f:+1M 4e()};$.I(r.2Z,3(a,b){c[a]=W b=="3"?b():b});$.4d({4c:"4b",4a:"19"+o.49,2V:r.2V,Y:r.Y,y:$.1u({q:1m(f),47:r.X},c),44:3(a){5 b=r.1A&&r.1A(a)||1A(a);n.1i(f,b);d(f,b)}})}w{l.2T();g(f)}};3 1A(c){5 d=[];5 b=c.23("\\n");16(5 i=0;i]*)("+a.22(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2K,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2K"),"<2J>$1")},1D:D,1E:3S};$.M.3c=3(g){5 h={};5 j=0;3 1f(s,a){4(!g.1s)s=s.J();5 i=s.2H(a);4(g.1w=="3R"){i=s.J().1k("\\\\b"+a.J())}4(i==-1)6 C;6 i==0||g.1w};3 1i(q,a){4(j>g.1g){1o()}4(!h[q]){j++}h[q]=a}3 1e(){4(!g.y)6 C;5 f={},2G=0;4(!g.Y)g.1g=1;f[""]=[];16(5 i=0,2F=g.y.7;i<2F;i++){5 c=g.y[i];c=(W c=="1B")?[c]:c;5 d=g.1v(c,i+1,g.y.7);4(d===C)1V;5 e=d.3Q(0).J();4(!f[e])f[e]=[];5 b={F:d,y:c,L:g.1z&&g.1z(c)||d};f[e].1U(b);4(2G++0){5 c=h[k];$.I(c,3(i,x){4(1f(x.F,q)){a.1U(x)}})}}6 a}w 4(h[q]){6 h[q]}w 4(g.1f){16(5 i=q.7-1;i>=g.29;i--){5 c=h[q.3O(0,i)];4(c){5 a=[];$.I(c,3(i,x){4(1f(x.F,q)){a[a.7]=x}});6 a}}}6 P}}};$.M.32=3(e,g,f,k){5 h={H:"3N"};5 j,z=-1,y,1t="",1S=D,G,B;3 2y(){4(!1S)6;G=$("<3M/>").Z().Q(e.2P).T("3L","3K").1Q(1K.2w);B=$("<3H/>").1Q(G).3G(3(a){4(U(a).2u&&U(a).2u.3F()==\'2s\'){z=$("1L",B).1h(h.H).3D(U(a));$(U(a)).Q(h.H)}}).2q(3(a){$(U(a)).Q(h.H);f();g.2t();6 C}).3C(3(){k.1F=D}).3B(3(){k.1F=C});4(e.E>0)G.T("E",e.E);1S=C}3 U(a){5 b=a.U;3A(b&&b.3z!="2s")b=b.3y;4(!b)6[];6 b}3 V(b){j.1n(z,z+1).1h(h.H);2o(b);5 a=j.1n(z,z+1).Q(h.H);4(e.1D){5 c=0;j.1n(0,z).I(3(){c+=A.1a});4((c+a[0].1a-B.1b())>B[0].3x){B.1b(c+a[0].1a-B.3w())}w 4(c=j.1j()){z=0}}3 2m(a){6 e.X&&e.X").3v(e.1y(a,1t)).Q(i%2==0?"3u":"3P").1Q(B)[0];$.y(c,"2k",y[i])}j=B.3t("1L");4(e.1X){j.1n(0,1).Q(h.H);z=0}4($.2e.2W)B.2W()}6{35:3(d,q){2y();y=d;1t=q;2l()},2D:3(){V(1)},30:3(){V(-1)},2C:3(){4(z!=0&&z-8<0){V(-z)}w{V(-8)}},2A:3(){4(z!=j.1j()-1&&z+8>j.1j()){V(j.1j()-1-z)}w{V(8)}},Z:3(){G&&G.Z();j&&j.1h(h.H);z=-1},N:3(){6 G&&G.3s(":N")},3q:3(){6 A.N()&&(j.2j("."+h.H)[0]||e.1X&&j[0])},20:3(){5 a=$(g).3p();G.T({E:W e.E=="1B"||e.E>0?e.E:$(g).E(),2i:a.2i+g.1a,1W:a.1W}).20();4(e.1D){B.1b(0);B.T({2L:e.1E,3n:\'3X\'});4($.1Y.3m&&W 1K.2w.3l.2L==="1x"){5 c=0;j.I(3(){c+=A.1a});5 b=c>e.1E;B.T(\'3k\',b?e.1E:c);4(!b){j.E(B.E()-2R(j.T("2O-1W"))-2R(j.T("2O-3j")))}}}},2g:3(){5 a=j&&j.2j("."+h.H).1h(h.H);6 a&&a.7&&$.y(a[0],"2k")},2T:3(){B&&B.2z()},1p:3(){G&&G.3i()}}};$.2e.18=3(b,f){4(b!==1x){6 A.I(3(){4(A.2d){5 a=A.2d();4(f===1x||b==f){a.4n("2c",b);a.3h()}w{a.4m(D);a.4l("2c",b);a.4k("2c",f);a.3h()}}w 4(A.3g){A.3g(b,f)}w 4(A.1C){A.1C=b;A.3e=f}})}5 c=A[0];4(c.2d){5 e=1K.18.4j(),3d=c.F,2a="<->",2f=e.3b.7;e.3b=2a;5 d=c.F.2H(2a);c.F=3d;A.18(d,d+2f);6{1I:d,39:d+2f}}w 4(c.1C!==1x){6{1I:c.1C,39:c.3e}}}})(4i);',62,272,'|||function|if|var|return|length|||||||||||||||||||||||||else||data|active|this|list|false|true|width|value|element|ACTIVE|each|toLowerCase|val|result|Autocompleter|visible|case|null|addClass|break|multipleSeparator|css|target|moveSelect|typeof|max|url|hide||bind|onChange||trigger|trimWords|for|multiple|selection|autocomplete|offsetHeight|scrollTop|trim|preventDefault|populate|matchSubset|cacheLength|removeClass|add|size|search|hideResultsNow|lastWord|slice|flush|unbind|stopLoading|arguments|matchCase|term|extend|formatMatch|matchContains|undefined|highlight|formatResult|parse|string|selectionStart|scroll|scrollHeight|mouseDownOnSelect|autoFill|progress|start|delay|document|li|new|findValueCallback|setTimeout|clearTimeout|appendTo|formatItem|needsInit|defaults|push|continue|left|selectFirst|browser|selectCurrent|show|request|replace|split|unautocomplete||loadingClass||setOptions|minChars|teststring|flushCache|character|createTextRange|fn|textLength|selected|in|top|filter|ac_data|fillList|limitNumberOfItems|BACKSPACE|movePosition|PAGEDOWN|click|hideResults|LI|focus|nodeName|PAGEUP|body|COMMA|init|empty|pageDown|ESC|pageUp|next|RETURN|ol|nullData|indexOf|TAB|strong|gi|maxHeight|keyCode|DEL|padding|resultsClass|inputClass|parseInt|DOWN|emptyList|form|dataType|bgiframe|opera|UP|extraParams|prev|load|Select|||display|mustMatch|substring||end|receiveData|text|Cache|orig|selectionEnd|join|setSelectionRange|select|remove|right|height|style|msie|overflow|off|offset|current|attr|is|find|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|mouseover|ul|188|default|absolute|position|div|ac_over|substr|ac_odd|charAt|word|180|RegExp|100|switch|400|auto|ac_loading|ac_results||ac_input|keydown|keypress|success|submit||limit|150|name|port|abort|mode|ajax|Date|timestamp|200|map|jQuery|createRange|moveEnd|moveStart|collapse|move'.split('|'),0,{}))// cvi_text_lib.js version 1.01 (13-Mar-2008) // (c) 2008 by Christian Effenberger. All Rights reserved. // Distributed under Netzgestade Software License Agreement // http://www.netzgesta.de/dev/text/LISENSE.txt // font characters 30-127 and 160-255 (ISO-8859-1) // font charset UTF-8 or ISO-8859-1 is recommended // font type (built in) is a sans-serif multiple master // single line stroke font, similar to "VAG Rounded", // "DIN 17" and a few other fonts of that kind. // Create your own font e.g. strokeFont["serif"] = {}; // and load as an external js file after cvi_text_lib.js // font size is limited to min 1 max 99999 default is 12px // font weight is limited to min 1 max 400 default is 100% // font weight for normal text should not be more than 200% // font width is limited to min 10 max 400 default is 100% // char space is limited to min 10 max 1000 default is 100% // color and opacity is set through context.strokeStyle // extend CanvasRenderingContext2D with strokeText // context.strokeText(text,x,y,fontsize,fontweight,fontwidth,charspace,fonttype) // fontsize == baseline == textheight / 32 * 25 // IE specific // STRING = get_strokeText(text,x,y,fontsize,fontweight,fontwidth,charspace,fonttype,color,opacity,rotation,id) // fontsize == baseline == textheight / 32 * 25 // webKit patch function (Safari) // set_textRenderContext(context) // check if the text function is available // BOOLEAN = check_textRenderContext(context) // IE specific // BOOLEAN = check_strokeTextCapability() // helper function // draw_boundingBox(context,x,y,baseline,textheight,textwidth) // IE specific // STRING = get_boundingBox(context,x,y,baseline,textheight,textwidth,linewidth,color,opacity,rotation,id) // utility functions // STRING = get_widthText(string,textwidth,fontsize,fontwidth,charspace,fonttype) // FLOAT = get_textWidth(string,fontsize,fontwidth,charspace,fonttype) // FLOAT = get_textHeight(fontsize) // FLOAT = get_baseLine(fontsize) // howto // // // function check_strokeTextCapability() { if(document.namespaces['v'] == null) {var stl = document.createStyleSheet(); stl.addRule("v\\:*", "behavior: url(#default#VML);"); document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); } if(typeof get_strokeText == 'function' && document.namespaces['v'] != null) {return true;}else {return false;} } function get_boundingBox(x,y,baseline,lineheight,linewidth,weight,color,opacity,rotation) { rotation=typeof(rotation)!='undefined'?rotation:0; color=typeof(color)!='undefined'?color:'#000000'; opacity=typeof(opacity)!='undefined'?opacity:1; id=typeof(id)!='undefined'?'id="'+id+'"':''; var w=parseInt(linewidth), b=parseInt(baseline), h=parseInt(lineheight); return ''; } function get_strokeText(string,x,y,size,weight,width,space,font,color,opacity,rotation,id) { function qC(cX,cY,CPx,CPy,aX,aY) {var t = new Array(6); t[0]=cX+2.0/3.0*(CPx-cX); t[1]=cY+2.0/3.0*(CPy-cY); t[2]=t[0]+(aX-cX)/3.0; t[3]=t[1]+(aY-cY)/3.0; t[4]=aX; t[5]=aY; return t;} size=typeof(size)!='undefined'?size:12; weight=typeof(weight)!='undefined'?weight:100; width=typeof(width)!='undefined'?width:100; space=typeof(space)!='undefined'?space:100; font=typeof(font)!='undefined'?font:"sans-serif"; string=typeof(string)!='undefined'?string:' '; var xx=typeof(x)!='undefined'?x:0; var yy=typeof(y)!='undefined'?y:0; rotation=typeof(rotation)!='undefined'?rotation:0; color=typeof(color)!='undefined'?color:'#000000'; opacity=typeof(opacity)!='undefined'?opacity:1; id=typeof(id)!='undefined'?'id="'+id+'"':''; var i=0,j=0,f=10,path="",a,b,z,k,c,p,o,len=string.length,mag=size/25.0,fac=Math.max(Math.min(weight,400),1)/40, faw=Math.max(Math.min(width,400),10)/100; var spc=Math.max(Math.min(space,1000),10)/100,mx=((mag*16*faw)*spc)-(mag*16*faw),lw=(fac*mag);x=0;y=size; var ww=Math.round(get_textWidth(string,size,width,space,font)), hh=Math.round(get_textHeight(size)); var out=''; return out; } function get_baseLine(size) {return size;} function get_textHeight(size) {size=typeof(size)!='undefined'?size:12; return 32*(size/25);} function get_textWidth(string,size,width,space,font) { size=typeof(size)!='undefined'?size:12; width=typeof(width)!='undefined'?width:100; space=typeof(space)!='undefined'?space:100; string=typeof(string)!='undefined'?string:' '; font=typeof(font)!='undefined'?font:"sans-serif"; var total=0,len=string.length,mg=size/25.0,fw=Math.max(Math.min(width,400),10)/100,sp=Math.max(Math.min(space,1000),10)/100,m=((mg*16*fw)*sp)-(mg*16*fw); for(var i=0; i': {w:24,n:2,d:['m',[4,18],'l',[20,9],[4,0]]}, '?': {w:18,n:8,d:['m',[3,16],'q',[3,21],[9,21],'q',[15,21],[15,16],'q',[15,11],[10,11],'q',[9,11],[9,10],'l',[9,7],'m',[9,2],'l',[8,1],[9,0],[10,1],[9,2]]}, '@': {w:27,n:17,d:['m',[21,3],'q',[20,1],[14,0],'l',[13,0],'q',[4,1],[3,10],'l',[3,11],'q',[4,20],[13,21],'l',[14,21],'q',[23,20],[24,11],'l',[24,10],'q',[24,6],[20,6],'q',[17,6],[18,10],'q',[18,6],[13,6],'q',[8,6],[9,11],'q',[10,15],[14,15],'q',[19,15],[18,10],'m',[18,10],'l',[19,14]]}, 'A': {w:18,n:6,d:['m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'B': {w:21,n:9,d:['m',[4,11],'l',[12,11],'m',[13,0],'l',[4,0],[4,21],[12,21],'q',[17,21],[17,16],'q',[17,11],[12,11],'q',[18,11],[18,6],'l',[18,5],'q',[18,0],[13,0]]}, 'C': {w:21,n:7,d:['m',[11,21],'q',[17,21],[18,16],'m',[18,5],'q',[17,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'D': {w:21,n:5,d:['m',[11,0],'l',[4,0],[4,21],[11,21],'q',[18,21],[18,12],'l',[18,9],'q',[18,0],[11,0]]}, 'E': {w:19,n:4,d:['m',[17,21],'l',[4,21],[4,0],[17,0],'m',[4,11],'l',[12,11]]}, 'F': {w:18,n:4,d:['m',[17,21],'l',[4,21],[4,0],'m',[4,11],'l',[12,11]]}, 'G': {w:21,n:8,d:['m',[11,21],'q',[17,21],[18,16],'m',[13,8],'l',[18,8],[18,5],'q',[17,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'H': {w:22,n:6,d:['m',[4,21],'l',[4,0],'m',[18,21],'l',[18,0],'m',[4,11],'l',[18,11]]}, 'I': {w:8,n:2,d:['m',[4,21],'l',[4,0]]}, 'J': {w:16,n:5,d:['m',[12,21],'l',[12,5],'q',[12,0],[7,0],'q',[2,0],[2,5],'l',[2,7]]}, 'K': {w:21,n:6,d:['m',[4,21],'l',[4,0],'m',[18,21],'l',[4,7],'m',[9,12],'l',[18,0]]}, 'L': {w:17,n:2,d:['m',[4,21],'l',[4,0],[16,0]]}, 'M': {w:24,n:2,d:['m',[4,0],'l',[4,21],[12,0],[20,21],[20,0]]}, 'N': {w:22,n:2,d:['m',[4,0],'l',[4,21],[18,0],[18,21]]}, 'O': {w:22,n:7,d:['m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'P': {w:21,n:6,d:['m',[4,10],'l',[13,10],'q',[18,10],[18,15],'l',[18,16],'q',[18,21],[13,21],'l',[4,21],[4,0]]}, 'Q': {w:22,n:9,d:['m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21],'m',[12,4],'l',[18,-2]]}, 'R': {w:21,n:8,d:['m',[4,10],'l',[13,10],'q',[18,10],[18,15],'l',[18,16],'q',[18,21],[13,21],'l',[4,21],[4,0],'m',[13,10],'l',[18,0]]}, 'S': {w:20,n:8,d:['m',[16,18],'q',[15,21],[10,21],'q',[5,21],[4,17],'q',[3,12],[7,11],'l',[13,10],'q',[18,9],[17,4],'q',[16,0],[10,0],'q',[4,0],[3,4]]}, 'T': {w:16,n:4,d:['m',[8,21],'l',[8,0],'m',[1,21],'l',[15,21]]}, 'U': {w:22,n:5,d:['m',[4,21],'l',[4,6],'q',[4,0],[11,0],'q',[18,0],[18,6],'l',[18,21]]}, 'V': {w:18,n:2,d:['m',[1,21],'l',[9,0],[17,21]]}, 'W': {w:24,n:2,d:['m',[2,21],'l',[7,0],[12,21],[17,0],[22,21]]}, 'X': {w:20,n:4,d:['m',[3,21],'l',[17,0],'m',[17,21],'l',[3,0]]}, 'Y': {w:18,n:4,d:['m',[1,21],'l',[9,11],[17,21],'m',[9,11],'l',[9,0]]}, 'Z': {w:20,n:2,d:['m',[3,21],'l',[17,21],[3,0],[17,0]]}, '[': {w:14,n:2,d:['m',[11,25],'l',[4,25],[4,-7],[11,-7]]}, '\\': {w:14,n:2,d:['m',[0,21],'l',[14,-3]]}, ']': {w:14,n:2,d:['m',[3,25],'l',[10,25],[10,-7],[3,-7]]}, '^': {w:16,n:2,d:['m',[3,16],'l',[8,21],[13,16]]}, '_': {w:16,n:2,d:['m',[0,-2],'l',[16,-2]]}, '`': {w:10,n:2,d:['m',[6,21],'l',[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]}, 'a': {w:19,n:10,d:['m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'b': {w:19,n:10,d:['m',[4,21],'l',[4,0],'m',[10,14],'l',[9,14],'q',[6,14],[4,12],'m',[4,2],'q',[6,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'c': {w:18,n:10,d:['m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[15,11],'q',[14,14],[10,14]]}, 'd': {w:19,n:10,d:['m',[15,21],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'e': {w:18,n:8,d:['m',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[3,8],'l',[15,8],'q',[15,14],[9,14]]}, 'f': {w:12,n:5,d:['m',[10,21],'q',[5,21],[5,17],'l',[5,0],'m',[2,14],'l',[9,14]]}, 'g': {w:19,n:12,d:['m',[15,14],'l',[15,-2],'q',[15,-7],[10,-7],'q',[7,-7],[6,-6],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'h': {w:19,n:6,d:['m',[4,21],'l',[4,0],'m',[4,10],'q',[6,14],[11,14],'q',[15,14],[15,10],'l',[15,0]]}, 'i': {w: 8,n:4,d:['m',[3,21],'l',[4,20],[5,21],[4,22],[3,21],'m',[4,14],'l',[4,0]]}, 'j': {w:10,n:5,d:['m',[5,21],'l',[6,20],[7,21],[6,22],[5,21],'m',[6,14],'l',[6,-3],'q',[6,-8],[1,-7]]}, 'k': {w:17,n:6,d:['m',[4,21],'l',[4,0],'m',[14,14],'l',[4,4],'m',[8,8],'l',[15,0]]}, 'l': {w: 8,n:2,d:['m',[4,21],'l',[4,0]]}, 'm': {w:26,n:10,d:['m',[4,14],'l',[4,0],'m',[4,10],'q',[6,14],[10,14],'q',[13,14],[13,10],'l',[13,0],'m',[13,10],'q',[15,14],[19,14],'q',[22,14],[22,10],'l',[22,0]]}, 'n': {w:19,n:6,d:['m',[4,14],'l',[4,0],'m',[4,10],'q',[6,14],[11,14],'q',[15,14],[15,10],'l',[15,0]]}, 'o': {w:19,n:7,d:['m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'p': {w:19,n:10,d:['m',[4,14],'l',[4,-7],'m',[10,14],'l',[9,14],'q',[6,14],[4,12],'m',[4,2],'q',[6,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'q': {w:19,n:10,d:['m',[15,14],'l',[15,-7],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'r': {w:13,n:4,d:['m',[4,14],'l',[4,0],'m',[4,8],'q',[5,14],[12,14]]}, 's': {w:16,n:7,d:['m',[13,11],'q',[13,14],[8,14],'q',[3,14],[3,11],'q',[3,8],[8,7],'q',[13,6],[13,3],'q',[13,0],[8,0],'q',[3,0],[3,3]]}, 't': {w:12,n:5,d:['m',[5,21],'l',[5,4],'q',[5,-1],[10,0],'m',[2,14],'l',[9,14]]}, 'u': {w:19,n:6,d:['m',[4,14],'l',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, 'v': {w:16,n:2,d:['m',[2,14],'l',[8,0],[14,14]]}, 'w': {w:22,n:2,d:['m',[3,14],'l',[7,0],[11,14],[15,0],[19,14]]}, 'x': {w:17,n:4,d:['m',[3,14],'l',[14,0],'m',[14,14],'l',[3,0]]}, 'y': {w:16,n:5,d:['m',[2,14],'l',[8,0],'m',[14,14],'l',[8,0],'q',[5,-7],[1,-7]]}, 'z': {w:17,n:2,d:['m',[3,14],'l',[14,14],[3,0],[14,0]]}, '{': {w:14,n:9,d:['m',[9,25],'q',[5,24],[5,20],'q',[5,17],[7,16],'q',[9,15],[8,12],'q',[7,9],[4,9],'q',[7,9],[8,6],'q',[9,3],[7,2],'q',[5,1],[5,-2],'q',[5,-6],[9,-7]]}, '|': {w: 8,n:2,d:['m',[4,25],'l',[4,-7]]}, '}': {w:14,n:9,d:['m',[5,25],'q',[9,24],[9,20],'q',[9,17],[7,16],'q',[5,15],[6,12],'q',[7,9],[10,9],'q',[7,9],[6,6],'q',[5,3],[7,2],'q',[9,1],[9,-2],'q',[9,-6],[5,-7]]}, '~': {w:24,n:4,d:['m',[3,6],'q',[3,12],[10,10],'l',[14,8],'q',[21,4],[21,10]]}, ' ': {w:16,n:1,d:[]}, '¡': {w:10,n:4,d:['m',[5,10],'l',[5,-4],'m',[5,17],'l',[4,16],[5,15],[6,16],[5,17]]}, '¢': {w:18,n:14,d:['m',[9,14],'l',[9,18],'m',[9,0],'l',[9,-4],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[15,11],'q',[14,14],[10,14]]}, '£': {w:18,n:8,d:['m',[4,11],'l',[13,11],'m',[16,18],'q',[15,21],[11,21],'q',[5,21],[6,16],'q',[7,8],[6,2],'q',[5,0],[4,0],'l',[16,0]]}, '¤': {w:19,n:13,d:['m',[15,3],'l',[17,1],'m',[15,13],'l',[17,15],'m',[5,3],'l',[3,1],'m',[5,13],'l',[3,15],'m',[10,14],'q',[4,14],[4,8],'q',[4,2],[10,2],'q',[16,2],[16,8],'q',[16,14],[10,14]]}, '¥': {w:18,n:8,d:['m',[4,7],'l',[14,7],'m',[4,11],'l',[14,11],'m',[1,21],'l',[9,11],[17,21],'m',[9,11],'l',[9,0]]}, '¦': {w: 8,n:4,d:['m',[4,25],'l',[4,12],'m',[4,6],'l',[4,-7]]}, '§': {w:20,n:12,d:['m',[16,18],'q',[16,21],[10,21],'q',[4,21],[4,18],'q',[4,15],[10,14],'q',[16,13],[16,10],'q',[16,6],[10,7],'m',[10,14],'q',[4,15],[4,11],'q',[4,8],[10,7],'q',[16,6],[16,3],'q',[16,0],[10,0],'q',[4,0],[4,3]]}, '¨': {w:16,n:4,d:['m',[4,25],'l',[4,23],'m',[12,25],'l',[12,23]]}, '©': {w:27,n:15,d:['m',[18,13],'q',[17,15],[14,15],'q',[9,15],[9,11],'l',[9,10],'q',[9,6],[14,6],'q',[17,6],[18,8],'m',[24,10],'q',[24,0],[14,0],'l',[13,0],'q',[3,0],[3,10],'l',[3,11],'q',[3,21],[13,21],'l',[14,21],'q',[24,21],[24,11],'l',[24,10]]}, 'ª': {w:14,n:9,d:['m',[4,12],'l',[10,12],'m',[10,21],'l',[10,15],'m',[4,18],'q',[4,15],[7,15],'q',[10,15],[10,18],'q',[10,21],[7,21],'q',[4,21],[4,18]]}, '«': {w:24,n:4,d:['m',[12,16],'l',[3,9],[12,2],'m',[21,16],'l',[12,9],[21,2]]}, '¬': {w:22,n:2,d:['m',[4,12],'l',[18,12],[18,8]]}, '­': {w:22,n:2,d:['m',[4,9],'l',[18,9]]}, '®': {w:27,n:17,d:['m',[9,6],'l',[9,15],[16,15],'m',[9,10],'l',[16,10],[18,6],'m',[16,10],'q',[18,10],[18,12],'l',[18,13],'q',[18,15],[16,15],'m',[24,10],'q',[24,0],[14,0],'l',[13,0],'q',[3,0],[3,10],'l',[3,11],'q',[3,21],[13,21],'l',[14,21],'q',[24,21],[24,11],'l',[24,10]]}, '¯': {w:16,n:2,d:['m',[0,24],'l',[16,24]]}, '°': {w:10,n:5,d:['m',[3,23],'q',[3,21],[5,21],'q',[7,21],[7,23],'q',[7,25],[5,25],'q',[3,25],[3,23]]}, '±': {w:22,n:6,d:['m',[11,18],'l',[11,6],'m',[4,12],'l',[18,12],'m',[4,2],'l',[18,2]]}, '²': {w:14,n:6,d:['m',[10,11],'l',[4,11],'q',[4,15],[7,15],'q',[10,15],[10,18],'q',[10,21],[7,21],'q',[4,21],[4,18]]}, '³': {w:14,n:5,d:['m',[4,14],'q',[4,11],[7,11],'q',[10,11],[10,14],'q',[10,17],[7,17],'l',[10,21],[4,21]]}, '´': {w:19,n:2,d:['m',[9,18],'l',[12,20]]}, 'µ': {w:19,n:7,d:['m',[4,14],'l',[4,-6],'m',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, '¶': {w:18,n:5,d:['m',[8,11],'q',[3,11],[3,16],'q',[3,21],[9,21],'m',[9,0],'l',[9,21],[15,21],[15,0]]}, '·': {w:10,n:2,d:['m',[5,14],'l',[4,13],[5,12],[6,13],[5,14]]}, '¸': {w:18,n:2,d:['m',[10,0],'l',[10,-2],[7,-4]]}, '¹': {w:10,n:2,d:['m',[4,19],'l',[6,21],[6,11]]}, 'º': {w:14,n:7,d:['m',[4,12],'l',[10,12],'m',[4,18],'q',[4,15],[7,15],'q',[10,15],[10,18],'q',[10,21],[7,21],'q',[4,21],[4,18]]}, '»': {w:24,n:4,d:['m',[3,16],'l',[12,9],[3,2],'m',[12,16],'l',[21,9],[12,2]]}, '¼': {w:24,n:6,d:['m',[4,19],'l',[6,21],[6,11],'m',[16,15],'l',[6,5],'m',[19,0],'l',[19,10],[14,4],[20,4]]}, '½': {w:24,n:10,d:['m',[4,19],'l',[6,21],[6,11],'m',[16,15],'l',[6,5],'m',[20,0],'l',[14,0],'q',[14,4],[17,4],'q',[20,4],[20,7],'q',[20,10],[17,10],'q',[14,10],[14,7]]}, '¾': {w:24,n:10,d:['m',[4,14],'q',[4,11],[7,11],'q',[10,11],[10,14],'q',[10,17],[7,17],'l',[10,21],[4,21],'m',[18,15],'l',[8,5],'m',[19,0],'l',[19,10],[14,4],[20,4]]}, '¿': {w:18,n:7,d:['m',[9,21],'l',[8,20],[9,19],[10,20],[9,21],'m',[9,14],'l',[9,10],'q',[3,10],[3,5],'q',[3,0],[9,0],'q',[15,0],[15,5]]}, 'À': {w:18,n:6,d:['m',[7,25],'l',[10,23],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Á': {w:18,n:6,d:['m',[8,23],'l',[11,25],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Â': {w:18,n:6,d:['m',[7,23],'l',[9,25],[11,23],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Ã': {w:18,n:6,d:['m',[6,23],'l',[8,25],[10,23],[12,25],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Ä': {w:18,n:10,d:['m',[5,25],'l',[5,23],'m',[13,25],'l',[13,23],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Å': {w:18,n:10,d:['m',[7,23],'q',[7,21],[9,21],'q',[11,21],[11,23],'q',[11,25],[9,25],'q',[7,25],[7,23],'m',[1,0],'l',[9,21],[17,0],'m',[4,7],'l',[14,7]]}, 'Æ': {w:18,n:12,d:['m',[9,21],'l',[1,0],'m',[4,7],'l',[9,7],'m',[9,21],'l',[9,0],'m',[9,21],'l',[17,21],'m',[9,11],'l',[17,11],'m',[9,0],'l',[17,0]] }, 'Ç': {w:21,n:9,d:['m',[11,0],'l',[11,-2],[8,-4],'m',[11,21],'q',[17,21],[18,16],'m',[18,5],'q',[17,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'È': {w:19,n:8,d:['m',[7,25],'l',[10,23],'m',[17,21],'l',[4,21],[4,0],[17,0],'m',[4,11],'l',[12,11]]}, 'É': {w:19,n:8,d:['m',[9,23],'l',[12,25],'m',[17,21],'l',[4,21],[4,0],[17,0],'m',[4,11],'l',[12,11]]}, 'Ê': {w:19,n:8,d:['m',[8,23],'l',[10,25],[12,23],'m',[17,21],'l',[4,21],[4,0],[17,0],'m',[4,11],'l',[12,11]]}, 'Ë': {w:19,n:10,d:['m',[6,25],'l',[6,23],'m',[15,25],'l',[15,23],'m',[17,21],'l',[4,21],[4,0],[17,0],'m',[4,11],'l',[12,11]]}, 'Ì': {w:8,n:4,d:['m',[3,25],'l',[6,23],'m',[4,21],'l',[4,0]]}, 'Í': {w:8,n:4,d:['m',[2,23],'l',[5,25],'m',[4,21],'l',[4,0]]}, 'Î': {w:8,n:4,d:['m',[2,23],'l',[4,25],[6,23],'m',[4,21],'l',[4,0]]}, 'Ï': {w:8,n:6,d:['m',[2,25],'l',[2,23],'m',[6,25],'l',[6,23],'m',[4,21],'l',[4,0]]}, 'Ð': {w:21,n:7,d:['m',[2,10],'l',[11,10],'m',[11,0],'l',[4,0],[4,21],[11,21],'q',[18,21],[18,12],'l',[18,9],'q',[18,0],[11,0]]}, 'Ñ': {w:22,n:4,d:['m',[8,23],'l',[10,25],[12,23],[14,25],'m',[4,0],'l',[4,21],[18,0],[18,21]]}, 'Ò': {w:22,n:9,d:['m',[8,25],'l',[11,23],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'Ó': {w:22,n:9,d:['m',[10,23],'l',[13,25],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'Ô': {w:22,n:9,d:['m',[9,23],'l',[11,25],[13,23],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'Õ': {w:22,n:9,d:['m',[8,23],'l',[10,25],[12,23],[14,25],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'Ö': {w:22,n:13,d:['m',[6,25],'l',[6,23],'m',[16,25],'l',[16,23],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, '×': {w:12,n:4,d:['m',[2,16],'l',[10,6],'m',[10,16],'l',[2,6]]}, 'Ø': {w:22,n:9,d:['m',[3,1],'l',[19,20],'m',[11,21],'q',[19,21],[19,12],'l',[19,9],'q',[19,0],[11,0],'q',[3,0],[3,9],'l',[3,12],'q',[3,21],[11,21]]}, 'Ù': {w:22,n:7,d:['m',[8,25],'l',[11,23],'m',[4,21],'l',[4,6],'q',[4,0],[11,0],'q',[18,0],[18,6],'l',[18,21]]}, 'Ú': {w:22,n:7,d:['m',[10,23],'l',[13,25],'m',[4,21],'l',[4,6],'q',[4,0],[11,0],'q',[18,0],[18,6],'l',[18,21]]}, 'Û': {w:22,n:7,d:['m',[9,23],'l',[11,25],[13,23],'m',[4,21],'l',[4,6],'q',[4,0],[11,0],'q',[18,0],[18,6],'l',[18,21]]}, 'Ü': {w:22,n:9,d:['m',[7,25],'l',[7,23],'m',[15,25],'l',[15,23],'m',[4,21],'l',[4,6],'q',[4,0],[11,0],'q',[18,0],[18,6],'l',[18,21]]}, 'Ý': {w:18,n:6,d:['m',[8,23],'l',[11,25],'m',[1,21],'l',[9,11],[9,0],'m',[17,21],'l',[9,11]]}, 'Þ': {w:19,n:7,d:['m',[4,18],'l',[4,-5],'m',[4,14],'l',[9,14],'q',[16,14],[16,7],'q',[16,0],[9,0],'l',[4,0]]}, 'ß': {w:21,n:9,d:['m',[8,0],'l',[11,0],'q',[17,0],[17,5],'l',[17,6],'q',[17,10],[11,12],'q',[16,13],[16,16],'q',[16,21],[10,21],'q',[4,21],[4,16],'l',[4,0]]}, 'à': {w:19,n:12,d:['m',[7,20],'l',[10,18],'m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'á': {w:19,n:12,d:['m',[9,18],'l',[12,20],'m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'â': {w:19,n:12,d:['m',[7,18],'l',[9,20],[11,18],'m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'ã': {w:19,n:12,d:['m',[7,18],'l',[9,20],[11,18],[13,20],'m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'ä': {w:19,n:14,d:['m',[4,20],'l',[4,18],'m',[15,20],'l',[15,18],'m',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'å': {w:19,n:15,d:['m',[7,18],'q',[7,16],[9,16],'q',[11,16],[11,18],'q',[11,20],[9,20],'q',[7,20],[7,18], 'm',[15,14],'l',[15,0],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[13,0],[15,2],'m',[15,12],'q',[13,14],[10,14]]}, 'æ': {w:21,n:10,d:['m',[11,14],'l',[11,0],'m',[11,8],'l',[18,8],'q',[18,14],[12,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[13,0],'q',[17,0],[18,3]]}, 'ç': {w:18,n:10,d:['m',[10,0],'l',[10,-2],[7,-4],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[15,11],'q',[14,14],[10,14]]}, 'è': {w:18,n:10,d:['m',[7,20],'l',[10,18],'m',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[3,8],'l',[15,8],'q',[15,14],[9,14]]}, 'é': {w:18,n:10,d:['m',[9,18],'l',[12,20],'m',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[3,8],'l',[15,8],'q',[15,14],[9,14]]}, 'ê': {w:18,n:10,d:['m',[7,18],'l',[9,20],[11,18],'m',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[3,8],'l',[15,8],'q',[15,14],[9,14]]}, 'ë': {w:18,n:12,d:['m',[4,20],'l',[4,18],'m',[15,20],'l',[15,18],'m',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[14,0],[15,3],'m',[3,8],'l',[15,8],'q',[15,14],[9,14]]}, 'ì': {w:8,n:4,d:['m',[3,20],'l',[6,18],'m',[4,14],'l',[4,0]]}, 'í': {w:8,n:4,d:['m',[2,18],'l',[5,20],'m',[4,14],'l',[4,0]]}, 'î': {w:8,n:4,d:['m',[2,18],'l',[4,20],[6,18],'m',[4,14],'l',[4,0]]}, 'ï': {w:8,n:6,d:['m',[2,20],'l',[2,18],'m',[6,20],'l',[6,18],'m',[4,14],'l',[4,0]]}, 'ð': {w:19,n:12,d:['m',[8,17],'l',[10,21],'m',[7,20],'l',[11,18],'q',[16,16],[16,8],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ñ': {w:19,n:8,d:['m',[7,18],'l',[9,20],[11,18],[13,20],'m',[4,14],'l',[4,0],'m',[4,10],'q',[6,14],[11,14],'q',[15,14],[15,10],'l',[15,0]]}, 'ò': {w:19,n:9,d:['m',[7,20],'l',[10,18],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ó': {w:19,n:9,d:['m',[9,18],'l',[12,20],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ô': {w:19,n:9,d:['m',[7,18],'l',[9,20],[11,18],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'õ': {w:19,n:9,d:['m',[7,18],'l',[9,20],[11,18],[13,20],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ö': {w:19,n:11,d:['m',[4,20],'l',[4,18],'m',[15,20],'l',[15,18],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, '÷': {w:18,n:6,d:['m',[9,15],'l',[9,14],'m',[4,9],'l',[14,9],'m',[9,4],'l',[9,3]]}, 'ø': {w:19,n:9,d:['m',[3,1],'l',[15,14],'m',[10,14],'l',[9,14],'q',[3,14],[3,7],'q',[3,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ù': {w:19,n:8,d:['m',[7,20],'l',[10,18],'m',[4,14],'l',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, 'ú': {w:19,n:8,d:['m',[9,18],'l',[12,20],'m',[4,14],'l',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, 'û': {w:19,n:8,d:['m',[7,18],'l',[9,20],[11,18],'m',[4,14],'l',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, 'ü': {w:19,n:10,d:['m',[4,20],'l',[4,18],'m',[15,20],'l',[15,18],'m',[4,14],'l',[4,4],'q',[4,0],[8,0],'q',[13,0],[15,4],'m',[15,14],'l',[15,0]]}, 'ý': {w:16,n:7,d:['m',[7,18],'l',[10,20],'m',[2,14],'l',[8,0],'m',[14,14],'l',[8,0],'q',[5,-7],[1,-7]]}, 'þ': {w:19,n:10,d:['m',[4,21],'l',[4,-7],'m',[10,14],'l',[9,14],'q',[6,14],[4,12],'m',[4,2],'q',[6,0],[9,0],'l',[10,0],'q',[16,0],[16,7],'q',[16,14],[10,14]]}, 'ÿ': {w:16,n:9,d:['m',[2,20],'l',[2,18],'m',[14,20],'l',[14,18],'m',[2,14],'l',[8,0],'m',[14,14],'l',[8,0],'q',[5,-7],[1,-7]]} }; /* ========================================================= // jquery.flipv.js // Author: OpenStudio (Arnault PACHOT) // Mail: apachot@openstudio.fr // Web: http://www.openstudio.fr // Copyright (c) 2008 OpenStudio http://www.openstudio.fr ========================================================= */ jQuery(document).ready(function($){ (function($) { $.fn.flipv = function(options) { this.each(function(){ var htmlsav = $(this).html(); var textsav = $(this).text(); var fontsizesav = '12'; if ($(this).css('font-size') != '') { fontsizesav = parseInt($(this).css('font-size')); } var heightsav = $(this).height(); var widthsav = Math.round((get_textWidth(textsav,fontsizesav-2)+$(this).height()*1.5)*100)/100; var colorsav = '#FFFF00'; if ($(this).css('color')) { colorsav = $(this).css('color'); } var backcolorsav = '#FF0000'; if ($(this).css('background-color')) { backcolorsav = $(this).css('background-color'); } var my_id = "canvas"+parseInt(Math.random()*1000); $(this).empty().append(""+htmlsav+""); var canvas = document.createElement('canvas'); canvas.id = my_id; canvas.className = "verticalTab"; canvas.width = heightsav; canvas.height = widthsav; canvas.innerHTML = htmlsav; // IE if ($.browser.msie) G_vmlCanvasManager.initElement(canvas); $(this).empty().append(canvas); vertical_text(textsav, fontsizesav, colorsav, backcolorsav, my_id); }); return $(this); }; })(jQuery); function vertical_text(mytext, fontsize, colorsav, backcolorsav, my_id) { var canvas = document.getElementById(my_id); if (canvas.getContext){ var context = canvas.getContext('2d'); context.moveTo(canvas.width, 0); context.lineTo(canvas.width/3, canvas.width/4); context.quadraticCurveTo(1, canvas.width*3/8, 1, canvas.width*2/3); context.lineTo(1, canvas.height-canvas.width*2/3); context.quadraticCurveTo(1, canvas.height-canvas.width*3/8, canvas.width/3, canvas.height-canvas.width/4); context.lineTo(canvas.width, canvas.height); context.closePath(); context.strokeStyle = colorsav; context.stroke(); context.fillStyle = "#FFFFFF"; context.fill(); set_textRenderContext(context); if(check_textRenderContext(context)) { context.translate(-55,canvas.height-canvas.width*2/3+2); context.rotate(Math.PI*270/180); context.strokeStyle = colorsav; // context.strokeText(text,-(w/2),-(h/2),size,weight,width,space); context.strokeText(mytext,3,60,fontsize-2,130); } } } $('.widget h2').flipv(); }); /** * * simpleTooltip jQuery plugin, by Marius ILIE * visit http://dev.mariusilie.net for details * **/ jQuery(document).ready(function($){ (function($){ $.fn.simpletooltip = function(){ return this.each(function() { var text = $(this).attr("title"); $(this).attr("title", ""); if(text != undefined) { $(this).hover(function(e){ var tipX = e.pageX + 12; var tipY = e.pageY + 12; $(this).attr("title", ""); $("body").append(""); if($.browser.msie) var tipWidth = $("#simpleTooltip").outerWidth(true) else var tipWidth = $("#simpleTooltip").width() $("#simpleTooltip").width(tipWidth); $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium"); }, function(){ $("#simpleTooltip").remove(); $(this).attr("title", text); }); $(this).mousemove(function(e){ var tipX = e.pageX + 12; var tipY = e.pageY + 12; var tipWidth = $("#simpleTooltip").outerWidth(true); var tipHeight = $("#simpleTooltip").outerHeight(true); if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth; if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight; $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium"); }); } }); }})(jQuery); });jQuery(document).ready(function($){ /* ******************************** Debugfunktion ******************************** */ var __debug = 1; function debug(v, h) { if (__debug == 1) { if(('console' in window) && ('firebug' in console)) { console.info(v); } else { if(!document.getElementById('debug')) { var debugDiv = document.createElement('div'); debugDiv.id = 'debug'; debugDiv.style.background = '#ffffff'; debugDiv.style.border = '2px solid #c8c8c8'; debugDiv.style.fontFamily = 'Courier, Courier New, Lucida Console'; debugDiv.style.height = '250px'; debugDiv.style.margin = '20px'; debugDiv.style.overflow = 'scroll'; debugDiv.style.padding = '5px 7px'; debugDiv.style.width = '750px'; document.getElementsByTagName('body')[0].appendChild(debugDiv); } var time = new Array((new Date).getHours(), (new Date).getMinutes(), (new Date).getSeconds()); document.getElementById('debug').innerHTML = '' + (time[0] < 10 ? '0' : '') + time[0] + ':' + (time[1] < 10 ? '0' : '') + time[1] + ':' + (time[2] < 10 ? '0' : '') + time[2] + ' | ' + v + '
' + document.getElementById('debug').innerHTML; } } else return false; } function widget(parent) { this.parent = parent; this.id = parent.id; this.zeige = widgetZeigeZustand; this.schalten = widgetDurchschalten; this.nachOben = widgetNachOben; this.setAktuellerZustand = widgetSetAktuellerZustand; this.initEvents = function(){}; this.aktuellerZustand = null; this.anzahlZustaende = null; this.subnavigation = $('#subnavi'); this.zustandsFunktion = function(){ // elternwidget finden var vater = this.parentNode; while(!$(vater).hasClass('widget')) { vater = vater.parentNode; } vater.widget.zeige(this.parentNode.className); }; // widget-subnavigation setzen var naviLink = this.subnavigation.find('ul li a.' + this.id)[0]; if(this.id && naviLink) { var id = this.id; naviLink.onclick = function(){ $('#' + id)[0].widget.nachOben(); return false; }; } } function widgetSetAktuellerZustand() { var aktiv = $(this.parent).find('.aktiv'); for(var a = aktiv.length-1; a >= 0; a--) { this.aktuellerZustand = aktiv[a].className.match(/zustand([0-9])+/)[1]; } this.anzahlZustaende = $(this.parent).find('.zustaende').length; } function widgetDurchschalten() { if(this.aktuellerZustand === null || this.anzahlZustaende === null) { this.setAktuellerZustand(); } var neuerzustand = parseInt(this.aktuellerZustand, 10)+1; neuerzustand = neuerzustand > (this.anzahlZustaende-1) ? 0 : neuerzustand; this.aktuellerZustand = neuerzustand; this.zeige('zustand' + neuerzustand); } function widgetZeigeZustand(zustand) { var zustandsklasse = zustand; // wenn zu ladender zustand nicht existiert brechen wir ab if($(this.parent).find('.boxInhalt .' + zustand).length < 1) { return 0; } zustand = $(this.parent).find('.boxInhalt .' + zustand); // noch aktiven zustand holen var aktiv = null; aktiv = $(this.parent).find('.aktiv'); // wenn aktiver zustand der zu ladende ist brechen wir ab if(zustand.hasClass('aktiv')) { return 0; } // elternelement braucht fuer den vorgang eine relative positionierung var originalPosition = $(this.parent).find('.boxInhalt').css('position'); $(this.parent).find('.boxInhalt').css('position', 'relative'); // aktives element inaktiv setzen und absolut positionieren aktiv.removeClass('aktiv'); aktiv.css('position', 'absolute'); aktiv.css('top', '0px'); aktiv.css('z-index', 1); // den zukuenftigen aktiven zustand aktiv setzen zustand.addClass('aktiv'); zustand.css('position', 'relative'); zustand.css('z-index', 0); // aktiven zustand ausblenden, neuen einblenden aktiv.fadeOut(1000); zustand.fadeIn(1000, function(){ $(this.parent).find('.boxInhalt').css('position', originalPosition); }); // zustandlinks anpassen var schalter = $(this.parent).find('ul.widgetliste li'); // fuer jedes gefundene li <----------------- each? for(var i = 0; schalter[i]; i++) { // wenn li-klasse und gesuchter zustand matchen if(schalter[i].className.match(zustandsklasse)) { schalter[i].innerHTML = $(schalter[i]).find('a')[0].innerHTML; $(schalter[i]).addClass("ektivEktiv"); } else { var linkname = schalter[i].innerHTML; $(schalter[i]).empty(); $(schalter[i]).html('
' + linkname + ''); $(schalter[i]).find('a')[0].onclick = this.zustandsFunktion; $(schalter[i]).removeClass("ektivEktiv"); } } } /** * widget nach oben holen */ function widgetNachOben() { var parent = this.parent; // parent ist das gewaehlte widget // bevor wir das element ersetzen muessen wir pruefen, ob irgendwo // ein scriptblock ist, der eine datei nachlaed und diesen entfernen // (googlemaps-widget-verschieben-problem) $(parent).find('script[src!=]').remove(); var klon = $(parent).clone(); // wir brauchen einen klon, damit wir gleichzeitig ein und ausklappen koennen var subnavigation = this.subnavigation; var oben = $(parent.parentNode).find('.widget')[0].id; // wenn unser widget schon ganz oben steht, blinkt es kurz, um // anzuzeigen, dass der klick bemerkt wurde if(oben == this.id) { $(parent).fadeTo(50, 0.5, function(){ $(parent).fadeTo(200, 1.0, function(){ $(parent).fadeTo(50, 0.5, function(){ $(parent).fadeTo(200, 1.0); }); }); }); } // ansonsten muessen wir das widget nach oben holen else { // sonderfall fuer videowidgets if(this.id == 'videos') { // erstmal alle widgets holen var widgets = $(parent.parentNode).find('.widget'); var oberhalb = []; // jetzt die widgets sichern, die oberhalb der videos liegen for(var i = 0; i < widgets.length && widgets[i].id != 'videos'; i++) { oberhalb[oberhalb.length] = widgets[i]; } // widgets in umgekehrter reihenfolge nach videos einfuegen for(i = oberhalb.length-1; i >= 0; i--) { $(oberhalb[i]).insertAfter(parent); } // neuen hash setzen laut.setzeHash(parent.id); //$('html').animate({ scrollTop: ($(parent).offset().top-10) }, 300, function(){}); } else { var originalhoehe = $(parent).height(); // wir ersetzen unser widget durch den erstellten klon $(parent).replaceWith(klon[0]); // unser original muss unsichtbar sein $(parent).css('height', '1px'); // ueber den klon holen wir uns den widget-container // und fuegen das original an oberster stelle ein $(klon[0].parentNode).prepend(parent); // jetzt wird das original ausgefahren, gleichzeitig // faehrt der klon ein und wird anschliessend entfernt $(parent).animate({height: originalhoehe + 'px'}, 300, function(){ $(this).css('height', 'auto'); // muss gesetzt sein, damit aufklappen nach verschieben wieder funktioniert //$(this).css('height', originalhoehe + 'px'); // muss gesetzt sein, damit aufklappen nach verschieben wieder funktioniert }); klon.animate({height: '1px'}, 300, function(){ klon.remove(); // neuen hash setzen laut.setzeHash(parent.id); }); } // aktion: formularAbschicken laut.trackClick('','anchor'); // events initialisieren this.initEvents(); // position in cookie speichern laut.widgets.setSortierungsCookie(); } $('ul.inhalt > li:first-child').removeClass('last'); var lastWidget = $('ul.inhalt > li:last-child'); if($('ul.inhalt > li:first-child').attr('id') == $('ul.inhalt > li:last-child').attr('id')) { var Widget = $(window.laut.widgets[0].widget.parent.parentNode).find('.widget'); lastWidget = $(Widget[(Widget.length-2)]); } lastWidget.addClass('last'); // anker an hash haengen return false; } /** * methode zum setzen neuer hashs */ laut.setzeHash = function(hash) { // pruefen ob wir es mit einem existierenden element zu tun haben if(document.getElementById(hash)) { var ob = document.getElementById(hash); // wir moechten nicht, dass die seitenposition veraendert wird, // wenn auf die navigation geklickt wird, deshalb muessen wir das // entsprechende ziel aendern // id des ziels aendern ob.id = ''; // neuen hash einfuegen window.location.hash = hash; // id zuruecksetzen auf original-id ob.id = hash; hash = null; return true; } // sonst wird einfach gesetzt window.location.hash = hash; }; laut.widgets = $('.inhalt .widget'); laut.widgets.setSortierungsCookie = function(){ var tmp; var widgets; // // reihenfolge ermitteln widgets = $('.inhalt .widget'); var sortierung = []; for(var i = 0; widgets[i]; i++) { if(widgets[i].widget) { sortierung[sortierung.length] = widgets[i].id; } } // erstmal alten keks holen var keks = document.cookie.split(';'); // index sichert die position im cookie var index = -1; // gucken, ob irgendwo im keks schon was zum seitentyp zu finden ist for(i = 0; keks[i]; i++) { // nach sortierung suchen tmp = keks[i].search(/sortierung=[a-zA-Z0-9,\-&]*[;]?/); if(tmp !== null && tmp > -1) { index = i; break; } } // neue sortierung und alte sortierung anlegen var alte_sortierung = null; var neue_sortierung = []; // wenn wir einen index haben, holen wir uns den string und versuchen ihn zu teilen if(index > -1) { alte_sortierung = keks[index].split('sortierung=')[1]; } // jetzt finden wir heraus, ob fuer diesen seitentyp eine sortierung existiert var suchstring = seitentyp + ':[a-zA-Z0-9,]*[&]{0,1}'; if(alte_sortierung !== null) { // sollte fuer diesen seitentyp eine sortierung gefunden werden, wird sie ersetzt tmp = alte_sortierung.split('&'); for(i = 0; tmp[i]; i++) { // wenn seitentyp als sortierungsbezeichnung gefunden wird, darf dieser eintrag // nicht weiter im cookie gesichert werden. if(tmp[i].search(seitentyp + ':') == -1) { neue_sortierung[neue_sortierung.length] = tmp[i]; } } } // neue sortierung anhaengen neue_sortierung[neue_sortierung.length] = seitentyp + ':' + sortierung.join(','); //index = index > -1 ? index : keks.length; //keks[i] = seitentyp + ":" + sortierung.join(','); document.cookie = 'sortierung=' + neue_sortierung.join('&') + ';path=/'; }; for(var i = 0; laut.widgets[i]; i++) { // widgets speichern if(laut.widgets[i].className = 'widget') { if(!laut.widgets[i].widget){ laut.widgets[i].widget = new widget(laut.widgets[i]); } // zustandsschalter mit funktion versehen $(laut.widgets[i]).find('.widgetschalter').click(function(){ // elternwidget suchen var element = this; while(!$(element).hasClass('widget')) { element = element.parentNode; i++; } // wenn wir ein widget haben wird geschaltet if(element && $(element).hasClass('widget')) { element.widget.schalten(); } }); // zustandsliste schaltbar machen var schalter = $(laut.widgets[i]).find('ul.widgetliste li a'); for(var j = 0; schalter[j]; j++) { $(schalter[j]).click(function(){ // elternwidget finden var vater = this.parentNode; while(!$(vater).hasClass('widget')) { vater = vater.parentNode; } vater.widget.zeige(this.parentNode.className); }); } } } /* ---------------------------------------- text ausklappen ---------------------------------------- */ var buttonAusklapp = ' weiterlesen'; var buttonEinklapp = ' einklappen'; $(".leadtext").append(buttonAusklapp); $(".klappText").wrapInner(''); $(".volltext p:last-child").append(buttonEinklapp); $(".klappenText").live("click", function(){ var parent = $(this); while(!parent.hasClass('scrolltop')) { parent = parent.parent(); } if ($(parent).find(".volltext").css("display") == "none"){ $(parent).find("em.song").css("font-weight","bold"); $(parent).find(".buttonFade").fadeOut(); $('html').animate({ scrollTop: ($(parent).offset().top-10) }, 0, function(){ $(parent).find(".volltext").slideDown(); }); } else { $(parent).find("em.song").css("font-weight","normal"); $('html').animate({ scrollTop: ($(parent).offset().top-10) }, 0, function(){ $(parent).find(".volltext").slideUp(function(){ $(parent).find(".buttonFade").fadeIn(); }); }); } // aktion: text klappen laut.trackClick('wl_bio','weiterlesen'); return false; }); /* ---------------------------------------- tooltip ---------------------------------------- */ $(".tooltip").simpletooltip(); }); /* ---------------------------------------- widget-mindesthoehe ---------------------------------------- */ jQuery(document).ready(function($){ window.laut.widgets.mindesthoehe = function(){ $.each($('li.widget'), function() { var widgetHeight = $(this).height(); var canvasHeight = $(this).find('canvas').height(); if ((canvasHeight+30) > widgetHeight) { //$(this).height(canvasHeight+30); } }); }; /** * methode prueft welches widget das letzte ist und fuegt diesem ein * bottom-margin von 15px hinzu, damit das canvas-schildchen sauber sitzt. */ window.laut.widgets.marginunten = function() { // letztes widget holen var letztesWidget = $(window.laut.widgets[0].widget.parent.parentNode).find('.widget'); letztesWidget = $(letztesWidget[(letztesWidget.length-1)]); var canvasHoehe = $(letztesWidget).find('canvas').height(); var hoehe = $(letztesWidget).height(); // wenn canvashoehe exakt widgethoehe+15 ist, muessen wir es erhoehen if(canvasHoehe == hoehe+15) { hoehe = (hoehe + 30) + 'px'; letztesWidget.css('height', hoehe); } }; window.laut.widgets.mindesthoehe(); //window.laut.widgets.marginunten(); $('ul.inhalt > li:last-child').addClass('last'); }); jQuery('document').ready(function($) { if (!window.laut) { window.laut = {}; } if (!window.laut.medium) { window.laut.medium = {}; } displayVoting = function(obj,votingId){ if (window.laut.medium[votingId]) { var parentUl = $(obj).parents().filter('ul.ulVoting'); $.each(parentUl.find('li.liVoting'), function() { if ($(this).attr('title') <= laut.medium[votingId].userwertung) { $(this).find('a').removeClass('mover'); $(this).find('a').addClass('uservoted'); } }); } }; removeVoting = function(obj){ $(obj).find('li.liVoting a').removeClass('uservoted'); }; setzeVoting = function(obj,votingId,votingWertung,c){ var p = { aktion: 7, medium: votingId, stimme: votingWertung } laut.pruefeLogin(function(){ laut.ajax.senden(p, function(a) { // pruefen ob erfolgreich abgestimmt wurde if(a.code && a.code == 1) { if (!window.laut.medium[votingId]) { window.laut.medium[votingId] = {}; } window.laut.medium[votingId].userwertung = a.stimme; c(); } else { laut.login(); } }); }); }; $('li.liVoting').live("click",function() { var votingWertung = $(this).attr('title'); var votingId = $(this).parents().filter('ul.ulVoting').attr('title'); var akt = this; setzeVoting(akt,votingId,votingWertung, function() { displayVoting(akt,votingId); }); return false; }); $('li.liVoting').live("mouseover",function() { var parentUl = $(this).parents().filter('ul.ulVoting'); removeVoting(parentUl); var voting = $(this).attr('title'); $.each(parentUl.find('li.liVoting'), function() { if ($(this).attr('title') <= voting) { $(this).find('a').addClass('mover'); } }); }); $('li.liVoting').live("mouseout",function() { $('li.liVoting a').removeClass('mover'); var votingId = $(this).parents().filter('ul.ulVoting').attr('title'); if (window.laut.medium[votingId]) { displayVoting(this,votingId); } }); }); jQuery(document).ready(function($){ laut.community.loginForm = {}; // loginform laden und anzeigen laut.community.loginForm.zeigen = function(c) { // wenn die form nicht vorhanden ist, wird sie angefordert if($('div#modalScreen').length == 0){ var p = { aktion: 13 }; laut.ajax.senden(p, function(d){ $('body').append(d); laut.community.loginForm.zeigen(c); }); return; } // aufgerufene funktion sichern laut.community.loginForm.cb = c; laut.scrollTo($('body'),500,function() { laut.community.loginForm.allesweg(); $('div#modalWindowLogin').show(); $('div#modalBack').fadeIn(500); $('div#modalScreen').css( { position: 'fixed', top: 0, left: 0 } ).fadeIn(500, function(){ // capcthas anhaengen $('div.registerCaptcha').each(function(){ if($(this).find('img.lautCaptcha').length == 0){ $(this).append(laut.captcha.neu()); } }); }); }); // aktion: loginscreen laden laut.trackClick('kl_sonstiges','login'); }; // login auf jeder seite laut.community.loginForm.allesweg = function(c) { $('div#modalWindowLogin').hide(); $('div#modalWindowRegister').hide(); $('div#modalWindowImport').hide(); $('div#modalWindowPasswort').hide(); $('div#modalWindowNachImport').hide(); return false; }; $('div.kopfLoginLinks a').live('click', function() { laut.community.loginForm.allesweg(); laut.pruefeLogin(function(){ }); return false; }); $('a.kopfLoginRegister').live('click', function() { laut.community.loginForm.allesweg(); $('div#modalWindowRegister').show(); laut.community.loginForm.zeigen(); return false; }); $('a.kopfLoginPasswort').live('click', function() { laut.community.loginForm.allesweg(); $('div#modalWindowPasswort').show(); laut.community.loginForm.zeigen(); return false; }); // loginform ausblenden laut.community.loginForm.ausblenden = function(c) { $('div#modalBack').fadeOut(500); $('div#modalScreen').fadeOut(500, function(){ if(c && typeof(c) == 'function'){ c(); } }); }; $('a.modalLogin').live('click', function() { laut.community.loginForm.zeigen(); return false; }); $('div.modalSchliessen').live('click', function() { laut.community.loginForm.ausblenden(); return false; }); $('a.modalToSignup').live('click', function() { $('div#modalWindowLogin').fadeOut(500, function() { $('div#modalWindowRegister').fadeIn(100); }); return false; }); $('a.modalToLogin').live('click', function() { $('div#modalWindowImport,div#modalWindowRegister,div#modalWindowPasswort').fadeOut(500); setTimeout(function(){ $('div#modalWindowLogin').fadeIn(100); }, 500); return false; }); // login $('#loginSubmit').live('click', function(){ // form holen var div = $(this); var b = $(this).parents('#login').find('#loginUsername'); var p = $(this).parents('#login').find('#loginPasswort'); var bv = b.attr('value'); // benutzerfeld var pv = p.attr('value'); // passwortfeld if((bv && bv != '') && (pv && pv != '')){ var p = { benutzer: bv, passwort: pv }; laut.login(p, function(d){ if(d && d.code == 1){ var c = laut.community.loginForm.cb; if(c && typeof(c) == 'function'){ c(); } laut.community.loginForm.ausblenden(); } // login fehlgeschlagen else{ var infoFeld = $(document.createElement('p')); infoFeld.addClass('infoFeld'); infoFeld.css('color', '#ae3939'); infoFeld.css('display', 'none'); infoFeld.css('margin', '0px 0px 10px'); div.before(infoFeld); infoFeld.html('Bitte überprüfe deine Logindaten!'); infoFeld.slideDown(250); } }); } else{ $(new Array(b, p)).each(function(){ if(this[0].value == ''){ stop == 1; this.addClass('fehler'); } else{ this.removeClass('fehler'); } }); } return false; }); // callbackfunktion fuer erfolgreichen facebooklogin laut.community.facebookCallback = function(){ // wir muessen pruefen ob der account // verknuepft ist var p = { aktion: 27 } $.ajax({ url: '/php/ajax.php', data: p, dataType: 'json', success: function(d){ if(d && d.code == 1){ laut.benutzer = { id: d.benutzer, hash: d.hash, auth: d.auth, name: d.name, bild: d.bild, url: d.url } laut.community.loginForm.ausblenden(laut.community.loginForm.cb) laut.community.loginstatus(); return true; } else{ $('#modalWindowLogin').fadeOut(250, function(){ $('#modalWindowNachImport').fadeIn(250); }); } } }); return false; }; // verknuepfen mit laut-profil $('#loginzusatz').live('submit', function(){ // namen holen var feld = $('#importUsername'); var name = feld[0].value; // checkbox holen var agb = feld.parent().find('#checkboxAgb'); var cb = $(agb).find('input:checkbox'); if(feld[0].value == ''){ feld.css('border-color', '#ae3939'); feld.css('background', '#fddbdb'); } if(cb[0].checked != true){ agb.css('color', '#ae3939'); } else{ agb.css('color', '#000000'); } if(cb[0].checked != true || feld[0].value == ''){ return false; } var p = { aktion: 10, n: name }; laut.ajax.senden(p, function(d){ if(d && d.code == 0){ feld.borderColor = feld.css('border-color'); feld.css('border-color', '#ae3939'); feld.css('background', '#fddbdb'); if(!feld.next().hasClass('infoFeld')){ var infoFeld = $(document.createElement('p')); infoFeld.addClass('infoFeld'); infoFeld.css('color', '#ae3939'); infoFeld.css('display', 'none'); feld.after(infoFeld); infoFeld.fadeIn(250); } else{ var infoFeld = feld.next(); } infoFeld.html(d.nachricht); } else if(d && d.code == 1){ laut.benutzer = { id: d.user.id, name: d.user.name, url: d.user.url } laut.community.loginForm.ausblenden(laut.community.loginForm.cb) laut.community.loginstatus(); return true; } }); return false; }); // benutzer registrieren $('#signupSubmit').live('click', function(){ // name, passwort, email und checkbox holen var n = $('#signupUsername'); var p = $('#signupPasswort'); var e = $('#signupEmail'); var c = $('#signup input[type=checkbox]'); var stop = 0; if(laut.captcha.check() == false){ stop = 1; } $(new Array(n, p, e, c)).each(function(){ if(this[0].type == 'checkbox'){ if(this[0].checked == true){ this.parent().css('color', '#000000'); } else{ stop = 1; this.parent().css('color', '#ae3939'); } } else{ if(this[0].value == ''){ stop == 1; this.addClass('fehler'); } else{ this.removeClass('fehler'); } } }); if(stop == 1){ return false; } var p = { aktion: 12, n: n[0].value, e: e[0].value, p: p[0].value, c: c[0].checked }; $.ajax({ url: '/php/ajax.php', data: p, dataType: 'json', statusCode: { 200: function(d){ $('#modalWindowRegister .modalDialog').empty().html('
' + d.nachricht + '
'); }, 409: function(){ alert('Der angegebene Benutzername oder die Emailadresse ist bereits bei uns registriert.'); } }, type: 'post' }); return false; }); // verknuepfen mit bestehendem account $('#connectSubmit').live('click', function(){ var n = $('#connectUsername')[0]; var p = $('#connectPasswort')[0]; var stop = 0; $('#connectUsername, #connectPasswort').each(function(){ if(this.value == ''){ $(this).addClass('fehler'); stop = 1; } else{ $(this).removeClass('fehler'); stop = 0; } }); if(stop == 1){ return false; } var p = { benutzer: n.value, passwort: p.value }; laut.login(p, function(d){ var div = $($('#loginconnect fieldset div')[0]).slideUp(250); var infoFeld = $('#loginconnect fieldset .infoFeld'); if(infoFeld.length > 0){ infoFeld.slideUp(250); } else{ var infoFeld = $(document.createElement('p')); infoFeld.addClass('infoFeld'); infoFeld.css('color', '#ae3939'); infoFeld.css('display', 'none'); infoFeld.css('margin', '0px 0px 10px'); div.after(infoFeld); } if(d && d.code == 1){ var p = { aktion: 11 }; laut.ajax.senden(p, function(d){ if(d && d.code == 1){ laut.community.loginForm.ausblenden(laut.community.loginForm.cb) return true; } }); } else{ infoFeld.html('Bitte überprüfe deine Logindaten!'); infoFeld.slideDown(250); } }); return false; }); // passwort vergessen-form anzeigen $('.passwortVergessen a').live('click', function(){ laut.community.loginForm.allesweg(); $('#modalWindowPasswort').fadeIn(500); return false; }); // passwort vergessen $('#passwortForm').live('submit', function(){ var stop = 0; if(laut.captcha.check() == false){ stop = 1; } $('#passwortEmail').each(function(){ if(this.value == ''){ stop = 1; $(this).addClass('fehler'); } else{ $(this).removeClass('fehler'); } }); if(stop == 0){ var p = { aktion: 14, e: $('#passwortEmail')[0].value } laut.ajax.senden(p, function(d){ if(d && d.code == 1){ laut.community.loginForm.ausblenden(); } }); } return false; }); laut.community.loginstatus = function(){ // wenn der benutzer eingeloggt ist .... if (laut.kommentare && typeof(laut.kommentare.posterPic) == "function") { laut.kommentare.posterPic(); } if(laut && laut.benutzer && laut.benutzer.id){ $('#kopfwrapper .kopfLoginLinks').slideUp(250,function(){ var div = $('#kopfwrapper .kopfLogin'); div.find('a.loginuser').attr('href', laut.benutzer.url); div.find('a.loginuser').html(laut.benutzer.name); div.slideDown(250); }); return true; } else{ $('#kopfwrapper .kopfLogin').slideUp(250,function(){ $('#kopfwrapper .kopfLoginLinks').slideDown(250); }); } // sonst nichts return false; } // ausloggen $('a.ausloggen').click(function(){ var p = { aktion: 25 } laut.ajax.senden(p, function(d){ if(d && d.code == 1){ laut.benutzer = {}; laut.community.loginstatus(); } }); return false; }); // loginstatus nach dem laden der seite ueberpruefen laut.community.loginstatus(); });jQuery('document').ready(function($) { if (laut.medium) { $('#iAlbum ul li.iVoting').hover(function(){ laut.medium.removeUservoting(); var voting = $(this).attr('title'); $.each($('#iAlbum ul li.iVoting'), function() { if ($(this).attr('title') <= voting) { $(this).find('a').addClass('mover'); } }); }, function(){ $('#iAlbum ul li a').removeClass('mover'); laut.medium.setzeUservoting(); }); laut.medium.removeUservoting = function(){ $('#iAlbum ul li a').removeClass('uservoted'); }; laut.medium.setzeUservoting = function(){ if (laut.medium.userwertung > 0) { $.each($('#iAlbum ul li.iVoting'), function() { if ($(this).attr('title') <= laut.medium.userwertung) { $(this).find('a').addClass('uservoted'); } }); } }; /* laut.medium.setzeLeservoting = function(v){ $('#leserWertung').empty(); $('#leserWertung').append(' wird neu berechnet'); $('#leserWertung').doTimeout( 'a0' , 3000, function(){ $('#leserWertung').empty(); for (i = 1;i <= 5; i++) { if (i <= v) { $('#leserWertung').append('*'); } else { $('#leserWertung').append(''); } } }); } */ laut.medium.setzeLeservoting = function(v){ var alteWertung = $('#leserWertung').html(); $('#leserWertung').empty(); $('#leserWertung').append(' wird neu berechnet'); var p = { aktion: 7, medium: laut.medium.id, stimme: v } laut.ajax.senden(p, function(a){ // pruefen ob erfolgreich abgestimmt wurde if(a.code && a.code == 1) { laut.medium.userwertung = a.stimme; laut.medium.setzeUservoting(); } // anzeige verzoegern $(this).doTimeout('leserwertung', 1000, function(){ if(a.code == 1) { $('#leserWertung').empty(); for (i = 1;i <= 5; i++) { if (i <= a.voting) { $('#leserWertung').append('*'); } else { $('#leserWertung').append(''); } } } else { $('#leserWertung').html(alteWertung); } }); }); } $('#iAlbum ul li.iVoting').click(function() { var li = this; laut.pruefeLogin(function(){ laut.medium.setzeLeservoting($(li).attr('title')); // aktion: albumvoting laut.trackClick('ls_voting','vote'); }); return false; }); /*laut.medium.abstimmen = function(n){ var p = { aktion: 7, medium: this.id, stimme: n }; if(!laut.medium.abgestimmt || laut.medium.abgestimmt == 0){ laut.ajax.senden(p, function(data){ if(data.code && data.code == 0){ alert(data.nachricht); } else if(data.code == 1){ laut.medium.setzeLeservoting(data.voting); laut.medium.abgestimmt = 1; } }); } };*/ } }); jQuery('document').ready(function($) { if(laut.artist){ $('#iArtist ul li.iBand').hover(function(){ laut.artist.removeUservoting(); $(this).addClass('mover'); $(this).find('a').addClass('mover'); }, function(){ $(this).removeClass('mover'); $(this).find('a').removeClass('mover'); laut.artist.setzeUservoting(); }); laut.artist.removeUservoting = function(){ $('#iArtist ul li.iBand').removeClass('uservoted'); $('#iArtist ul li.iBand a').removeClass('uservoted'); }; laut.artist.setzeUservoting = function(){ if ((laut.artist.userwertung) || (laut.artist.userwertung == 0)) { $.each($('#iArtist ul li.iBand'), function() { if ($(this).find('a').attr('rel') == laut.artist.userwertung) { $(this).addClass('uservoted'); $(this).find('a').addClass('uservoted'); } }); } }; laut.artist.setzeAnzahlFans = function(f, h){ $('#anzahlFans').empty(); $('#anzahlBans').empty(); $('#anzahlFans').append(' wird neu berechnet'); $('#anzahlBans').append(' wird neu berechnet'); $('#anzahlFans').doTimeout( 'a0' , 1000, function(){ $('#anzahlFans').empty(); $('#anzahlFans').append(f); }); $('#anzahlBans').doTimeout( 'a0' , 1000, function(){ $('#anzahlBans').empty(); $('#anzahlBans').append(h); }); }; $('#iArtist ul li.iBand').click(function() { var li = this; laut.pruefeLogin(function(){ var p = { aktion: 8, typ: 'interpret', verknuepfung: laut.artist.id, wertung: $(li).find('a')[0].rel }; laut.ajax.senden(p, function(a){ laut.artist.userwertung = p.wertung; laut.artist.setzeUservoting(); laut.artist.setzeAnzahlFans(a.fans, a.hater); // aktion: artistvoting laut.trackClick('wl_voting','fan'); }); }); return false; }); } }); jQuery('document').ready(function($) { if (laut.news) { $('form#iNews ul li#iMyspace a').click(function(){ $('form#iNews').submit(); return false; }); $('form.interaktiv div#kurzUrlKasten input').click(function(){ $(this).select(); }); } }); jQuery('document').ready(function($) { $('#event_search_location').autocomplete("/php/ajax.php?aktion=28", { width: 260, minChars: 2, cacheLength: 20, selectFirst: false }); }); /* SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License */ var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("