; // JavaScript Document function basename(path) { return path.replace(/\\/g,'/').replace( /.*\//, '' ); } function dirname(path) { return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');; } function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function str_replace(searchString, replaceString, subject) { return subject.split(searchString).join(replaceString); } function extround(zahl,n_stelle) { zahl = (Math.round(zahl * n_stelle) / n_stelle); return zahl; } function ucfirst(text) { text += ''; var f = text.charAt(0).toUpperCase(); return f + text.substr(1); } function toPreis(e){ var v = $(e).val(); $(e).val( v.replace(/[^0-9.,]/g, "") ); } function toInt(e){ var v = $(e).val(); $(e).val( v.replace(/[^0-9]/g, "") ); } function strip_tags(input, allowed) { // discuss at: http://phpjs.org/functions/strip_tags/ // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // improved by: Luke Godfrey // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // input by: Pul // input by: Alex // input by: Marc Palau // input by: Brett Zamir (http://brett-zamir.me) // input by: Bobby Drake // input by: Evertjan Garretsen // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Onno Marsman // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Eric Nagel // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Tomasz Wesolowski // revised by: Rafał Kukawski (http://blog.kukawski.pl/) // example 1: strip_tags('

Kevin


van Zonneveld', ''); // returns 1: 'Kevin van Zonneveld' // example 2: strip_tags('

Kevin van Zonneveld

', '

'); // returns 2: '

Kevin van Zonneveld

' // example 3: strip_tags("Kevin van Zonneveld", ""); // returns 3: "Kevin van Zonneveld" // example 4: strip_tags('1 < 5 5 > 1'); // returns 4: '1 < 5 5 > 1' // example 5: strip_tags('1
1'); // returns 5: '1 1' // example 6: strip_tags('1
1', '
'); // returns 6: '1
1' // example 7: strip_tags('1
1', '

