;
// 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('
').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 get_browser_info(){
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
return {name:'IE',version:(tem[1]||'')};
}
if(M[1]==='Chrome'){
tem=ua.match(/\bOPR\/(\d+)/)
if(tem!=null) {return {name:'Opera', version:tem[1]};}
}
M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}
return {
name: M[0],
version: M[1]
};
}
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;
}
});
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('forms').removeClass('jqtransformdone');
$(selector).closest('forms').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 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 hash2bold(selector) {
$(selector).each(function(index, element) {
var heading = $(element);
var new_heading = heading.html().replace('#','') + '';
heading.html(new_heading);
$('.addLastElementProperties').css({"font-weight" : "bolder"});
});
}
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(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") {
alertErfolgMessage(erfolgs_text); /* Nicht auskommentieren */
} else {
$(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 {
eval(callback+"('"+p+"');");
/*
jsonObj = JSON.parse(p);
if (typeof(jsonObj) == 'object') {
if (jsonObj.CODE != '') eval(jsonObj.CODE);
}
if (jsonObj.MESSAGE != '') {
if (jsonObj.TYPE == true) {
alertErfolgMessage(jsonObj.MESSAGE);
} else {
alertBasicErrorMessage(jsonObj.MESSAGE);
}
}
*/
} catch(e) {
}
}
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");
placeholder = jqElement.attr("placeholder");
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 (typeof(placeholder) != 'undefined' && placeholder != '' && jqElement.val() == '') {
if (placeholder.indexOf('*') == -1 && jqElement.hasClass("important")) {
placeholder += ' *';
}
jqElement.removeClass('error_input');
jqElement.addClass("noInput");
jqElement.attr('placeholder', placeholder);
}
}
}
/*
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,formular) {
var checked = 0;
if (typeof(formular) != 'undefined') {
var checkElement = $(formular).find('*[name="'+name+'"]');
} else {
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).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 (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,formular)) {
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) {
error_text = error_text.substr(0,error_text.length-2);
error_text = "
Achtung!
Diese Nachricht konnte leider nicht abgesendet werden.
Bitte überprüfen Sie folgende Eingaben:
"+error_text+"
Hinweis: Dieses Formular enthält Pflichtfelder, die ausgefüllt werden müssen. Pflichtfelder sind mit einem * markiert.";
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,f)) {
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) {
error_text = error_text.substr(0,error_text.length-2);
if($("body").hasClass("adminMode")) {
error_text = "
Bitte überprüfen Sie folgende Eingaben:
" + error_text + "
";
} else {
error_text = "
Achtung!
Diese Nachricht konnte leider nicht abgesendet werden.
Bitte überprüfen Sie folgende Eingaben:
" + error_text + "
Hinweis: Dieses Formular enthält Pflichtfelder, die ausgefüllt werden müssen. Pflichtfelder sind mit einem * markiert.";
}
alertBasicErrorMessage(error_text);
$('#'+$(f).attr("id")+' .noInput').each(function(e){
setBasicValues($(this));
});
return false;
} else {
$('.submit').css('display','none');
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 = "
Achtung!
Diese Nachricht konnte leider nicht abgesendet werden.
Bitte überprüfen Sie folgende Eingaben:
"+error_text+"
Hinweis: Dieses Formular enthält Pflichtfelder, die ausgefüllt werden müssen. Pflichtfelder sind mit einem * markiert.";
}
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();
}
});
}
;
;
/*
* 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 = '',
// line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
typographyStyles = [
'fontFamily',
'fontSize',
'fontWeight',
'fontStyle',
'letterSpacing',
'textTransform',
'wordSpacing',
'textIndent'
],
// to keep track which textarea is being mirrored when adjust() is called.
mirrored,
// the mirror element, which is used to calculate what size the mirrored element should be.
mirror = $(copy).data('autosize', true)[0];
// test that line-height can be accurately copied.
mirror.style.lineHeight = '99px';
if ($(mirror).css('lineHeight') === '99px') {
typographyStyles.push('lineHeight');
}
mirror.style.lineHeight = '';
$.fn.autosize = function (options) {
if (!this.length) {
return this;
}
options = $.extend({}, defaults, options || {});
if (mirror.parentNode !== document.body) {
$(document.body).append(mirror);
}
return this.each(function () {
var
ta = this,
$ta = $(ta),
maxHeight,
minHeight,
boxOffset = 0,
callback = $.isFunction(options.callback),
originalStyles = {
height: ta.style.height,
overflow: ta.style.overflow,
overflowY: ta.style.overflowY,
wordWrap: ta.style.wordWrap,
resize: ta.style.resize
},
timeout,
width = $ta.width();
if ($ta.data('autosize')) {
// exit if autosize has already been applied, or if the textarea is the mirror element.
return;
}
$ta.data('autosize', true);
if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){
boxOffset = $ta.outerHeight() - $ta.height();
}
// IE8 and lower return 'auto', which parses to NaN, if no min-height is set.
minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height());
$ta.css({
overflow: 'hidden',
overflowY: 'hidden',
wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
//resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
});
// The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
// window.getComputedStyle, getBoundingClientRect returning a width are unsupported, but also unneeded in IE8 and lower.
function setWidth() {
var width;
var style = window.getComputedStyle ? window.getComputedStyle(ta, null) : false;
if (style) {
width = ta.getBoundingClientRect().width;
if (width === 0) {
width = parseInt(style.width,10);
}
$.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
width -= parseInt(style[val],10);
});
} else {
width = Math.max($ta.width(), 0);
}
//mirror.style.width = width + 'px';
}
function initMirror() {
var styles = {};
mirrored = ta;
mirror.className = options.className;
maxHeight = parseInt($ta.css('maxHeight'), 10);
// mirror is a duplicate textarea located off-screen that
// is automatically updated to contain the same text as the
// original textarea. mirror always has a height of 0.
// This gives a cross-browser supported way getting the actual
// height of the text, through the scrollTop property.
$.each(typographyStyles, function(i,val){
styles[val] = $ta.css(val);
});
$(mirror).css(styles);
setWidth();
// Chrome-specific fix:
// When the textarea y-overflow is hidden, Chrome doesn't reflow the text to account for the space
// made available by removing the scrollbar. This workaround triggers the reflow for Chrome.
if (window.chrome) {
var width = ta.style.width;
ta.style.width = '0px';
var ignore = ta.offsetWidth;
ta.style.width = width;
}
}
// Using mainly bare JS in this function because it is going
// to fire very often while typing, and needs to very efficient.
function adjust() {
var height, original;
if (mirrored !== ta) {
initMirror();
} else {
setWidth();
}
if (!ta.value && options.placeholder) {
// If the textarea is empty, copy the placeholder text into
// the mirror control and use that for sizing so that we
// don't end up with placeholder getting trimmed.
mirror.value = ($(ta).attr("placeholder") || '') + options.append;
} else {
mirror.value = ta.value + options.append;
}
mirror.style.overflowY = ta.style.overflowY;
original = parseInt(ta.style.height,10);
// Setting scrollTop to zero is needed in IE8 and lower for the next step to be accurately applied
mirror.scrollTop = 0;
mirror.scrollTop = 9e4;
// Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding.
height = mirror.scrollTop;
if (maxHeight && height > maxHeight) {
ta.style.overflowY = 'scroll';
height = maxHeight;
} else {
ta.style.overflowY = 'hidden';
if (height < minHeight) {
height = minHeight;
}
}
height += boxOffset;
if (original !== height) {
ta.style.height = height + 'px';
if (callback) {
options.callback.call(ta,ta);
}
}
}
function resize () {
clearTimeout(timeout);
timeout = setTimeout(function(){
var newWidth = $ta.width();
if (newWidth !== width) {
width = newWidth;
adjust();
}
}, parseInt(options.resizeDelay,10));
}
if ('onpropertychange' in ta) {
if ('oninput' in ta) {
// Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those occasions. There is no way that I
// know of to detect something like 'cut' in IE9.
$ta.on('input.autosize keyup.autosize', adjust);
} else {
// IE7 / IE8
$ta.on('propertychange.autosize', function(){
if(event.propertyName === 'value'){
adjust();
}
});
}
} else {
// Modern Browsers
$ta.on('input.autosize', adjust);
}
// Set options.resizeDelay to false if using fixed-width textarea elements.
// Uses a timeout and width check to reduce the amount of times adjust needs to be called after window resize.
if (options.resizeDelay !== false) {
$(window).on('resize.autosize', resize);
}
// Event for manual triggering if needed.
// Should only be needed when the value of the textarea is changed through JavaScript rather than user input.
$ta.on('autosize.resize', adjust);
// Event for manual triggering that also forces the styles to update as well.
// Should only be needed if one of typography styles of the textarea change, and the textarea is already the target of the adjust method.
$ta.on('autosize.resizeIncludeStyle', function() {
mirrored = null;
adjust();
});
$ta.on('autosize.destroy', function(){
mirrored = null;
clearTimeout(timeout);
$(window).off('resize', resize);
$ta
.off('autosize')
.off('.autosize')
.css(originalStyles)
.removeData('autosize');
});
// Call adjust in case the textarea already contains text.
adjust();
});
};
}(window.jQuery || window.$)); // jQuery or jQuery-like library, such as Zepto
;
;
/*
* VenoBox - jQuery Plugin
* version: 1.3.4
* @requires jQuery
*
* Examples at http://lab.veno.it/venobox/
* License: Creative Commons Attribution 3.0 License
* License URI: http://creativecommons.org/licenses/by/3.0/
* Copyright 2013-2014 Nicola Franchini - @nicolafranchini
*
*/
(function(D){var u,k,n,M,y,G,i,x,z,f,H,c,l,r,J,q,j,P,R,I,t,v,N,C,A,b,g,d,Q,e,O,w,a,o,B;D.fn.extend({venobox:function(S){var T={framewidth:"",frameheight:"",border:"0",bgcolor:"#fff",numeratio:false,infinigall:false};var S=D.extend(T,S);return this.each(function(){var U=D(this);U.addClass("vbox-item");U.data("framewidth",S.framewidth);U.data("frameheight",S.frameheight);U.data("border",S.border);U.data("bgcolor",S.bgcolor);U.data("numeratio",S.numeratio);U.data("infinigall",S.infinigall);u=(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?true:false);k=((document.all&&!window.atob)?true:false);U.click(function(V){V.stopPropagation();V.preventDefault();U=D(this);n=U.data("overlay");J=U.data("framewidth");q=U.data("frameheight");j=U.data("border");P=U.data("bgcolor");A=false;b=false;g=false;z=U.attr("href");f=D(window).scrollTop();f=-f;D("body").wrapInner('');y=D(".vwrap");x='
');
var $wrapper = $input.parent().parent().parent();
$wrapper.css("width", inputSize+10);
$input
.focus(function(){$wrapper.addClass("jqTransformInputWrapper_focus");})
.blur(function(){$wrapper.removeClass("jqTransformInputWrapper_focus");})
.hover(function(){$wrapper.addClass("jqTransformInputWrapper_hover");},function(){$wrapper.removeClass("jqTransformInputWrapper_hover");})
;
/* If this is safari we need to add an extra class */
$.browser.safari && $wrapper.addClass('jqTransformSafari');
$.browser.safari && $input.css('width',$wrapper.width()+16);
this.wrapper = $wrapper;
});
};
/***************************
Check Boxes
***************************/
$.fn.jqTransCheckBox = function(){
return this.each(function(){
if($(this).hasClass('jqTransformHidden')) {return;}
var $input = $(this);
var inputSelf = this;
//set the click on the label
var oLabel=jqTransformGetLabel($input);
/*oLabel && oLabel.click(function(){aLink.trigger('click');});*/
oLabel && oLabel.click(function(){
var forAttr = null;
if(forAttr = $(this).attr('for')) {
var element = $(this).siblings('#' + forAttr);
if(element.length) {
element.trigger('click');
}
}
else {
aLink.trigger('click');
}
});
var aLink = $('');
//wrap and add the link
$input.addClass('jqTransformHidden').wrap('').parent().prepend(aLink);
//on change, change the class of the link
$input.change(function(){
this.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
return true;
});
// Click Handler, trigger the click and change event on the input
aLink.click(function(){
//do nothing if the original input is disabled
if($input.attr('disabled')){return false;}
//trigger the envents on the input object
$input.trigger('click').trigger("change");
return false;
});
// set the default state
this.checked && aLink.addClass('jqTransformChecked');
});
};
/***************************
Radio Buttons
***************************/
$.fn.jqTransRadio = function(){
return this.each(function(){
if($(this).hasClass('jqTransformHidden') || $(this).hasClass('nojq')) {return;}
var $input = $(this);
var inputSelf = this;
oLabel = jqTransformGetLabel($input);
/*oLabel && oLabel.click(function(){aLink.trigger('click');});*/
oLabel && oLabel.click(function(){
var forAttr = null;
if(forAttr = $(this).attr('for')) {
/*var element = $(this).siblings('#' + forAttr);*/
var element = $('#' + forAttr).prev();
if(element.length) {
element.trigger('click');
}
}
else {
aLink.trigger('click');
}
});
var aLink = $('');
$input.addClass('jqTransformHidden').wrap('').parent().prepend(aLink);
$input.change(function(){
inputSelf.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
return true;
});
// Click Handler
aLink.click(function(){
if($input.attr('disabled')){return false;}
$input.trigger('click').trigger('change');
// uncheck all others of same name input radio elements
$('input[name="'+$input.attr('name')+'"]',inputSelf.form).not($input).each(function(){
$(this).attr('type')=='radio' && $(this).trigger('change');
});
return false;
});
// set the default state
inputSelf.checked && aLink.addClass('jqTransformChecked');
});
};
/***************************
TextArea
***************************/
$.fn.jqTransTextarea = function(){
return this.each(function(){
var textarea = $(this);
if(textarea.hasClass('jqtransformdone') || textarea.hasClass('nojq')) {return;}
textarea.addClass('jqtransformdone');
oLabel = jqTransformGetLabel(textarea);
oLabel && oLabel.click(function(){textarea.focus();});
textarea.addClass("jqTransformTextarea").wrap('
');
var $wrapper = textarea.parent().parent().parent();
if (textarea.hasClass("fullWidth")) {
$wrapper.css("width", "100%");
textarea.css("width",$wrapper.width() - 20);
}
else {
$wrapper.css("width", textarea.width()+10);
}
textarea
.focus(function(){$wrapper.addClass("jqTransformTextareaWrapper_focus");})
.blur(function(){$wrapper.removeClass("jqTransformTextareaWrapper_focus");})
.hover(function(){$wrapper.addClass("jqTransformTextareaWrapper_hover");},function(){$wrapper.removeClass("jqTransformTextareaWrapper_hover");})
;
/*
var strTable = '
';
strTable +='
';
strTable +='
';
strTable +='
';
strTable +='
';
var oTable = $(strTable)
.insertAfter(textarea)
.hover(function(){
!oTable.hasClass('jqTransformTextarea-focus') && oTable.addClass('jqTransformTextarea-hover');
},function(){
oTable.removeClass('jqTransformTextarea-hover');
})
;
textarea
.focus(function(){oTable.removeClass('jqTransformTextarea-hover').addClass('jqTransformTextarea-focus');})
.blur(function(){oTable.removeClass('jqTransformTextarea-focus');})
.appendTo($('#jqTransformTextarea-mm div',oTable))
;
this.oTable = oTable;
if($.browser.safari){
$('#jqTransformTextarea-mm',oTable)
.addClass('jqTransformSafariTextarea')
.find('div')
.css('height',textarea.height())
.css('width',textarea.width())
;
}
*/
});
};
/***************************
Select
***************************/
$.fn.jqTransSelect = function(){
return this.each(function(index){
var $select = $(this);
//$select.css('display','none');
//var parentWidth = $select.parent().width();
var parentWidth = $select.width();
//$select.css('display','');
if($select.hasClass('jqTransformHidden')) {return;}
if($select.attr('multiple')) {return;}
var extraClass = ($select.hasClass('noSelectBody')) ? 'noSelectBody' : '';
var newZindex = (10-index > 0) ? 10-index : 1;
var oLabel = jqTransformGetLabel($select);
/* First thing we do is Wrap it */
var $wrapper = $select
.addClass('jqTransformHidden')
.wrap('')
.parent()
.css({zIndex: newZindex})
;
/* Now add the html for the select */
if(typeof formDropdownArrowClass != 'undefined'){
var dropDownIconClass = formDropdownArrowClass;
}else{
var dropDownIconClass = 'icon-angle-down';
}
$wrapper.prepend('
');
//var $ul = $('ul', $wrapper).css('width',parentWidth).hide();
var $ul = $('ul', $wrapper).hide();
/* Now we add the options */
$('option', this).each(function(i){
//var oLi = $('