$( document ).ready(function() { $( ".jQinsertLeaflet" ).attr('title','Save on leaflet'); $( ".jQinsertLeaflet" ).click(function( event ) { var accID=$('input:hidden[name=INFOaccID]').val(); $.ajax({ type: "POST", url: "/ajax.php", data: { insertLeaflet: accID} }).done(function( msg ) { writeMessage('#d-nav',msg); checkLeaflet(); }); }); if($('#messageok, #messagefailed, .hinweisGREEN').show()){ deleteMessage('#messageok, #messagefailed, .hinweisGREEN'); } $( ".openNewW" ).click(function(event) { window.open(this.href);return false; }); $("#logItemTopR" ).click(function(event) { logOpenClose(); }); $("#languageContainer").click(function(event) { langOpenClose(); }); checkLeaflet(); $('a[href*=#]').bind("click", function(event) { // duration in ms var duration=500; // easing values: swing | linear var easing='swing'; // get / set parameters var newHash=this.hash; var target=$(this.hash).offset().top; var oldLocation=window.location.href.replace(window.location.hash, ''); var newLocation=this; // make sure it's the same location if(oldLocation+newHash==newLocation) { // animate to target and set the hash to the window.location after the animation $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() { // add new hash to the browser location window.location.href=newLocation; }); // cancel default click action return false; } }); showAccGallery(); $('body').append( '
'); }); function logOpenClose(){ if($("#logItemTopR div").is(":visible")){ $('#logItemTopR div').hide(); $('#logItemTopR').removeClass('backgroundIMGArrowBottom'); }else{ $('#langContent').hide(); $('#logItemTopR').addClass('backgroundIMGArrowBottom'); $('#logItemTopR div').show(); } } function langOpenClose(){ if($("#langContent").is(":visible")){ $('#langContent').slideUp('fast'); }else{ $('#logItemTopR div').hide(); $('#langContent').slideDown('fast'); } } function checkLeaflet(){ var img=''); //alert(msg); }); } function writeMessage(Container,message){ $('
'+message+'
').insertBefore(Container); $('.systemMessage').slideUp(500).fadeIn(400, function() { deleteMessage(this); }); } function deleteMessage(container){ $(container).delay(5000).fadeOut(400, function(){ $(this).remove(); }); } //###################################### accGal ######################// function showAccGallery(){ $('#detail-cont #uaGallery #prev, #detail-cont #uaGallery #next').click(function() { $('#galContent img').eq(0).removeClass('imgShow'); nextContent=$(this).attr('href'); ajaxContainer='#galContent'; loadAjaxContent(nextContent,'#hiddenCont'); return false; }); } function loadGalleryContent(url){ //alert($('#hiddenCont #galContent img').attr('src')); $('#galContent img').eq(0).addClass('imgShow'); $('#galContent img').eq(0).attr({ src:$('#hiddenCont #galContent img').attr('src'), alt:$('#hiddenCont #galContent img').attr('alt') } ); var data = $('#hiddenCont').html(); var arr = data.split('
'); $('#uaGallery strong').text(arr[0].replace(/(<([^>]+)>)/ig,"")); $('#uaGallery #imgDesc').html($('#hiddenCont #imgDesc').html()); } function setGalleryLinks(url,container){ var a=$('#galContent '+container); var c=$('#hiddenCont '+container); //alert($(c).css('display')+container+' a: '+$(a).css('display')+' pos: '+$(c).attr('href')); if($(c).css('display')=='none' || $(c).css('display')==undefined){ $(a).hide(100); }else{ $(a).removeClass('hid'); $(a).show(100); $(a).attr('href',$(c).attr('href')); } } function emptyHiddenC(){ $("#hiddenCont").empty(); } function loadAjaxContent(url,container){ $.ajax({ url: url, dataType: 'html', success: function(html) { var n = $('#uaGallery',$(html)).addClass('done'); $(container).html(n); setGalleryLinks(nextContent,'#next'); setGalleryLinks(nextContent,'#prev'); loadGalleryContent(nextContent); emptyHiddenC(); } }); }