'); // returns 7: '1
1' allowed = (((allowed || '') + '') .toLowerCase() .match(/<[a-z][a-z0-9]*>/g) || []) .join(''); // making sure the allowed arg is a string containing only tags in lowercase () var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, commentsAndPhpTags = /|<\?(?:php)?[\s\S]*?\?>/gi; return input.replace(commentsAndPhpTags, '') .replace(tags, function($0, $1) { return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; }); } function base64_decode(data) { // discuss at: http://phpjs.org/functions/base64_decode/ // original by: Tyler Akins (http://rumkin.com) // improved by: Thunder.m // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // input by: Aman Gupta // input by: Brett Zamir (http://brett-zamir.me) // bugfixed by: Onno Marsman // bugfixed by: Pellentesque Malesuada // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); // returns 1: 'Kevin van Zonneveld' // example 2: base64_decode('YQ==='); // returns 2: 'a' var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = '', tmp_arr = []; if (!data) { return data; } data += ''; do { // unpack four hexets into three octets using index points in b64 h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits >> 16 & 0xff; o2 = bits >> 8 & 0xff; o3 = bits & 0xff; if (h3 == 64) { tmp_arr[ac++] = String.fromCharCode(o1); } else if (h4 == 64) { tmp_arr[ac++] = String.fromCharCode(o1, o2); } else { tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); } } while (i < data.length); dec = tmp_arr.join(''); return dec.replace(/\0+$/, ''); } function createHtmlTable(data,displayValues) { ucfirst output = ''; output += ''; for (var x=0; x < displayValues.length; x++) { output += ''; } output += ''; for (var i=0; i < data.length; i++) { output += ''; for (var x=0; x < displayValues.length; x++) { if (displayValues[x] == "size") { display = Math.floor((data[i][displayValues[x]] / 1024)); output += ''; } else { output += ''; } } output += ''; } output += '
'+ucfirst([displayValues[x]])+'
'+display+' kb'+data[i][displayValues[x]]+'
'; return output; } function in_array (needle, haystack, argStrict) { // http://kevin.vanzonneveld.net // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: vlado houba // + input by: Billy // + bugfixed by: Brett Zamir (http://brett-zamir.me) // * example 1: in_array('van', ['Kevin', 'van', 'Zonneveld']); // * returns 1: true // * example 2: in_array('vlado', {0: 'Kevin', vlado: 'van', 1: 'Zonneveld'}); // * returns 2: false // * example 3: in_array(1, ['1', '2', '3']); // * returns 3: true // * example 3: in_array(1, ['1', '2', '3'], false); // * returns 3: true // * example 4: in_array(1, ['1', '2', '3'], true); // * returns 4: false var key = '', strict = !! argStrict; if (strict) { for (key in haystack) { if (haystack[key] === needle) { return true; } } } else { for (key in haystack) { if (haystack[key] == needle) { return true; } } } return false; } function array_search(needle, haystack, argStrict) { // Searches the array for a given value and returns the corresponding key if successful // // version: 1009.2513 // discuss at: http://phpjs.org/functions/array_search // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: array_search('zonneveld', {firstname: 'kevin', middle: 'van', surname: 'zonneveld'}); // * returns 1: 'surname' var strict = !!argStrict; var key = ''; for (key in haystack) { if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) { return key; } } return false; } function strpos (haystack, needle, offset) { // Finds position of first occurrence of a string within another // // version: 1103.1210 // discuss at: http://phpjs.org/functions/strpos // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Onno Marsman // + bugfixed by: Daniel Esteban // + improved by: Brett Zamir (http://brett-zamir.me) // * example 1: strpos('Kevin van Zonneveld', 'e', 5); // * returns 1: 14 var i = (haystack + '').indexOf(needle, (offset || 0)); return i === -1 ? false : i; } function utf8_decode (str_data) { // http://kevin.vanzonneveld.net // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Norman "zEh" Fuchs // + bugfixed by: hitwork // + bugfixed by: Onno Marsman // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: utf8_decode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0; str_data += ''; while (i < str_data.length) { c1 = str_data.charCodeAt(i); if (c1 < 128) { tmp_arr[ac++] = String.fromCharCode(c1); i++; } else if (c1 > 191 && c1 < 224) { c2 = str_data.charCodeAt(i + 1); tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = str_data.charCodeAt(i + 1); c3 = str_data.charCodeAt(i + 2); tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return tmp_arr.join(''); } function objectLength(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; } function var_dump(element, limit, depth) { depth = depth?depth:0; limit = limit?limit:1; returnString = '
    '; for(property in element) { //Property domConfig isn't accessable if (property != 'domConfig') { returnString += '
  1. '+ property + ' (' + (typeof element[property]) +')'; if (typeof element[property] == 'number' || typeof element[property] == 'boolean') returnString += ' : ' + element[property] + ''; if (typeof element[property] == 'string' && element[property]) returnString += ':
    ' + element[property].replace(//g, '&gt;') + '
    '; if ((typeof element[property] == 'object') && (depth < limit)) returnString += var_dump(element[property], limit, (depth + 1)); returnString += '
  2. '; } } returnString += '
'; if(depth == 0) { winpop = window.open("", "","width=800,height=600,scrollbars,resizable"); winpop.document.write('
'+returnString+ '
'); winpop.document.close(); } return returnString; } function number_format(number, decimals, dec_point, thousands_sep) { number = (number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function(n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } ; ; // JavaScript Document var ortSearchLoader = {}; function searchByTextInput(inputField){ if(!ortSearchLoader){ ortSearchLoader.abort(); } var searchField = inputField.parents('.inputSearchField'); var searchFieldWidth = searchField.width(); var inputWidth = inputField.width(); var searchAction = inputField.attr('data-searchAction'); var formField = inputField.attr('data-formField'); var callbackChooseResult = inputField.attr('data-choose-result'); callbackChooseResult = typeof callbackChooseResult != 'undefined' && callbackChooseResult ? callbackChooseResult : ''; var hideIconSelector = inputField.attr('data-hideIconSelector'); if (typeof(hideIconSelector) != 'undefined') $(hideIconSelector).hide('fast'); searchField.find('.inputSearchLoading').show('fast'); filePath = "/inc/modules/ajax.includes.php"; ortSearchLoader = $.ajax({ type: "POST", timeout: 5000, url: filePath, data: "action="+searchAction+"&input="+formField+"&keyword="+inputField.val()+"&chooseResultCallback="+callbackChooseResult, success: function(output){ searchField.find('.inputSearchResult').remove(); if (output != '') { searchField.append('
').css('width',inputWidth+'px'); searchField.find('.inputSearchResult .inputSearchContent').html(output); } if (typeof(hideIconSelector) != 'undefined') $(hideIconSelector).show('fast'); searchField.find('.inputSearchLoading').hide('fast'); }, error: function(){ searchField.find('.inputSearchLoading').hide('fast'); } }); } function setSearchValues(searchResultLink,label,value,hiddenFormField) { var searchFormular = $(searchResultLink).parents('form'); var searchInputHolder = $(searchResultLink).parents('.inputSearchField'); searchInputHolder.find('input').val(label); if (typeof(hiddenFormField) != 'undefined') { searchFormular.find('input[name="'+hiddenFormField+'"]').val(value); } searchInputHolder.find('.inputSearchResult').remove(); } var searchTimer; var searchTimerStatus; $(document).ready(function(){ createFormFunctions(); }); function createFormFunctions(cssPrefix) { cssPrefix = (typeof(cssPrefix) != 'undefined') ? cssPrefix+" " : ""; $(cssPrefix+'.contentSucheTrigger, .contentSucheMain span').click(function(){ $(this).parents('.contentSuche').find('.contentSucheMain').slideToggle(); }); $(cssPrefix+'input[data-inputSearch="true"]').each(function(){ var inputField = $(this); if(inputField.hasClass('inputSearchInit')) return false; inputField.addClass('inputSearchInit'); $(this).wrap(''); $(this).parent().append('') $(this).bind('focus keyup', function(event){ if (inputField.val().length >= 2 && (inputField.val() != inputField.attr('data-basicValue'))) { event.stopPropagation(); window.clearTimeout(searchTimer); searchTimer = window.setTimeout(function() { if(searchTimerStatus) searchTimerStatus.abort(); searchTimerStatus = searchByTextInput(inputField) }, 100); } if (event.type == 'focus') { var formField = inputField.attr('data-formField'); var searchFormular = inputField.parents('form'); if (typeof(formField) != 'undefined') { searchFormular.find('input[name="'+formField+'"]').val(""); } } }); }); }; ; // JavaScript Document function openPopUp() { centerMe($('#popupContentHolder'),true); $('#responsivePopup').height($('#outer').height()); $('#responsivePopup').fadeIn(); makeBasicJQueryCalls('#responsivePopup'); doStuffOnLoadAndResize('#responsivePopup'); } function setMaxHeightBySelector(selector,breakpoints) { var maxHeight = 0; elements = (typeof(selector) == 'string' || typeof(selector) == 'object') ? $(selector) : selector; elements.removeAttr("style"); if (typeof(breakpoints) != 'undefined') { setMaxHeightBySelectorAndBreakpoints(elements,breakpoints); } else { elements.each(function(index, element) { var container = $(element); var contheight = container.height(); if(contheight > maxHeight){ maxHeight = contheight; } }); elements.css('height',maxHeight); } } function setMaxHeightBySelectorAndBreakpoints(elements,breakpoints) { var container = new Object(); var ww = $(window).width(); var elementsInRow = 0; var breakpointKeys = Object.keys(breakpoints); breakpointKeys.forEach(function(key) { if (parseInt(ww) <= parseInt(key)) { elementsInRow = breakpoints[parseInt(key)]; breakpointKeys.length = 0; return false; } }); /*Object.keys(breakpoints).forEach(function(key) { if (ww <= key && elementsInRow == 0) { elementsInRow = breakpoints[key]; return false; } });*/ var x = 0; elements.each(function(index, element) { var newIndex = index + 1; if(typeof container[x] == 'undefined') container[x] = new Array(); container[x].push(element); if(newIndex % elementsInRow == 0){ x++; } }); $(container).each(function(index, containerRow){ for(i in containerRow){ setMaxHeightBySelector(containerRow[i]); } }); } function isIE() { var myNav = navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; } function IsSafari() { var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1; return is_safari; } function adresse(name, domain, tld){ var email = "
"+name+"@"+domain+"."+tld+""; document.write(email); } function isPluginLoaded(plugin) { return !!$.fn[plugin] } function toggleLink(aTag,toggleElement) { $('#'+toggleElement).toggle(); $(aTag).toggleClass("opened"); } function hideElement(element) { $('#'+element).css('display','none'); } function showElement(element) { $('#'+element).css('display','block'); } function changeClass(element, classString, clearClassString){ $(element).removeClass(clearClassString); $(element).addClass(classString); } function pickBgColorAndSetToInput(element, inputElement){ var bgColor = $(element).css('background-color'); /*$(inputElement).val(rgb2hex(bgColor));*/ if(typeof document.getElementById(inputElement).color == 'undefined'){ $('#'+inputElement).val(rgb2hex(bgColor)); $('#'+inputElement).focus(); $('#'+inputElement).blur(); }else{ document.getElementById(inputElement).color.fromString(rgb2hex(bgColor)); document.getElementById(inputElement).blur(); } } function rgb2hex(rgb) { if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb; rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); function hex(x) { return ("0" + parseInt(x).toString(16)).slice(-2); } return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } function scrollToSelector(selector) { $('html,body').animate({ scrollTop: $(selector).offset().top }, 1000); } /* function calculateFooterHeightAndScroll(footer,content) { footerHeight = $('#'+footer).height(); $('#'+content).css('padding-bottom', footerHeight+'px'); $('html,body').animate({ scrollTop: $('#footer').offset().top }, 1000); } function toggleFooterSitemap(aTag,sitemap,footer,paddingBottomElement) { $(aTag).toggleClass("open"); if ($('#'+sitemap).css('display') == 'block') $('#'+sitemap).hide(); else $('#'+sitemap).show(); //hideElement('seoContentTextHolder'); calculateFooterHeightAndScroll(footer,paddingBottomElement); } function calculateFooterHeightAndScroll(footer,content) { footerHeight = $('#'+footer).height(); //alert(footerHeight); $('#'+content).css('padding-bottom', footerHeight+'px'); window.scrollBy(0, footerHeight); } function toggleFooterSitemap(aTag,sitemap,footer,paddingBottomElement) { $(aTag).toggleClass("opened"); if ($('#'+sitemap).css('display') == 'block') $('#'+sitemap).hide(); else $('#'+sitemap).show(); } */ function formatImageInOverflowBox(uid,imageElement,final_width,final_height) { $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "uid="+uid+"&action=getImageSize&imagepath="+imageElement.src+"&width="+final_width+"&height="+final_height, success: function(output){ ; sizeArray = output.split('|'); $(imageElement).attr('width',sizeArray[3]); $(imageElement).attr('height',sizeArray[4]); $(imageElement).css({"margin-left" : sizeArray[1]+"px"}); $(imageElement).css({"margin-top" : sizeArray[2]+"px"}); } }); } function rerouteConfirm(target, question){ var where_to= confirm(question); if (where_to== true) { window.location=target; } } function callbackConfirm(question, callback, callbackParam){ var where_to = confirm(question); if (where_to == true){ eval(callback+'('+callbackParam+')'); return true; }else return false; } function displayShadowboxFrame(path,breite,hoehe,return_path) { Shadowbox.open({ player: 'iframe', content: path, width: breite+'px', height: hoehe+'px', options:{ onClose: function(){ if (typeof(return_path) != 'undefined') { parent.location.href=return_path; } } } }); } function openShadowbox(contentVar, playerVar, titleVar, widthVar, heightVar){ Shadowbox.open({ content: contentVar, player: playerVar, title: titleVar, width: widthVar, height: heightVar }); } function openShadowboxImage(contentVar, playerVar, titleVar, gallery){ Shadowbox.open({ content: contentVar, player: playerVar, title: titleVar, gallery: gallery }); } function openLayerIframe(url, width, height){ Shadowbox.open({ content: url, type: "iframe", player: "iframe", height: height, width: width, options: { modal: true, enableKeys: false, animate: false, overlayOpacity: 0.3 } }); } function getParentId(element,spacer) { id_row = $(element).parent().attr('id'); tmp = id_row.split(spacer); number = tmp[tmp.length-1]; return number; } function calculateSquareMeter(preisElement,flaecheElement,target,hiddenField) { preis = $.trim($('input[name='+preisElement+']').val()); flaeche = $.trim($('input[name='+flaecheElement+']').val()); preis = str_replace(' ','',preis); preis = str_replace('.','',preis); preis = str_replace(',','.',preis); flaeche = str_replace(' ','',flaeche); flaeche = str_replace('.','',flaeche); flaeche = str_replace(',','.',flaeche); if (isNumber(preis) && isNumber(flaeche)) { var preis_pro_qm = parseFloat(preis) / parseFloat(flaeche); result = extround(preis_pro_qm,2); $('#'+target).html(result+' €'); $('#'+hiddenField).val(result+' €'); } } function refreshParentPage() { window.location.reload(); } function submitParentPage() { $('#editpage').submit(); } var openShadowboxAndRefreshParent = function(content, player, title, height, width, gallery){ if (typeof(player) == 'undefined') player = 'iframe'; if (typeof(title) == 'undefined') title = ''; if (typeof(height) == 'undefined') height = ''; if (typeof(width) == 'undefined') width = ''; if (typeof(gallery) == 'undefined') gallery = ''; Shadowbox.open({ content: content, player: player, title: title, height: height, width: width, gallery: gallery, options:{onClose: refreshParentPage} // no parentheses after function name - doesn't work with them. }); } var openShadowboxAndSubmitParent = function(content, player, title, height, width, gallery){ if (typeof(player) == 'undefined') player = 'iframe'; if (typeof(title) == 'undefined') title = ''; if (typeof(height) == 'undefined') height = ''; if (typeof(width) == 'undefined') width = ''; if (typeof(gallery) == 'undefined') gallery = ''; Shadowbox.open({ content: content, player: player, title: title, height: height, width: width, gallery: gallery, options:{onClose: submitParentPage} // no parentheses after function name - doesn't work with them. }); } function ajaxConfirm(question,ajaxAction,value,outputElement,callback) { var where_to = confirm(question); if (where_to == true) { showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action="+ajaxAction+"&value="+value, success: function(output){ $('#'+outputElement).html(output); if (callback && typeof(callback) === "function") { callback(); } hideAjaxLoading(); } }); } } function calculateDotTable(){ /*$('.dotTable tr').not('.noDotCalculation').each(function(index, element) { var fullWi = $(element).width(); var childs = $(element).children('td'); var w1 = childs.eq(0).children(':first').outerWidth(); var w2 = childs.eq(1).children(':first').outerWidth(); var w3 = childs.eq(3).children(':first').outerWidth(); var fw = fullWi - w1 - w2 - w3 - 50; childs.eq(2).width(fw); });*/ } function initKeyShortcuts(){ $(document).bind('keypress', function(event) { // STRG + S if( event.which === 115 && event.ctrlKey ) { $('*[data-keycode="strg+s"]').trigger('click'); return false; } // STRG + O if( event.which === 79 && event.ctrlKey ) { $('*[data-keycode="strg+o"]').trigger('click'); return false; } }); } /* Update a jqTransform Selectbox */ function updateJqSelect(selector) { selectedVal = $(selector).children(':selected').val(); $(selector).children('option').removeAttr('selected'); $(selector).children('option[value="'+selectedVal+'"]').attr('selected','selected'); $(selector).removeClass('jqTransformHidden'); $(selector).css('display','block'); $(selector).prev('ul').remove(); /*$(selector).prev('div.selectWrapper').remove();*/ $(selector).prev('div.jqTransformElement').remove(); var selectElm = $(selector).closest('.jqTransformSelectWrapper').html(); $(selector).closest('.jqTransformSelectWrapper').after(selectElm); $(selector).closest('.jqTransformSelectWrapper').remove(); $(selector).closest('form').removeClass('jqtransformdone'); $(selector).closest('form').jqTransform(); $(selector).removeAttr('style'); } $.fn.jqTransSelectRefresh = function(){ return this.each(function(index){ var $select = $(this); var i=$select.parent().find('div,ul').remove().css('zIndex'); $select.unwrap().removeClass('jqTransformHidden').jqTransSelect(); $select.parent().css('zIndex', i); }); } function copyEvents(source, destination) { var events; source = $(source).first(); destination = $(destination); events = $(source).data('events'); if (!events) return; destination.each(function() { var t = $(this); $.each(events, function(index, event) { $.each(event, function(i, v) { t.bind(v.type, v.handler); }); }); }); } function getLatLang(formSelector, latSelector, lngSelector){ $('input.noInput',formSelector).val(''); var data = $(formSelector).serializeObject(); if(data.strasse && data.plz && data.ort){ $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=getLatLng&strasse="+data.strasse+"&plz="+data.plz+"&ort="+data.ort, success: function(output){ var splitter = output.split('|'); var lat = splitter[0]; var lng = splitter[1]; $(latSelector).val(lat); $(lngSelector).val(lng); } }); }else{ alert('Bitte füllen Sie folgende Felder: Straße, PLZ / Ort'); } } $.fn.serializeObject = function(){ var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name]) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }; /**fix_select('select#my_updated_select_box');*/ function everyLastElementBold(selector, schnitt , transform , size ) { /* schnitt[ normal, bold, <-- Basiswert | entspricht semibold italic, bolder, <-- entspricht bold lighter] transform[ uppercase, lowercase, capitalize] size[größe zb. 18px o. 1em] zum nutzen muss die changeBasicHtml.js im Projekt angepasst werden bsp. Mustermakler(Responsive2go) */ if (typeof(schnitt) == 'undefined') schnitt = false; if (typeof(transform) == 'undefined') transform = false; if (typeof(size) == 'undefined') size = false; $(selector).each(function(index, element) { var heading = $(element), word_array, last_word, first_part; word_array = heading.html().split(/\s+/); /* Trennt alle worte anhand der Leerzeichen */ last_word = word_array.pop(); first_part = word_array.join(' '); if (word_array.length >= 3){ heading.html([first_part, ' ', last_word, ''].join('')); if (schnitt != false){ if (schnitt == "bold"){ $('.addLastElementProperties').css({"font-weight" : "bold"}); }else if (schnitt == "italic"){ $('.addLastElementProperties').css({"font-style" : "italic"}); }else if (schnitt == "bolder"){ $('.addLastElementProperties').css({"font-weight" : "bolder"}); }else if (schnitt == "lighter"){ $('.addLastElementProperties').css({"font-weight" : "lighter"}); } }else{ $('.addLastElementProperties').css({"font-weight" : "bold"}); } if (transform != false){ $('.addLastElementProperties').css({"text-transform" : transform}); } if (size != false){ $('.addLastElementProperties').css({"font-size" : size}); } } }); homepageOnLoad(); } function addCustomControlsToSlider(sliderInstance,selector,type) { if (type == 'slick') { $(selector+' .customArrow.prev').click(function(){ sliderInstance.$slider.slick('slickPrev'); }); $(selector+' .customArrow.next').click(function(){ sliderInstance.$slider.slick('slickNext'); }); $(selector+' .customBulletPoint').click(function(){ $(selector+' .customBulletPoint').not($(this)).removeClass('active'); $(this).removeClass('active'); index = $(this).attr("data-index"); sliderInstance.$slider.slick('slickGoTo', index); }); } if (type == 'bxslider') { $(selector+' .customArrow.prev').click(function(){ sliderInstance.goToPrevSlide(); }); $(selector+' .customArrow.next').click(function(){ sliderInstance.goToNextSlide(); }); $(selector+' .customBulletPoint').click(function(){ $(selector+' .customBulletPoint').not($(this)).removeClass('active'); $(this).removeClass('active'); index = $(this).attr("data-index"); sliderInstance.goToSlide(index); }); } if (type == 'owl') { $(selector+' .customArrow.prev').click(function(){ sliderInstance.prev(); }); $(selector+' .customArrow.next').click(function(){ sliderInstance.next(); }); $(selector+' .customBulletPoint').click(function(){ $(selector+' .customBulletPoint').not($(this)).removeClass('active'); $(this).removeClass('active'); index = $(this).attr("data-index"); sliderInstance.goTo(index); }); } } function setCookiePermission() { $('#cookieBar').slideUp(function(){ $(this).remove(); }); var data = $('#acceptCookies').serialize(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "set=cookiesettings&" + data, success: function(output){ } }); } function deleteCookie(){ showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "delete=cookiesettings&", success: function(output){ hideAjaxLoading(); alertErfolgMessage('Cookies für '+window.location.hostname+' wurden erfolgreich gelöscht.'); } }); }; ; (function(exports){ // Array.prototype.map polyfill // code from https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map if (!Array.prototype.map){ Array.prototype.map = function(fun /*, thisArg */){ "use strict"; if (this === void 0 || this === null) throw new TypeError(); var t = Object(this); var len = t.length >>> 0; if (typeof fun !== "function") throw new TypeError(); var res = new Array(len); var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; i++) { // NOTE: Absolute correctness would demand Object.defineProperty // be used. But this method is fairly new, and failure is // possible only if Object.prototype or Array.prototype // has a property |i| (very unlikely), so use a less-correct // but more portable alternative. if (i in t) res[i] = fun.call(thisArg, t[i], i, t);ve } return res; }; } var A = 'A'.charCodeAt(0), Z = 'Z'.charCodeAt(0); /** * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616. * * @param {string} iban the IBAN * @returns {string} the prepared IBAN */ function iso13616Prepare(iban) { iban = iban.toUpperCase(); iban = iban.substr(4) + iban.substr(0,4); return iban.split('').map(function(n){ var code = n.charCodeAt(0); if (code >= A && code <= Z){ // A = 10, B = 11, ... Z = 35 return code - A + 10; } else { return n; } }).join(''); } /** * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064. * * @param iban * @returns {number} */ function iso7064Mod97_10(iban) { var remainder = iban, block; while (remainder.length > 2){ block = remainder.slice(0, 9); remainder = parseInt(block, 10) % 97 + remainder.slice(block.length); } return parseInt(remainder, 10) % 97; } /** * Parse the BBAN structure used to configure each IBAN Specification and returns a matching regular expression. * A structure is composed of blocks of 3 characters (one letter and 2 digits). Each block represents * a logical group in the typical representation of the BBAN. For each group, the letter indicates which characters * are allowed in this group and the following 2-digits number tells the length of the group. * * @param {string} structure the structure to parse * @returns {RegExp} */ function parseStructure(structure){ // split in blocks of 3 chars var regex = structure.match(/(.{3})/g).map(function(block){ // parse each structure block (1-char + 2-digits) var format, pattern = block.slice(0, 1), repeats = parseInt(block.slice(1), 10); switch (pattern){ case "A": format = "0-9A-Za-z"; break; case "B": format = "0-9A-Z"; break; case "C": format = "A-Za-z"; break; case "F": format = "0-9"; break; case "L": format = "a-z"; break; case "U": format = "A-Z"; break; case "W": format = "0-9a-z"; break; } return '([' + format + ']{' + repeats + '})'; }); return new RegExp('^' + regex.join('') + '$'); } /** * Create a new Specification for a valid IBAN number. * * @param countryCode the code of the country * @param length the length of the IBAN * @param structure the structure of the undernying BBAN (for validation and formatting) * @param example an example valid IBAN * @constructor */ function Specification(countryCode, length, structure, example){ this.countryCode = countryCode; this.length = length; this.structure = structure; this.example = example; } /** * Lazy-loaded regex (parse the structure and construct the regular expression the first time we need it for validation) */ Specification.prototype._regex = function(){ return this._cachedRegex || (this._cachedRegex = parseStructure(this.structure)) }; /** * Check if the passed iban is valid according to this specification. * * @param {String} iban the iban to validate * @returns {boolean} true if valid, false otherwise */ Specification.prototype.isValid = function(iban){ return this.length == iban.length && this.countryCode === iban.slice(0,2) && this._regex().test(iban.slice(4)) && iso7064Mod97_10(iso13616Prepare(iban)) == 1; }; /** * Convert the passed IBAN to a country-specific BBAN. * * @param iban the IBAN to convert * @param separator the separator to use between BBAN blocks * @returns {string} the BBAN */ Specification.prototype.toBBAN = function(iban, separator) { return this._regex().exec(iban.slice(4)).slice(1).join(separator); }; /** * Convert the passed BBAN to an IBAN for this country specification. * Please note that "generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account". * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits * * @param bban the BBAN to convert to IBAN * @returns {string} the IBAN */ Specification.prototype.fromBBAN = function(bban) { if (!this.isValidBBAN(bban)){ throw new Error('Invalid BBAN'); } var remainder = iso7064Mod97_10(iso13616Prepare(this.countryCode + '00' + bban)), checkDigit = ('0' + (98 - remainder)).slice(-2); return this.countryCode + checkDigit + bban; }; /** * Check of the passed BBAN is valid. * This function only checks the format of the BBAN (length and matching the letetr/number specs) but does not * verify the check digit. * * @param bban the BBAN to validate * @returns {boolean} true if the passed bban is a valid BBAN according to this specification, false otherwise */ Specification.prototype.isValidBBAN = function(bban) { return this.length - 4 == bban.length && this._regex().test(bban); }; var countries = {}; function addSpecification(IBAN){ countries[IBAN.countryCode] = IBAN; } addSpecification(new Specification("AD", 24, "F04F04A12", "AD1200012030200359100100")); addSpecification(new Specification("AE", 23, "F03F16", "AE070331234567890123456")); addSpecification(new Specification("AL", 28, "F08A16", "AL47212110090000000235698741")); addSpecification(new Specification("AT", 20, "F05F11", "AT611904300234573201")); addSpecification(new Specification("AZ", 28, "U04A20", "AZ21NABZ00000000137010001944")); addSpecification(new Specification("BA", 20, "F03F03F08F02", "BA391290079401028494")); addSpecification(new Specification("BE", 16, "F03F07F02", "BE68539007547034")); addSpecification(new Specification("BG", 22, "U04F04F02A08", "BG80BNBG96611020345678")); addSpecification(new Specification("BH", 22, "U04A14", "BH67BMAG00001299123456")); addSpecification(new Specification("BR", 29, "F08F05F10U01A01", "BR9700360305000010009795493P1")); addSpecification(new Specification("CH", 21, "F05A12", "CH9300762011623852957")); addSpecification(new Specification("CR", 21, "F03F14", "CR0515202001026284066")); addSpecification(new Specification("CY", 28, "F03F05A16", "CY17002001280000001200527600")); addSpecification(new Specification("CZ", 24, "F04F06F10", "CZ6508000000192000145399")); addSpecification(new Specification("DE", 22, "F08F10", "DE89370400440532013000")); addSpecification(new Specification("DK", 18, "F04F09F01", "DK5000400440116243")); addSpecification(new Specification("DO", 28, "U04F20", "DO28BAGR00000001212453611324")); addSpecification(new Specification("EE", 20, "F02F02F11F01", "EE382200221020145685")); addSpecification(new Specification("ES", 24, "F04F04F01F01F10", "ES9121000418450200051332")); addSpecification(new Specification("FI", 18, "F06F07F01", "FI2112345600000785")); addSpecification(new Specification("FO", 18, "F04F09F01", "FO6264600001631634")); addSpecification(new Specification("FR", 27, "F05F05A11F02", "FR1420041010050500013M02606")); addSpecification(new Specification("GB", 22, "U04F06F08", "GB29NWBK60161331926819")); addSpecification(new Specification("GE", 22, "U02F16", "GE29NB0000000101904917")); addSpecification(new Specification("GI", 23, "U04A15", "GI75NWBK000000007099453")); addSpecification(new Specification("GL", 18, "F04F09F01", "GL8964710001000206")); addSpecification(new Specification("GR", 27, "F03F04A16", "GR1601101250000000012300695")); addSpecification(new Specification("GT", 28, "A04A20", "GT82TRAJ01020000001210029690")); addSpecification(new Specification("HR", 21, "F07F10", "HR1210010051863000160")); addSpecification(new Specification("HU", 28, "F03F04F01F15F01", "HU42117730161111101800000000")); addSpecification(new Specification("IE", 22, "U04F06F08", "IE29AIBK93115212345678")); addSpecification(new Specification("IL", 23, "F03F03F13", "IL620108000000099999999")); addSpecification(new Specification("IS", 26, "F04F02F06F10", "IS140159260076545510730339")); addSpecification(new Specification("IT", 27, "U01F05F05A12", "IT60X0542811101000000123456")); addSpecification(new Specification("KW", 30, "U04A22", "KW81CBKU0000000000001234560101")); addSpecification(new Specification("KZ", 20, "F03A13", "KZ86125KZT5004100100")); addSpecification(new Specification("LB", 28, "F04A20", "LB62099900000001001901229114")); addSpecification(new Specification("LI", 21, "F05A12", "LI21088100002324013AA")); addSpecification(new Specification("LT", 20, "F05F11", "LT121000011101001000")); addSpecification(new Specification("LU", 20, "F03A13", "LU280019400644750000")); addSpecification(new Specification("LV", 21, "U04A13", "LV80BANK0000435195001")); addSpecification(new Specification("MC", 27, "F05F05A11F02", "MC5811222000010123456789030")); addSpecification(new Specification("MD", 24, "U02F18", "MD24AG000225100013104168")); addSpecification(new Specification("ME", 22, "F03F13F02", "ME25505000012345678951")); addSpecification(new Specification("MK", 19, "F03A10F02", "MK07250120000058984")); addSpecification(new Specification("MR", 27, "F05F05F11F02", "MR1300020001010000123456753")); addSpecification(new Specification("MT", 31, "U04F05A18", "MT84MALT011000012345MTLCAST001S")); addSpecification(new Specification("MU", 30, "U04F02F02F12F03U03", "MU17BOMM0101101030300200000MUR")); addSpecification(new Specification("NL", 18, "U04F10", "NL91ABNA0417164300")); addSpecification(new Specification("NO", 15, "F04F06F01", "NO9386011117947")); addSpecification(new Specification("PK", 24, "U04A16", "PK36SCBL0000001123456702")); addSpecification(new Specification("PL", 28, "F08F16", "PL61109010140000071219812874")); addSpecification(new Specification("PS", 29, "U04A21", "PS92PALS000000000400123456702")); addSpecification(new Specification("PT", 25, "F04F04F11F02", "PT50000201231234567890154")); addSpecification(new Specification("RO", 24, "U04A16", "RO49AAAA1B31007593840000")); addSpecification(new Specification("RS", 22, "F03F13F02", "RS35260005601001611379")); addSpecification(new Specification("SA", 24, "F02A18", "SA0380000000608010167519")); addSpecification(new Specification("SE", 24, "F03F16F01", "SE4550000000058398257466")); addSpecification(new Specification("SI", 19, "F05F08F02", "SI56263300012039086")); addSpecification(new Specification("SK", 24, "F04F06F10", "SK3112000000198742637541")); addSpecification(new Specification("SM", 27, "U01F05F05A12", "SM86U0322509800000000270100")); addSpecification(new Specification("TN", 24, "F02F03F13F02", "TN5910006035183598478831")); addSpecification(new Specification("TR", 26, "F05A01A16", "TR330006100519786457841326")); addSpecification(new Specification("VG", 24, "U04F16", "VG96VPVG0000012345678901")); // Angola addSpecification(new Specification("AO", 25, "F21", "AO69123456789012345678901")); // Burkina addSpecification(new Specification("BF", 27, "F23", "BF2312345678901234567890123")); // Burundi addSpecification(new Specification("BI", 16, "F12", "BI41123456789012")); // Benin addSpecification(new Specification("BJ", 28, "F24", "BJ39123456789012345678901234")); // Ivory addSpecification(new Specification("CI", 28, "U01F23", "CI17A12345678901234567890123")); // Cameron addSpecification(new Specification("CM", 27, "F23", "CM9012345678901234567890123")); // Cape Verde addSpecification(new Specification("CV", 25, "F21", "CV30123456789012345678901")); // Algeria addSpecification(new Specification("DZ", 24, "F20", "DZ8612345678901234567890")); // Iran addSpecification(new Specification("IR", 26, "F22", "IR861234568790123456789012")); // Jordan addSpecification(new Specification("JO", 30, "A04F22", "JO15AAAA1234567890123456789012")); // Madagascar addSpecification(new Specification("MG", 27, "F23", "MG1812345678901234567890123")); // Mali addSpecification(new Specification("ML", 28, "U01F23", "ML15A12345678901234567890123")); // Mozambique addSpecification(new Specification("MZ", 25, "F21", "MZ25123456789012345678901")); // Quatar addSpecification(new Specification("QA", 29, "U04A21", "QA30AAAA123456789012345678901")); // Senegal addSpecification(new Specification("SN", 28, "U01F23", "SN52A12345678901234567890123")); // Ukraine addSpecification(new Specification("UA", 29, "F25", "UA511234567890123456789012345")); var NON_ALPHANUM = /[^a-zA-Z0-9]/g, EVERY_FOUR_CHARS =/(.{4})(?!$)/g; /** * Utility function to check if a variable is a String. * * @param v * @returns {boolean} true if the passed variable is a String, false otherwise. */ function isString(v){ return (typeof v == 'string' || v instanceof String); } /** * Check if an IBAN is valid. * * @param {String} iban the IBAN to validate. * @returns {boolean} true if the passed IBAN is valid, false otherwise */ exports.isValid = function(iban){ if (!isString(iban)){ return false; } iban = this.electronicFormat(iban); var countryStructure = countries[iban.slice(0,2)]; return !!countryStructure && countryStructure.isValid(iban); }; /** * Convert an IBAN to a BBAN. * * @param iban * @param {String} [separator] the separator to use between the blocks of the BBAN, defaults to ' ' * @returns {string|*} */ exports.toBBAN = function(iban, separator){ if (typeof separator == 'undefined'){ separator = ' '; } iban = this.electronicFormat(iban); var countryStructure = countries[iban.slice(0,2)]; if (!countryStructure) { throw new Error('No country with code ' + iban.slice(0,2)); } return countryStructure.toBBAN(iban, separator); }; /** * Convert the passed BBAN to an IBAN for this country specification. * Please note that "generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account". * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits * * @param countryCode the country of the BBAN * @param bban the BBAN to convert to IBAN * @returns {string} the IBAN */ exports.fromBBAN = function(countryCode, bban){ var countryStructure = countries[countryCode]; if (!countryStructure) { throw new Error('No country with code ' + countryCode); } return countryStructure.fromBBAN(this.electronicFormat(bban)); }; /** * Check the validity of the passed BBAN. * * @param countryCode the country of the BBAN * @param bban the BBAN to check the validity of */ exports.isValidBBAN = function(countryCode, bban){ if (!isString(bban)){ return false; } var countryStructure = countries[countryCode]; return countryStructure && countryStructure.isValidBBAN(this.electronicFormat(bban)); }; /** * * @param iban * @param separator * @returns {string} */ exports.printFormat = function(iban, separator){ if (typeof separator == 'undefined'){ separator = ' '; } return this.electronicFormat(iban).replace(EVERY_FOUR_CHARS, "$1" + separator); }; /** * * @param iban * @returns {string} */ exports.electronicFormat = function(iban){ return iban.replace(NON_ALPHANUM, '').toUpperCase(); }; /** * An object containing all the known IBAN specifications. */ exports.countries = countries; })(typeof exports == 'undefined' ? this.IBAN = {} : exports);; ; var error_content; function submitAjaxForm(f,callback,outputDiv,adminSend,params) { form_id = $(f).attr("id"); clearEmptyFormFields('#'+form_id); if (adminSend == true) ajaxPath = "/modules/ajax.includes.php"; else ajaxPath = "/inc/modules/ajax.includes.php"; data_vars = $(f).serialize(); showAjaxLoading(); //Request abschicken $.ajax({ url: ajaxPath, type: "POST", data: data_vars, success: function (erfolgs_text) { if (typeof(tinyMCE) != 'undefined' && typeof(clearAllTinyMCE) == 'function') { clearAllTinyMCE(params); } if(typeof(outputDiv) == 'undefined' && (typeof(callback) == "undefined" || !callback)) { alertErfolgMessage(erfolgs_text); /* Nicht auskommentieren */ } else { console.log("OUTPUT", $(outputDiv)); console.log(erfolgs_text); $(outputDiv).html(erfolgs_text); makeBasicJQueryCalls(outputDiv); } if (callback && typeof(callback) === "function") { window.setTimeout(callback, 300); /*eval(callback+"('"+erfolgs_text+"')");*/ /*callback(erfolgs_text);*/ } else if (callback && typeof(callback) === "string") { p = (typeof(params) !== 'undefined') ? params : erfolgs_text; try { var json = JSON.parse(p); if (typeof(json.CODE) != 'undefined') eval(json.CODE); } catch(e) { eval(callback+"('"+p+"');"); } } hideAjaxLoading(); }, error: function(fehler_text) { alertBasicErrorMessage(fehler_text); } }); } function clearEmptyFormFields(formSelector) { $(formSelector+' .noInput').each(function(e){ $(this).val(''); }); $(formSelector+' input, '+formSelector+' select, '+formSelector+' textarea').each(function(e){ value = $(this).val(); basicValue = $(this).attr('data-basicValue'); if (value == basicValue && basicValue != '') { $(this).val(''); } }); } function showAjaxLoading(msg) { if(typeof msg == 'undefined'){ msg = 'Bitte warten. Ihre Anfrage wird bearbeitet'; } centerElement('ajax_loader'); $('#ajax_loader strong').html(msg); $('#ajax_loader').show(); } function hideAjaxLoading() { $('#ajax_loader').hide(); } // Formularanpassungen / Fehlerkorrekturen (ohne Formularprüfung) function focusFormular(f, act1, act2){ var myForm=document.getElementById(f); try{ myForm.action = act1+act2; }catch(e){ myForm.setAttribute('action', act1+act2); } } function setFormAndSubmit(formular,feld,wert) { form = document.getElementById(formular); form.elements[feld].value = wert; $(form).find('input[type="submit"]').click(); } function enterFormElement(element) { if(element.hasClass("noInput")) { element.removeClass('noInput'); element.val(""); } } function setBasicValues(jqElement) { if (jqElement.attr("data-jquery") != 0) { basicValue = jqElement.attr("data-basicValue"); realValue = jqElement.attr("data-realValue"); value = jqElement.val(); if (typeof(realValue) != 'undefined') { jqElement.val(realValue); jqElement.removeAttr("data-realValue"); } if (true) { if (!jqElement.hasClass('tinymce')) { if (typeof(basicValue) != 'undefined' && basicValue != '' && jqElement.val() == '') { if (basicValue.indexOf('*') == -1 && jqElement.hasClass("important")) { basicValue += ' *'; } jqElement.removeClass('error_input'); jqElement.addClass("noInput"); jqElement.val(basicValue); } } } /* if (true) { if (typeof(basicValue)!= 'undefined' && basicValue != '' && (jqElement.val() == '' || jqElement.hasClass("noInput")) && !jqElement.hasClass('tinymce')) { if (basicValue.indexOf('*') == -1 && value.indexOf('*') == -1) { if (jqElement.hasClass("important")) basicValue += ' *'; } jqElement.removeClass('error_input'); jqElement.addClass("noInput"); jqElement.val(basicValue); } } */ } } function handleFormCallback(data,f,title) { if (title != '') { formTitle = title; } else { formTitle = f.attr("title"); if (typeof(formTitle) == 'undefined') formTitle = "Formular:"; } if (data != '') { try { jsonObj = JSON.parse(data); if (typeof(jsonObj) == 'object') { if (jsonObj.MESSAGE != '' && typeof(jsonObj.MESSAGE) != 'undefined') { alertMessage(formTitle,jsonObj.MESSAGE,jsonObj.TYPE); } if (jsonObj.CODE != '') eval(jsonObj.CODE); } else { if (erfolgs_text.indexOf("alertMessage") == 0) eval(data); else alertMessage(formTitle,data, true); } } catch(err) { alert(data); } } } function setErrorClassAndReturnMessage(element,customMessage){ $(element).parents().each(function(index,element){ if($(this).is('label') || $(this).is('tr') || $(this).hasClass('handleError')) { $(this).addClass('error_input'); return false; } }); if (typeof(customMessage) != 'undefined' && customMessage != '') { return customMessage+", "; } if (element.attr("title") != '' && typeof(element.attr("title")) != 'undefined') { return element.attr("title")+", "; } return ""; } function removeErrorClass(element) { $(element).parents().each(function(index,e){ if($(this).hasClass('error_input')) { $(this).removeClass('error_input'); return; } }); } function checkRadioCheckboxButton(name) { var checked = 0; var checkElement = document.getElementsByName(name); for (var x = 0; x < checkElement.length; x++) { if (checkElement[x].checked) { checked++; } } if (checked == 0) { for (var x = 0; x < checkElement.length; x++) { $(checkElement[x]).parents().each(function(index,element){ if($(this).is('label') || $(this).is('tr') || $(this).hasClass('handleError') || $(this).hasClass('jqTransformCheckboxWrapper')) { $(this).addClass('error_input'); return false; } }); } return false; } else { return true; } } function getElementsById(elementID){ var elementCollection = new Array(); var allElements = document.getElementsByTagName("*"); for(i = 0; i < allElements.length; i++){ if(allElements[i].id == elementID) elementCollection.push(allElements[i]); } return elementCollection; } function checkFormContainerArea(selector){ formStatus = checkForm2014(selector,true,false,false,false,false,true); return formStatus; } function checkFormAndGetStatus(f){ formStatus = checkForm(f,true,false,false,false,false,true); return formStatus; } function checkForm2014(formElement,sendViaAjax,callback,outputDiv,adminSend,params,returnStatus){ if (sendViaAjax == '') sendViaAjax = false; var alreadyChecked = new Array(); var error = 0; var error_text = ''; var formContainer = $(formElement); var formular = (formContainer.is('form')) ? formContainer : formContainer.parents('form'); $('input,select,textarea', formContainer).each(function(index, element){ value = $(this).val(); basicValue = $(this).attr('data-basicValue'); if ($(element).hasClass('noInput') || value == basicValue) $(element).val(''); }); error = 0; $('input,select,textarea', formContainer).each(function(index, element){ var type = ($(element).is('textarea')) ? 'textarea' : $(element).attr('type'); var name = $(element).attr('name'); var title = $(element).attr('title'); var value = $(element).val(); if(type != 'hidden') { if ($(element).hasClass('important')){ if ($(element).hasClass('noInput')) { error_text += setErrorClassAndReturnMessage($(element)); error++; alreadyChecked[alreadyChecked.length + 1] = name; } else { if (!$(element).hasClass('specialCheck') && (!in_array(name, alreadyChecked) || $(element).hasClass('notUnique'))) { if ($(element).is('select')) type = 'select-one'; if (type == 'text' || type == 'select-one' || type == 'textarea') { if (value == '') { error_text += setErrorClassAndReturnMessage($(element)); error++; } alreadyChecked[alreadyChecked.length + 1] = name; } if (type == 'password') { if (name == 'pw') { var pw1 = value; if (pw1 == '') { error_text += setErrorClassAndReturnMessage($(element)); error++; } alreadyChecked[alreadyChecked.length + 1] = name; var pw1Element = $(element); var pw2Element = formContainer.find('input[name="pw2"]'); if (pw2Element.length > 0) { var pw2 = pw2Element.val(); if (pw2 == '') { error_text += setErrorClassAndReturnMessage($(pw2Element)); error++; } if (pw1 != pw2 && pw1 != '') { setErrorClassAndReturnMessage($(pw1Element),""); setErrorClassAndReturnMessage($(pw2Element),""); error_text += "Beide Passwörter müssen übereinstimmen"; error++; } alreadyChecked[alreadyChecked.length + 1] = pw2Element.attr("name"); } if (pw1Element.hasClass('strength') && (pw1Element.hasClass('weak') || pw1Element.hasClass('veryweak')) ) { setErrorClassAndReturnMessage($(pw1Element),""); error_text += "Das Passwort ist zu schwach"; error++; } } } if (type == 'radio' || type == 'checkbox') { if (!checkRadioCheckboxButton(name)) { error_text += title+", "; error++; } alreadyChecked[alreadyChecked.length + 1] = name; } } else { if ($(element).hasClass('specialCheck')) { if ($(element).hasClass('typeEmail')) { if (value == '' || strpos(value,'@') == false) { setErrorClassAndReturnMessage($(element)); error++; } alreadyChecked[alreadyChecked.length + 1] = name; } if ($(element).hasClass('decimalNumber')) { thisValue = valueString = value; thisValue = thisValue.replace(",","."); thisValue = parseFloat(thisValue); if (valueString == '' || isNaN(thisValue)) { setErrorClassAndReturnMessage($(element)); error++; } alreadyChecked[alreadyChecked.length + 1] = name; } if ($(element).hasClass('intNumber')) { thisValue = valueString = value; thisValue = parseInt(thisValue); if (isNaN(thisValue) || (valueString.indexOf(",") >= 0 || valueString.indexOf(".") >= 0 || valueString == '')) { setErrorClassAndReturnMessage($(element)); error++; } alreadyChecked[alreadyChecked.length + 1] = name; } if ($(element).hasClass('typeIBAN')) { alert("check iban"); } } } } } } }); if (error > 0) { basic_headline = 'Fehler im Formular'; basic_text = 'Bitte geben Sie alle Pflichtfelder an'; if (typeof(ERROR_MESSAGE_HEADLINE) != 'undefined') basic_headline = ERROR_MESSAGE_HEADLINE; if (typeof(ERROR_MESSAGE_TEXT_REQUIRED) != 'undefined') basic_text = ERROR_MESSAGE_TEXT_REQUIRED; error_text = error_text.substr(0,error_text.length-2); error_text = "

"+basic_headline+"

"+basic_text+": "+error_text+"

"; alertBasicErrorMessage(error_text); $('.noInput', formContainer).each(function(e){ setBasicValues($(this)); }); return false; } else { // Zweiter Paramter == true => Formular Mit AJAX abschicken if (sendViaAjax == true) { if (typeof(returnStatus) != 'undefined' && returnStatus == true) { return (error > 0) ? false : true; } else { submitAjaxForm(formular,callback,outputDiv,adminSend,params); return false; } } else return true; } } function checkForm(f,sendViaAjax,callback,outputDiv,adminSend,params,returnStatus){ var alreadyChecked = new Array(); var error = 0; var error_text = ''; f = document.forms[$(f).attr("id")]; if(typeof(f) == "undefined") return true; $('#'+$(f).attr("id")+' input, #'+$(f).attr("id")+' select, #'+$(f).attr("id")+' textarea').each(function(e){ value = $(this).val(); basicValue = $(this).attr('data-basicValue'); if (value == basicValue && basicValue != '') { $(this).val(''); } }); if(typeof f.elements != 'undefined') var anzahlElements = f.elements.length; else var anzahlElements = 0; if (sendViaAjax == '') sendViaAjax = false; error_content = document.getElementById('message_content'); for(var i=0; i < anzahlElements; i++) { name = f.elements[i].name; type = f.elements[i].type; if(type != 'hidden') { if ($(f.elements[i]).hasClass('important')){ if ($(f.elements[i]).hasClass('noInput')) { error_text +=setErrorClassAndReturnMessage($(f.elements[i])); error++; alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } else { if (!$(f.elements[i]).hasClass('specialCheck') && (!in_array(f.elements[i].name, alreadyChecked) || $(f.elements[i]).hasClass('notUnique'))) { if (type == 'text' || type == 'select-one' || type == 'select-multiple' || type == 'textarea') { if (f.elements[i].value == '') { error_text += setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if (type == 'password') { if (name == 'pw') { var pw1 = f.elements[i].value; if (pw1 == '') { error_text += setErrorClassAndReturnMessage($(f.elements[i])); error++; } else if (typeof(f.elements['pw2']) != 'undefined') { var pw2 = f.elements['pw2'].value; if (pw2 == '') { error_text += setErrorClassAndReturnMessage($(f.elements['pw2'])); error++; } if (pw1 != pw2 && pw1 != '') { setErrorClassAndReturnMessage($(f.elements[i]),""); setErrorClassAndReturnMessage($(f.elements["pw2"]),""); error_text += "Beide Passwörter müssen übereinstimmen, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements['pw2'].name; } if ($(f.elements['pw']).hasClass('strength') && ($(f.elements['pw']).hasClass('weak') || $(f.elements['pw']).hasClass('veryweak')) ) { setErrorClassAndReturnMessage($(f.elements["pw"]),""); error_text += "Das Passwort ist zu schwach, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } if (type == 'radio' || type == 'checkbox') { if (!checkRadioCheckboxButton(f.elements[i].name)) { error_text += f.elements[i].title+", "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } else { if ($(f.elements[i]).hasClass('specialCheck')) { if ($(f.elements[i]).hasClass('typeEmail')) { if (f.elements[i].value == '' || strpos(f.elements[i].value,'@') == false) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige E-Mail, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('decimalNumber')) { value = valueString = f.elements[i].value; value = value.replace(",","."); value = parseFloat(value); if (valueString == '' || isNaN(value)) { setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('intNumber')) { value = valueString = f.elements[i].value; value = parseInt(value); if (isNaN(value) || (valueString.indexOf(",") >= 0 || valueString.indexOf(".") >= 0 || valueString == '')) { setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('typeIBAN')) { if (typeof(IBAN.isValid) !== 'undefined') { value = valueString = f.elements[i].value; status = IBAN.isValid(value); if (status != true) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige IBAN, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } if ($(f.elements[i]).hasClass('typeBIC')) { value = valueString = f.elements[i].value; regSWIFT = /^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/; if(regSWIFT.test(value) == false) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige BIC, "; error++; } } } } } } } } if (error > 0) { basic_headline = 'Fehler im Formular'; basic_text = 'Bitte geben Sie alle Pflichtfelder an'; if (typeof(ERROR_MESSAGE_HEADLINE) != 'undefined') basic_headline = ERROR_MESSAGE_HEADLINE; if (typeof(ERROR_MESSAGE_TEXT_REQUIRED) != 'undefined') basic_text = ERROR_MESSAGE_TEXT_REQUIRED; error_text = error_text.substr(0,error_text.length-2); error_text = "

"+basic_headline+"

"+basic_text+": "+error_text+"

"; alertBasicErrorMessage(error_text); $('#'+$(f).attr("id")+' .noInput').each(function(e){ setBasicValues($(this)); }); return false; } else { if (sendViaAjax == true) { if (typeof(returnStatus) != 'undefined' && returnStatus == true) { return (error > 0) ? false : true; } else { submitAjaxForm(f,callback,outputDiv,adminSend,params); return false; } } else return true; } } function countLettersAndOutput(elem,output,textlen) { text = elem.value; anzLetter = text.length; $('#'+output).html('Anzahl Zeichen: '+anzLetter); if (anzLetter > textlen) { $(elem).addClass('error_input'); } else { $(elem).removeClass('error_input'); } } function countLettersAndWordsAndOutput(elem,output,spacer,textlen,wordlen) { text = elem.value; words = text.split(spacer); anzLetter = text.length; anzWords = words.length; $('#'+output).html('Anzahl Wörter: '+anzWords+'
Anzahl Zeichen: '+anzLetter); if (anzLetter > textlen || anzWords > wordlen) { $(elem).addClass('error_input'); } else { $(elem).removeClass('error_input'); } } function add2SelectBoxAndRemove(formular, from_select, to_select) { var x = 0; var newArray = new Array(); var removeArray = new Array(); element_from = formular.elements[from_select]; element_to = formular.elements[to_select]; for (var i=0; i < element_from.options.length; i++){ if (element_from.options[i].selected) { var newOption = document.createElement("option"); newOption.text = element_from.options[i].text; newOption.value = element_from.options[i].value; element_to.options.add(newOption); element_from.remove(i); --i; } } } function clearSelectBox(element) { elem = document.getElementById(element); elem.length = 0; } function selectAll(formular,selectBox) { f = formular.name; for (var i=0; i < formular.elements[selectBox].options.length; i++){ formular.elements[selectBox].options[i].selected = true; } } function resetSelectBox(formular,selectBox) { for (var i=0; i < formular.elements[selectBox].options.length; i++){ formular.elements[selectBox].options[i] = null } } function add2SelectBox(formular, from_select, to_select) { var x = 0; var newArray = new Array(); var removeArray = new Array(); element_from = formular.elements[from_select]; element_to = formular.elements[to_select]; for (var i=0; i < element_from.options.length; i++){ if (element_from.options[i].selected) { var newOption = document.createElement("option"); newOption.text = element_from.options[i].text; newOption.value = element_from.options[i].value; element_to.options.add(newOption); element_from.options[i].selected = false; } } } function removeFromSelectBox(formular, form_select) { var x = 0; element_form = formular.elements[form_select]; for (var i=0; i < element_form.options.length; i++){ if (element_form.options[i].selected) { element_form.remove(i); --i; } } } /*========================[ Alte Funktionen die irgendwann ersetzt / abgelösst werden können ]=======================*/ function alertMessage(html,status) { if (typeof(status) == 'undefined' || status == false) { alertBasicErrorMessage(html); } else { alertErfolgMessage(html); } } function alertBasicErrorMessage(error_text) { if (error_text == '') { error_text = '

Fehler im Formular

Bitte füllen Sie alle Pflichtfelder aus!

'; } error_text = '
'+error_text+'
'; if (typeof(error_content) == 'undefined') { error_content = document.getElementById('message_content'); } error_content.innerHTML = error_text; if(error_text) { centerElement('form_message'); $('#form_message').removeClass('erfolg'); $('#form_message').addClass('fehler'); $('#form_message').fadeIn('slow'); } } function alertErfolgMessage(erfolg_text) { if (erfolg_text) { error_text = '
'+erfolg_text+'
'; if (typeof(error_content) == 'undefined') { error_content = document.getElementById('message_content'); } error_content.innerHTML = error_text; centerElement('form_message'); $('#form_message').removeClass('fehler'); $('#form_message').addClass('erfolg'); $('#form_message').fadeIn('slow'); } } function centerElement(el) { /* var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ? window.document.documentElement : window.document.body || null; element = document.getElementById(el); var win_h = (window.innerHeight || parseInt(body.clientHeight )) / 2; var win_w = (window.innerWidth || parseInt(body.clientWidth)) / 2; var height = ($('#'+el).height() / 2); var width = ($('#'+el).width() / 2); var t = win_h - height + parseInt(window.pageYOffset || body.scrollTop) ; var l = win_w - width + parseInt(window.pageXOffset || body.scrollLeft); element.style.top = t + 'px'; */ box = $('#'+el); boxWidth = box.width(); boxHeight = box.height(); box.css({ 'left' : '50%', 'top' : '50%', 'margin-left': -(boxWidth / 2)+'px', 'margin-top': -(boxHeight / 2)+'px' }); } function hideMessageBox(message_box_id) { $('#'+message_box_id).fadeOut('slow'); } ; ; // JavaScript Document function add2note(uid,objnr,text,buttonElement) { showAjaxLoading(); if (typeof(text) == 'undefined') text = ''; if (typeof(buttonElement) == 'undefined') buttonElement = 'obj2note'; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "uid="+uid+"&action=add2note&text="+text+"&objektnr_extern="+objnr, success: function(output){ $('#'+buttonElement).addClass('added'); $('#'+buttonElement).attr('href','javascript:alert("Das Objekt ist bereits auf dem Merkzettel");'); $('#toMemorizedObjects').slideDown('fast'); $('#globalMerkzettelHolder').show('fast'); createIconElements(); hideAjaxLoading(); }, error: function(){ hideAjaxLoading(); } }); } function add2noteButton(buttonElement,uid,objnr) { showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "uid="+uid+"&action=add2note&objektnr_extern="+objnr, success: function(output){ $('#'+buttonElement).addClass('added'); $('#'+buttonElement).attr('href','javascript:alert("Das Objekt ist bereits auf dem Merkzettel");'); $('#toMemorizedObjects').slideDown('fast'); $('#globalMerkzettelHolder').show('fast'); createIconElements(); hideAjaxLoading(); }, error: function(){ hideAjaxLoading(); } }); } function removeFromNote(uid,objnr,target_id,effect) { if (typeof(effect) == 'undefined') effect = "fadeOut"; showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "uid="+uid+"&action=removeFromNote&objektnr_extern="+objnr, success: function(output){ eval("$('#obj_'+target_id)."+effect+"('slow')"); $('#memo_objektnr_extern_'+target_id).val(''); hideAjaxLoading(); }, error: function(){ hideAjaxLoading(); } }); } ; ; // JavaScript Document var faTimer = ''; function shopSearch(searchString, start){ // Eigentliche FUnktion start = typeof start == 'undefined' || start == 'false' ? false : true; if(searchString.length < 2 && searchString.length != 0) return false; if(!start){ clearTimeout(faTimer); faTimer = setTimeout(function (){ shopSearch(searchString,true) }, 1000); return false; }else clearTimeout(faTimer); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "shopSearch=true&search="+encodeURIComponent(searchString), success: function(output){ if(output != 0 && output){ $('#shopSearchResultHolder').fadeIn(200); $('#shopSearchResult').html(output); makeBasicJQueryCalls('#shopSearchResult'); }else $('#shopSearchResultHolder').hide(); } }); } function displayStats(outputElement,dateElement,bestellElement,sortElement) { date = $(dateElement); bestell = $(bestellElement); sortElement = $(sortElement); dateVal = date.find('option:selected').val(); bestellVal = bestell.find('option:selected').val(); sortVal = sortElement.find('option:selected').val(); $.ajax({ type: "POST", url: "/modules/ajax.includes.php", data: "action=formatStats&dateVal="+dateVal+"&bestellVal="+bestellVal+"&sortVal="+sortVal, success: function(output){ $(outputElement).html(output); } }); } /* not used */ function refreshWarenkorbInfoBox(outputElement) { if (typeof(outputElement) == 'undefined') outputElement = '.flyingBox #wk-price'; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=getWarenkorbPreis", success: function(output){ $(outputElement).html(output); } }); } /* not used */ function refreshWarenkorbInfo(outputElement) { if (typeof(outputElement) == 'undefined') outputElement = '#warenkorbInfo'; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=refreshWarenkorbInfo", success: function(output){ $(outputElement).html(output); } }); } /* not used */ function refreshSmallWarenkorb(outputElement) { if (typeof(outputElement) == 'undefined') outputElement = '#smallWarenkorbHolder'; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=refreshSmallWarenkorb", success: function(output){ $(outputElement).html(output); } }); } /* not used */ function refreshBigWarenkorb(outputElement) { if (typeof(outputElement) == 'undefined') outputElement = '#bigWarenkorbHolder'; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=refreshBigWarenkorb", success: function(output){ $(outputElement).html(''); $(outputElement).html(output); makeBasicJQueryCalls(outputElement); } }); refreshWarenkorbPrice(); } /* not used */ function updateBasket(element) { data_vars = $(element.form).serialize(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=updateBasket", data: data_vars, success: function(output){ refreshBigWarenkorb("#bigWarenkorbHolder"); } }); } /* not used */ function previewImage(selectField,previewContainerID) { varText = selectField.find('option:selected').text(); words = varText.split(" "); for(i=0; i= 3) { $(previewContainerID+' img').each(function(){ imageTitle = $(this).attr("title"); if (imageTitle.indexOf(words[i]) != -1) { $(this).trigger('click'); return; } }); } } } /* not used */ function refreshDetailPrice(selectFieldName1,selectFieldName2,mengeSelect,artikelID,jQueryOutputPreis,jQueryOutputMwst,formField) { value1 = $('#'+selectFieldName1).val(); value2 = $('#'+selectFieldName2).val(); menge = $('#'+mengeSelect).val(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=refreshDetailPrice&artikel="+artikelID+"&auswahldata1="+value1+"&auswahldata2="+value2+"&menge="+menge, success: function(output){ text = output.split('|'); $('#'+formField).val(text[0]); $(jQueryOutputPreis).html(text[1]); $(jQueryOutputMwst).html(text[2]); } }); } /* not used */ function displayBigImage(pfad) { image = ''; $('#bigImageLayer .layerContent').html(''); $('#bigImageLayer .layerContent').html(image); //centerElement('bigImageLayer'); $('#bigImageLayer').fadeIn('slow'); } function toggleLieferadresse() { if ($('#lieferAdresse').hasClass('hidden')) { $('#lieferAdresse').slideDown('fast',function() { $('#lieferAdresse input.checkIt, #lieferAdresse select.checkIt').addClass('important'); $('#lieferAdresse').removeClass('hidden'); $('#lieferAdresse').addClass('display'); }); } else { $('#lieferAdresse').slideUp('fast',function() { $('#lieferAdresse input.checkIt, #lieferAdresse select.checkIt').removeClass('important'); $('#lieferAdresse input.checkIt, #lieferAdresse select.checkIt').removeClass('error_input'); $('#lieferAdresse').removeClass('display'); $('#lieferAdresse').addClass('hidden'); }); } } function showBankeinzug() { $('#bankdatenHolder').slideDown('fast',function() { $('#bankdatenHolder input').addClass('important'); $('#bankdatenHolder').removeClass('hidden'); $('#bankdatenHolder').addClass('display'); }); } function hideBankeinzug() { $('#bankdatenHolder').slideUp('fast',function() { $('#bankdatenHolder input').removeClass('important'); $('#bankdatenHolder input').removeClass('error_input'); $('#bankdatenHolder').removeClass('display'); $('#bankdatenHolder').addClass('hidden'); }); } /* not used */ function updateArtikelNr(aid,var1,var2,var3,outputElement,inputElement) { var1Value = $(var1).find("option:selected").val(); var2Value = $(var2).find("option:selected").val(); var3Value = $(var3).find("option:selected").val(); var1Value = (typeof(var1Value) != 'undefined') ? var1Value : ''; var2Value = (typeof(var2Value) != 'undefined') ? var2Value : ''; var3Value = (typeof(var3Value) != 'undefined') ? var3Value : ''; $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=updateArtikelNr&aid="+aid+"&var1="+var1Value+"&var2="+var2Value+"&var3="+var3Value, success: function(output){ $(outputElement).html(output); $(inputElement).val(output); } }); } /* not used ??? */ function shopPagiGoTo(s){ var aktPage = $('#goToPage').val(), maxPage = $('#maxpage').val(), newPage = 1; if(typeof s == 'string'){ switch(s){ case 'next': newPage = parseInt(aktPage) + 1; break; case 'last': newPage = maxPage; break; case 'first': newPage = 1; break; case 'prev': newPage = parseInt(aktPage) - 1; break; } }else{ newPage = s; } $('#goToPage').val(newPage); $('#goToPage').parents('form').submit(); } /* not used */ function loadWarenkorbList() { if($('#warenkorb-box').css('display') == 'none'){ showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=loadWarenkorbList", success: function(output){ $('#warenkorbListe').html(output); $('#warenkorb-box').show(); hideAjaxLoading(); } }); } } /* not used */ function refreshWarenkorbPrice(){ $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=getWarenkorbPreis", success: function(output){ $('#wk-price').html(output); } }); } /***************************************** 2015 ******************************************************/ function refreshShop() { /* refreshWarenkorbInfo(); refreshSmallWarenkorb(); refreshBigWarenkorb(); refreshWarenkorbInfoBox(); */ updateShopInfoRow(); } function updateShopInfoRow() { $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=updateShopInfoRow", success: function(output){ $('#shopInfoContainer').replaceWith(output); } }); } function refreshShopAndOutputMessage() { refreshShop(); $('#shopMessage').html("Sie haben den Artikel Ihrem Warenkorb hinzugefügt"); $('#shopMessage').slideDown(500,function(){ setTimeout(function(){ $('#shopMessage').slideUp(); },5000); }); } function refreshShopAndOutputMessageEN() { refreshShop(); $('#shopMessage').html("The product was successfully added to the cart"); $('#shopMessage').slideDown(500,function(){ setTimeout(function(){ $('#shopMessage').slideUp(); },5000); }); } function changeArtikelVariante(element) { showAjaxLoading(); var artikel = $(element).attr('data-artikel'); var artikelNr = $(element).val(); $('#artikelMenge ul a:eq(0)').click(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=changeArtikelVariante&aid="+artikel+"&artikelNr="+artikelNr, success: function(output){ if (typeof(output) != 'undefined') { jsonObj = JSON.parse(output); if (jsonObj.CODE != '') eval(jsonObj.CODE); if (jsonObj.HTML != '') $('#variantenTextHolder').html(jsonObj.HTML); if (jsonObj.artikelNr != '') $('#artikelNummerInput').val(jsonObj.artikelNr); if (jsonObj.artikelPreis != '') $('#artikelPreisValue').val(jsonObj.artikelPreis); if (jsonObj.artikelPreisFormat != '') $('#artikelPreis .displayPrice').html(jsonObj.artikelPreisFormat); makeBasicJQueryCalls('#shopDetailPage'); } hideAjaxLoading(); } }); hideAjaxLoading(); } function refreshDetailPrice2014(variante, menge, aid) { showAjaxLoading(); variante = $('select[name="'+variante+'"]').val(); menge = $('select[name="'+menge+'"]').val(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action=refreshDetailPrice2014&aid="+aid+"&artikelNr="+variante+"&menge="+menge, success: function(output){ $('#artikelPreis .displayPrice').html(output); hideAjaxLoading(); } }); } function addOneArtikelToWarenkorb(e, id, artikelNr, successText){ showAjaxLoading(); $.ajax({ type: "POST", url: "/inc/modules/ajax.includes.php", data: "action_form=addArtikel2Warenkorb&artikelID="+id+"&artikelNummer="+artikelNr+"&menge=1", success: function(output){ hideAjaxLoading(); updateShopInfoRow(); } }); } ; ; /* * jQuery doTimeout: Like setTimeout, but better! - v1.0 - 3/3/2010 * http://benalman.com/projects/jquery-dotimeout-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(l){var m=this,h,k={},g=l?$.fn:$,n=arguments,i=4,f=n[1],j=n[2],p=n[3];if(typeof f!=="string"){i--;f=l=0;j=n[1];p=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(f){k=a[f]||(a[f]={})}}k.id&&clearTimeout(k.id);delete k.id;function e(){if(l){h.removeData(l)}else{if(f){delete a[f]}}}function o(){k.id=setTimeout(function(){k.fn()},j)}if(p){k.fn=function(q){if(typeof p==="string"){p=g[p]}p.apply(m,d.call(n,i))===true&&!q?o():e()};o()}else{if(k.fn){j===undefined?e():k.fn(j===false);return true}else{e()}}}})(jQuery);; ; /** A jQuery version of window.resizeStop. This creates a jQuery special event called "resizestop". This event fires after a certain number of milliseconds since the last resize event fired. Additionally, as part of the event data that gets passed to the eventual handler function, the resizestop special event passes the size of the window in an object called "size". For example: $(window).bind('resizestop', function (e) { console.log(e.data.size); }); This is useful for performing actions that depend on the window size, but are expensive in one way or another - i.e. heavy DOM manipulation or asset loading that might be detrimental to performance if run as often as resize events can fire. @name jQuery.event.special.resizestop @requires jQuery 1.4.2 @namespace */ (function ($, setTimeout) { var $window = $(window), cache = $([]), last = 0, timer = 0, size = {}; /** Handles window resize events. @private @ignore */ function onWindowResize() { last = $.now(); timer = timer || setTimeout(checkTime, 10); } /** Checks if the last window resize was over the threshold. If so, executes all the functions in the cache. @private @ignore */ function checkTime() { var now = $.now(); if (now - last < $.resizestop.threshold) { timer = setTimeout(checkTime, 10); } else { clearTimeout(timer); timer = last = 0; size.width = $window.width(); size.height = $window.height(); cache.trigger('resizestop'); } } /** Contains configuration settings for resizestop events. @namespace */ $.resizestop = { propagate: false, threshold: 500 }; /** Contains helper methods used by the jQuery special events API. @namespace @ignore */ $.event.special.resizestop = { setup: function (data, namespaces) { cache = cache.not(this); // Prevent duplicates. cache = cache.add(this); if (cache.length === 1) { $window.bind('resize', onWindowResize); } }, teardown: function (namespaces) { cache = cache.not(this); if (!cache.length) { $window.unbind('resize', onWindowResize); } }, add: function (handle) { var oldHandler = handle.handler; handle.handler = function (e) { // Generally, we don't want this to propagate. if (!$.resizestop.propagate) { e.stopPropagation(); } e.data = e.data || {}; e.data.size = e.data.size || {}; $.extend(e.data.size, size); return oldHandler.apply(this, arguments); }; } }; })(jQuery, setTimeout);; ; /*! * jQuery resize event - v1.1 - 3/14/2010 * http://benalman.com/projects/jquery-resize-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ // Script: jQuery resize event // // *Version: 1.1, Last updated: 3/14/2010* // // Project Home - http://benalman.com/projects/jquery-resize-plugin/ // GitHub - http://github.com/cowboy/jquery-resize/ // Source - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.js // (Minified) - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.min.js (1.0kb) // // About: License // // Copyright (c) 2010 "Cowboy" Ben Alman, // Dual licensed under the MIT and GPL licenses. // http://benalman.com/about/license/ // // About: Examples // // This working example, complete with fully commented code, illustrates a few // ways in which this plugin can be used. // // resize event - http://benalman.com/code/projects/jquery-resize/examples/resize/ // // About: Support and Testing // // Information about what version or versions of jQuery this plugin has been // tested with, what browsers it has been tested in, and where the unit tests // reside (so you can test it yourself). // // jQuery Versions - 1.3.2, 1.4.1, 1.4.2 // Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1. // Unit Tests - http://benalman.com/code/projects/jquery-resize/unit/ // // About: Release History // // 1.1 - (3/14/2010) Fixed a minor bug that was causing the event to trigger // immediately after bind in some circumstances. Also changed $.fn.data // to $.data to improve performance. // 1.0 - (2/10/2010) Initial release (function($,window,undefined){ '$:nomunge'; // Used by YUI compressor. // A jQuery object containing all non-window elements to which the resize // event is bound. var elems = $([]), // Extend $.resize if it already exists, otherwise create it. jq_resize = $.resize = $.extend( $.resize, {} ), timeout_id, // Reused strings. str_setTimeout = 'setTimeout', str_resize = 'resize', str_data = str_resize + '-special-event', str_delay = 'delay', str_throttle = 'throttleWindow'; // Property: jQuery.resize.delay // // The numeric interval (in milliseconds) at which the resize event polling // loop executes. Defaults to 250. jq_resize[ str_delay ] = 250; // Property: jQuery.resize.throttleWindow // // Throttle the native window object resize event to fire no more than once // every milliseconds. Defaults to true. // // Because the window object has its own resize event, it doesn't need to be // provided by this plugin, and its execution can be left entirely up to the // browser. However, since certain browsers fire the resize event continuously // while others do not, enabling this will throttle the window resize event, // making event behavior consistent across all elements in all browsers. // // While setting this property to false will disable window object resize // event throttling, please note that this property must be changed before any // window object resize event callbacks are bound. jq_resize[ str_throttle ] = true; // Event: resize event // // Fired when an element's width or height changes. Because browsers only // provide this event for the window element, for other elements a polling // loop is initialized, running every milliseconds // to see if elements' dimensions have changed. You may bind with either // .resize( fn ) or .bind( "resize", fn ), and unbind with .unbind( "resize" ). // // Usage: // // > jQuery('selector').bind( 'resize', function(e) { // > // element's width or height has changed! // > ... // > }); // // Additional Notes: // // * The polling loop is not created until at least one callback is actually // bound to the 'resize' event, and this single polling loop is shared // across all elements. // // Double firing issue in jQuery 1.3.2: // // While this plugin works in jQuery 1.3.2, if an element's event callbacks // are manually triggered via .trigger( 'resize' ) or .resize() those // callbacks may double-fire, due to limitations in the jQuery 1.3.2 special // events system. This is not an issue when using jQuery 1.4+. // // > // While this works in jQuery 1.4+ // > $(elem).css({ width: new_w, height: new_h }).resize(); // > // > // In jQuery 1.3.2, you need to do this: // > var elem = $(elem); // > elem.css({ width: new_w, height: new_h }); // > elem.data( 'resize-special-event', { width: elem.width(), height: elem.height() } ); // > elem.resize(); $.event.special[ str_resize ] = { // Called only when the first 'resize' event callback is bound per element. setup: function() { // Since window has its own native 'resize' event, return false so that // jQuery will bind the event using DOM methods. Since only 'window' // objects have a .setTimeout method, this should be a sufficient test. // Unless, of course, we're throttling the 'resize' event for window. if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; } var elem = $(this); // Add this element to the list of internal elements to monitor. elems = elems.add( elem ); // Initialize data store on the element. $.data( this, str_data, { w: elem.width(), h: elem.height() } ); // If this is the first element added, start the polling loop. if ( elems.length === 1 ) { loopy(); } }, // Called only when the last 'resize' event callback is unbound per element. teardown: function() { // Since window has its own native 'resize' event, return false so that // jQuery will unbind the event using DOM methods. Since only 'window' // objects have a .setTimeout method, this should be a sufficient test. // Unless, of course, we're throttling the 'resize' event for window. if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; } var elem = $(this); // Remove this element from the list of internal elements to monitor. elems = elems.not( elem ); // Remove any data stored on the element. elem.removeData( str_data ); // If this is the last element removed, stop the polling loop. if ( !elems.length ) { clearTimeout( timeout_id ); } }, // Called every time a 'resize' event callback is bound per element (new in // jQuery 1.4). add: function( handleObj ) { // Since window has its own native 'resize' event, return false so that // jQuery doesn't modify the event object. Unless, of course, we're // throttling the 'resize' event for window. if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; } var old_handler; // The new_handler function is executed every time the event is triggered. // This is used to update the internal element data store with the width // and height when the event is triggered manually, to avoid double-firing // of the event callback. See the "Double firing issue in jQuery 1.3.2" // comments above for more information. function new_handler( e, w, h ) { var elem = $(this), data = $.data( this, str_data ); // If called from the polling loop, w and h will be passed in as // arguments. If called manually, via .trigger( 'resize' ) or .resize(), // those values will need to be computed. data.w = w !== undefined ? w : elem.width(); data.h = h !== undefined ? h : elem.height(); old_handler.apply( this, arguments ); }; // This may seem a little complicated, but it normalizes the special event // .add method between jQuery 1.4/1.4.1 and 1.4.2+ if ( $.isFunction( handleObj ) ) { // 1.4, 1.4.1 old_handler = handleObj; return new_handler; } else { // 1.4.2+ old_handler = handleObj.handler; handleObj.handler = new_handler; } } }; function loopy() { // Start the polling loop, asynchronously. timeout_id = window[ str_setTimeout ](function(){ // Iterate over all elements to which the 'resize' event is bound. elems.each(function(){ var elem = $(this), width = elem.width(), height = elem.height(), data = $.data( this, str_data ); // If element size has changed since the last time, update the element // data store and trigger the 'resize' event. if ( width !== data.w || height !== data.h ) { elem.trigger( str_resize, [ data.w = width, data.h = height ] ); } }); // Loop. loopy(); }, jq_resize[ str_delay ] ); }; })(jQuery,this);; ; /* Copyright 2012, Ben Lin (http://dreamerslab.com/) * Licensed under the MIT License (LICENSE.txt). * * Version: 1.0.15 * * Requires: jQuery >= 1.2.3 */ (function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';}var f={absolute:false,clone:false,includeMargin:false};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");d+="visibility: hidden !important; display: block !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);g.push(m.attr("style"));m.attr("style",d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});})(jQuery);; ; /*! Autosize v1.18.4 - 2014-01-11 Automatically adjust textarea height based on user input. (c) 2014 Jack Moore - http://www.jacklmoore.com/autosize license: http://www.opensource.org/licenses/mit-license.php */ (function ($) { var defaults = { className: 'autosizejs', append: '', callback: false, resizeDelay: 10, placeholder: true }, // border:0 is unnecessary, but avoids a bug in Firefox on OSX copy = '