
 Ajax.call = {}; Ajax.call = Class.create(); Ajax.call.prototype = { call_url: false, parameters: false, options: {}, result: false, loader: false, loading: false, loading_small: false, element: false, callbacks: {}, type: 'ajax', initialize: function(url, parameters, options, prepare) { var exec = false;  if(url) { var execute = this.prepare(url, parameters, options); }
 if(execute && !prepare) { this.exec(); }
 else { return null; }
}, counterCache: { requestCounter: 0 }, prepare: function(url, parameters, options) { this.options = {}; this.parameters = {};   if(!Object.isString(url) && typeof(url) == 'object' && Object.keys(url).length > 0) {  this.parameters = url;  if(typeof(parameters) == 'object' && Object.keys(parameters).length > 0) { this.options = parameters; }
}
 else if(Object.isString(url)) {  this.call_url = url;  if(typeof(parameters) == 'object' && Object.keys(parameters).length > 0) { this.parameters = parameters; }
 if(typeof(options) == 'object' && Object.keys(options).length > 0) { this.options = options; }
}
 else { Debug.out('Ajax.call: first parameter is no valid url or parameter assoc', false, 'warning'); return false; }
 if(!this.call_url && !Object.isUndefined($call_url)) { this.call_url = $call_url; }
else if(!this.call_url) { this.call_url = '/'; }
return this; }, exec: function() { if(this.loading == true) { Debug.out('Ajax.call: call is working'); return false; }
 this.loading = true;  this.parse_options();  var parameters = ''; if(this.parameters) { parameters = Object.toQueryString(this.parameters); }
 if(this.loader) { this.loader.show(); }
 if(this.loader_small) { this.loader_small.show(); }
 if(!Object.isUndefined(this.options.disable)) { var element = document.body; if(Object.isString(this.options.disable)) { element = this.options.disable; }
var options = { visible:true, color: '#000', fullscreen: true }; if(!Object.isUndefined(this.options.disable_options)) { options = this.options.disable_options; }
Element.disable(element, options); delete element; delete options; }
 if(Object.isFunction(this.options.load)) { this.options.load.bind(this)(); }
 var method = 'post'; if(!Object.isUndefined(this.options.method)) { method = this.options.method; }
 else if(this.call_url.match(/\.(\D+)$/) && !this.call_url.match(/\.php$/)) { method = 'get'; }
 this.counterCache.requestCounter++;  new Ajax.Request(  this.call_url,  {  parameters: parameters,  method: method,  onSuccess: function(res)  {  this.counterCache.requestCounter--;      if(this.counterCache.requestCounter <= 0)  {  this.counterCache.requestCounter = 0;    if(this.loader)  {  this.loader.hide();  }
 if(this.loader_small)  {  this.loader_small.hide();  }
   if(!Object.isUndefined(this.options.disable))  {  Element.enable.defer(document.body);  }
 }
   this.result = res;    this.loading = false;    if(Object.isFunction(this.options.success))  {  this.options.success.bind(this)(this.get_result(), this.get_json(), this.get_xml());  }
   var target = false;  switch(this.options.target)  {  case 'top':  case 'before':  case 'after':  case 'bottom':  target = this.options.target;  break;  case 'replace':  target = this.options.target;  break;  default:  target = true;  break;  }
   if(this.options.element &&  $(this.options.element))  {  this.element = this.options.element;  }
 else if(this.options.element)  {  Debug.out('Ajax.call: content insertion failed. element not found in DOM', false, 'warning');  }
   if(target &&  this.element &&  this.get_result())  {  if(Object.isString(target) &&  target == 'replace')  {  var dummy = '<div id="insert_dummy" style="display:none;"></div>';  Element.insert(this.element, {after: dummy});  Element.remove(this.element);  Element.insert('insert_dummy', {after: this.get_result()});  Element.remove('insert_dummy');  delete param, dummy;  }
   else if(Object.isString(target))  {  var param = {};  param[target] = this.get_result();  Element.insert(this.element, param);  delete param;  }
   else  {  Element.update(this.element, this.get_result());  }
 }
 delete target;    if(Object.isFunction(this.options.complete))  {  this.options.complete.bind(this)(this.get_result());  }
 }.bind(this),  onFailure: function(res)  {  this.counterCache.requestCounter--;      if(this.counterCache.requestCounter <= 0)  {  this.counterCache.requestCounter = 0;    if(this.loader)  {  this.loader.hide();  }
 if(this.loader_small)  {  this.loader_small.hide();  }
   if(!Object.isUndefined(this.options.disable))  {  Element.enable.defer(document.body);  }
 }
   this.loading = false;    switch(res.status)  {  case 401:  if(Object.isFunction(this.options.sessionTimeout))  {  this.options.sessionTimeout.bind(this)();  }
 break;  default:  if(Object.isFunction(this.options.fail))  {  this.options.fail.bind(this, res.responseText)();  }
 break;  }
      if(Core.ptDialog)  {  var message = '<div class="error-box"><div class="text"><h1>Ajax.call</h1><span>Execution failed - ('+res.status+') '+res.statusText+'</span><br /><button class="button-reset" id="closeError"><stron>Ok</strong></button><br /><br /></div></div>';  Core.ptDialog.buildDialog(message, 'systemError');  }
 else  {  Debug.out('Ajax.call: Execution failed - ('+res.status+') '+res.statusText, false, 'error');  }
 this.result = res;  }.bind(this)  }
 ); }, recall: function(url, parameters, options) { if(url) { this.call_url = url; }
if(parameters) { this.parameters = parameters; }
if(options) { this.options = options; }
this.exec(); return true; }, parse_options: function() { if(this.options) {  if(Object.isString(this.options.loader) && !Object.isUndefined(Loader)) { if(this.loader) { this.loader.hide(); }
 if(this.loader) { this.loader.setEffects(true); this.loader.setTimer(1); }
}
 if(Object.isString(this.options.loader_small) && !Object.isUndefined(Loader)) { if(this.loader_small) { this.loader_small.hide(); }
 }
 else if(Object.isString(this.options.loader) && Object.isUndefined(Loader)) { Debug.out('Ajax.call: Loader class is not defined. s7Loader.js is required for loader option.', false, 'warning'); }
 if(Object.isString(this.options.call_url)) { this.call_url = this.options.call_url; }
}
}, get_status: function() { if(this.result.status) { var result = {  status: this.result.status,  info: this.result.statusText  }; return result; }
return null; }, get_json: function() { if(this.result.responseJSON) { return this.result.responseJSON; }
else if(this.result.responseText.isJSON()) { return this.result.responseText.evalJSON(); }
return null; }, set_result: function(result) { if(result) { this.result.responseText = result; return true; }
return false; }, get_result: function() { if(this.result.responseText) { return this.result.responseText; }
return null; }, get_xml: function() { if(this.result.responseXML) { return this.result.responseXML; }
return null; }, set_options: function(options) { if(typeof(options) == 'object' && Object.keys(options).length > 0) { this.options = options; return true; }
return false; }, set_call_url: function(call_url) { if(Object.isString(call_url)) { this.call_url = call_url; return true; }
return false; }, add_parameter: function(key, value) { if(Object.isString(key) && Object.isString(value)) { this.parameters[key] = value; }
}, get_parameter: function(key) { if(!Object.isUndefined(this.parameters[key])) { return this.parameters[key]; }
}, remove_parameter: function(key) { if(Object.isString(key)) { delete this.parameters[key]; }
}, add_option: function(key, value) { if(Object.isString(key) && value) { this.options[key] = value; }
}, get_option: function(key) { if(!Object.isUndefined(this.options[key])) { return this.options[key]; }
}, remove_option: function(key) { if(Object.isString(key)) { delete this.options[key]; }
}
}

 var Core = {}; var initWait = []; var firsLoad = true; function firstInit(func) { if(firsLoad) { initWait.push(func); if(!Core.init) { Core = new ptCore(); }
Core.init(initWait); firsLoad = false; }
else { Core.init(func); }
}
var ptCore = {}; ptCore = Class.create(); ptCore.prototype = { cache: { partialDebug: false, debugCounter: 1, partials: [], showEvent: [], stopEvent: [] }, loader: {}, loader_small: {}, wrapper: {}, initClasses: [], initialize: function() { if(Prototype.Browser.Gecko) { Debug.on = true; }
this.wrapper = $('wrapper'); }, init: function(newClass) { if (Core) { try { if (Object.isArray(newClass)) { newClass.each(  function(value)  {  if (!Array.in_array(value, this.initClasses))  {  eval('Core.' + value + ' = new ' + value + '();');  this.initClasses.push(value);  }
 }.bind(this)  ); }
else { if (!Array.in_array(newClass, this.initClasses)) { eval('Core.' + newClass + ' = new ' + newClass + '();'); this.initClasses.push(newClass); }
}
}
catch (err) { Debug.out('Error in: ' + newClass); Debug.out(err.stack); }
}
}
}; Core = new ptCore();
 self.ptService = {}; self.ptService = Class.create(); self.ptService.prototype = { config: { }, cache: { stack: [] }, initialize: function() { }, add: function(namespace, className, method, param, callback) {  if(!this.cache.stack[namespace]) { this.cache.stack[namespace] = []; }
 if(typeof(callback) == 'undefined') { var callback = "Core.ptService.exec('"+namespace+"');"; }
 var stackObject = {  'className': className,  'method': method,  'param': param,  'callback': callback  }; this.cache.stack[namespace].push(stackObject); }, exec: function(namespace) { if(this.cache.stack[namespace]) { var stackObject = this.cache.stack[namespace].shift(); if(stackObject) { this.call(stackObject.className, stackObject.method, stackObject.param, stackObject.callback); }
}
}, call: function(classPath, method, param, callback, secondTry) { try { var className = classPath;  if(className.search('/') != -1) { var className = className.split('/').pop(); }
  if(Array.in_array(className, Object.keys(Core))) { var classObject = eval('Core.'+className);   if(Array.in_array(method, Object.keys(classObject))) { if(typeof(param) != 'undefined' && typeof(param) != null) { var paramString = Core.ptService.prepareParam(param); eval('Core.'+className+'.'+method+'('+paramString+');'); }
else { eval('Core.'+className+'.'+method+'();'); }
 eval(callback); }
else if(typeof(method) != 'undefined') { throw 'Method "'+method+'" not found.'; }
}
 else if(typeof(secondTry) == 'undefined') { this.loadClass(classPath, method, param, callback); }
else if(secondTry == 'loaded') { Core.ptService.call.bind(this, classPath, method, param, callback, 'error').delay(0.5); }
else { throw 'Class "'+className+'" not found.'; }
}
catch(e) { Debug.out('Service Error:', 'console_only', 'warning'); Debug.out(e, 'console_only', 'warning'); if(e.stack) { Debug.out(e.stack, 'console_only', 'warning'); }
 return false; }
return true; }, prepareParam: function(param) { var paramString = []; for(var i = 0; i < param.length; i++) { paramString.push('param['+i+']'); }
return paramString.join(', '); }, loadClass: function(classPath, method, param, callback) { new Ajax.call(  '/js/'+classPath+'.js',  null,  {  success: function(text, json)  {  eval(text);  },  complete: function()  {  Core.ptService.call.defer(classPath, method, param, callback, 'loaded');  }.bind(this)  }
 ); }
}; firstInit('ptService');
 self.ptCall = {}; self.ptCall = Class.create(); self.ptCall.prototype = { initialize: function(){}, config: { selector: '.pt_js_call', defaultCallOptions: ['ptForm'], loader: false, loader_small: false, backgroundDisable: {  visible: false,  transparency: 0.0,  color: '#000',  zindex: 50000  }
}, cache: { openError: false, scripts: '', callEvent: [], callElements: [], callbacks: '' }, initialize: function() { this.startListener(); }, call: function(link, param, callback) {  if(Object.isUndefined(param) || param == null || Object.keys(param).length <= 0) { var param = {}; var method = 'get'; }
else { var method = 'post'; }
 this.buildCall(link, callback, param, method); }, deactivateLoader: function() { this.config.loader = false; }, activateLoader: function() { this.config.loader = 'preloader'; }, buildCall: function(link, callback, param, method) {  if(link.search(/\?/) == -1) { link = link+'?ie_timestamp='+new Date().getTime(); }
else { link = link+'&ie_timestamp='+new Date().getTime(); }
new Ajax.call(  link,  param,  {  loader: this.config.loader,  loader_small: this.config.loader_small,  disable: true,  method: method,  disable_options: this.config.backgroundDisable,  success: function(text, json)  {  this.prepareContent(json, text, callback);  }.bind(this),  sessionTimeout: function()  {  window.location.href = "/";  }
 }
 ); if (this.cache.loader == false) { this.activateLoader(); }
}, prepareContent: function(json, text, callback) { if(json) { this.stopListener();  if(json.data) {  json.data.each(  function(dataObject)  {  if(dataObject.select)  {  $$(dataObject.select).each(   function(domElement)   {   this.prepareInsert(domElement, dataObject);   }.bind(this)   );  }
 else  {  this.prepareInsert(document.body, dataObject);  }
 }.bind(this)  ); }
 if(json.jbst) { json.jbst.each(  function(dataObject)  {  var data = false;  if(dataObject.data)  {  var data = dataObject.data;  }
 var template = false;  if(dataObject.data)  {  var template = dataObject.template;  }
 var config = false;  if(dataObject.config)  {  var config = dataObject.config;  }
 Core.ptJbst.start(data, template, config);  }
 ); }
 eval(callback);  this.startListener(); }
else { Debug.out(text, 'console_only', 'warning'); }
}, prepareInsert: function(domElement, dataObject) { switch(dataObject.action) { case 'top': case 'bottom': case 'after': case 'before': eval('domElement.insert({'+dataObject.action+': dataObject.content});'); this.executeCallback(dataObject.callback); break; case 'update': domElement.update(dataObject.content); this.executeCallback(dataObject.callback); break; case 'replace': domElement.replace(dataObject.content); this.executeCallback(dataObject.callback); break; case 'overlay': Core.ptService.call('ptOverlay', 'buildOverlay', [dataObject.content, true, 'big', dataObject.callback]); break;  case 'bigoverlay': Core.ptService.call('ptOverlay', 'buildOverlay', [dataObject.content, true, 'bigger', dataObject.callback]); break;  case 'overlayReplace': Core.ptService.add('overlay', 'ptOverlay', 'removeOverlay'); Core.ptService.add('overlay', 'ptOverlay', 'buildOverlay', [dataObject.content, true, dataObject.callback]); Core.ptService.exec('overlay'); break; case 'overlayRemove': Core.ptService.call('ptOverlay', 'removeOverlay'); this.executeCallback(dataObject.callback); break;  case 'message': case 'dialog': Core.ptService.call('ptDialog', 'create', [dataObject.content]); this.executeCallback(dataObject.callback); break;  case 'attribute': Element.writeAttribute(domElement, dataObject.type, dataObject.content); this.executeCallback(dataObject.callback); break; }
}, executeCallback:function(callback) { if(typeof(callback) != 'undefined') { eval(callback); }
}, startListener: function() { this.stopListener(); this.cache.callElements = $$(this.config.selector); this.cache.callElements.each(  function(value, key)  {  this.cache.callEvent[key] = this.prepareCall.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.callEvent[key]);  }.bind(this)  ); }, stopListener: function() { this.cache.callElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.callEvent[key]);  }.bind(this)  ); }, prepareCall: function(event, clickedElement) { var link = Element.readAttribute(clickedElement, 'href');  var options = Element.readAttribute(clickedElement, 'pt_js_call'); var options = $w(options);  options.push(this.config.defaultCallOptions); var options = options.flatten(); var options = options.uniq(); var param = this.prepareParam(options, clickedElement); if(link) { this.call(link, param); }
else if(param.action) { this.call(param.action, param); }
}, prepareParam: function(options, clickedElement) { var param = {}; options.each(  function(value)  {  try  {   if (value.search('::') != -1)  {  var splitted = value.split('::');  eval('var newParam = Core.'+splitted[0]+'.getAsParam(\''+clickedElement.identify()+'\', \''+splitted[1]+'\');');  }
 else  {  eval('var newParam = Core.'+value+'.getAsParam(\''+clickedElement.identify()+'\');');  }
 Object.extend(param, newParam);  }
 catch(e)  {  Debug.out('Die Klasse "'+value+'" unterstuetzt die Funktion "getAsParam" nicht!', 'console_only', 'warning');  Debug.out(e, 'console_only', 'warning');  }
 }
 ); return param; }
}; firstInit('ptCall');
 self.ptForm = {}; self.ptForm = Class.create(); self.ptForm.prototype = { config: { }, cache: { inputFields: [], inputFieldsEvent: [] }, initialize: function() { }, start: function() { if($('formBoxForm')) { this.stopListener(); this.startListener(); }
}, startListener: function() {  this.cache.inputFields = Form.getElements('formBoxForm'); this.cache.inputFields.each(  function(field, key)  {  if (field.tagName == 'INPUT')  {  var type = 'text';  }
 else if (field.tagName == 'TEXTAREA')  {  var type = 'textarea';  }
 switch(type)  {  case 'text':  var elementId = field.id;  this.cache.inputFieldsEvent[key] = this.copyText.bindAsEventListener(this, elementId);  Event.observe(field, 'keyup', this.cache.inputFieldsEvent[key]);  break;   case 'textarea':  var elementId = field.id;  this.cache.inputFieldsEvent[key] = this.copyTextarea.bindAsEventListener(this, elementId);  Event.observe(field, 'keyup', this.cache.inputFieldsEvent[key]);  break;  }
 }.bind(this)  ); }, stopListener: function() { this.cache.inputFields.each(  function(field, key)  {  Event.observe(field, 'keyup', this.cache.inputFieldsEvent[key]);  }.bind(this)  ); }, copyTextarea: function(event, elementId) { if($(elementId+'_preview')) { var content = $(elementId).value; var content = content.replace(/(\r\n)|(\n\r)|\r|\n/g, '<br />'); $(elementId+'_preview').innerHTML = content; }
}, copyText: function(event, elementId) { if($(elementId+'_preview')) { var content = $(elementId).value; $(elementId+'_preview').innerHTML = content; }
}, getAsParam: function(clickedElement, formId) { var formContentObject = {};   try { if(tinyMCE) { tinyMCE.triggerSave(); }
}
catch(e) { }
  if(Core.ptCheckbox) { var checkboxContent = Core.ptCheckbox.getCheckedAsParam(); Object.extend(formContentObject, checkboxContent); }
  if(Core.ptRadio) { var radioContent = Core.ptRadio.getCheckedAsParam(); Object.extend(formContentObject, radioContent); }
  if($(clickedElement)) { if(typeof(formId) != 'undefined' && $(formId)) { var formElement = formId; }
else { var formElement = $(clickedElement).up('form'); }
if(formElement) { var formContent = Form.serialize(formElement, true); Object.extend(formContentObject, formContent); }
}
 return formContentObject; }
}; firstInit('ptForm');
 self.ptAccordion = {}; self.ptAccordion = Class.create(); self.ptAccordion.prototype = { config: { accordionContainerElement: '.pt_js_accordion_wrapper', accordionToggleAllElement: '.pt_js_accordion_all', accordionSingleElement: '.pt_js_accordion_element', accordionClickElement: '.pt_js_accordion_click', accordionContentElement: '.pt_js_accordion_content', accordionActiveClass: 'pt_acc_active', accordionCollapseAllElement: '.pt_js_accordion_collapseall', accordionArrowElement: '.pt_js_accordion_arrow', upArrow: 'bcom_arrow_top', downArrow: 'bcom_arrow_bottom' }, cache: { accordions: [], allElements: [], allElements2: [], allEvent: [], singleElements: [], singleEvent: [] }, initialize: function() { this.start(); }, start: function() { this.stopListener(); this.startListener(); $$('.' + this.config.accordionActiveClass).each( function( element ) {  uel = element.up();  if( uel ) el = Element.select( $(uel), '.pt_js_accordion_content' );  if( el ) Element.show( el.first() ); }
); }, stopListener: function() { this.cache.accordions = $$(this.config.accordionContainerElement); this.cache.accordions.each(  function(containerElement, containerKey)  {    if(this.cache.allElements[containerKey])  {  this.cache.allElements[containerKey].each(   function(allElement, allKey)   {   Event.stopObserving(allElement, 'click', this.cache.allEvent['1'+containerKey+''+allKey]);   }.bind(this)   );  }
 if(this.cache.singleElements[containerKey])  {    this.cache.singleElements[containerKey].each(    function(singleElement, singleKey)    {    var clickedElement = Element.select(singleElement, this.config.accordionClickElement).first();    Event.stopObserving(clickedElement, 'click', this.cache.singleEvent['2'+containerKey+''+singleKey]);    }.bind(this)   );  }
 }.bind(this)  ); }, startListener: function() { this.cache.accordions = $$('.pt_js_accordion_wrapper'); this.cache.accordions.each(  function(containerElement, containerKey)  {    this.cache.allElements[containerKey] = Element.select(containerElement, this.config.accordionToggleAllElement);  this.cache.allElements[containerKey].each(   function(allElement, allKey)   {   this.cache.allEvent['1'+containerKey+''+allKey] = this.toggleAll.bindAsEventListener(this, containerElement, allElement);   Event.observe(allElement, 'click', this.cache.allEvent['1'+containerKey+''+allKey]);   }.bind(this)   );    this.cache.allElements2[containerKey] = Element.select(containerElement, this.config.accordionCollapseAllElement);  this.cache.allElements2[containerKey].each(   function(allElement, allKey)   {   this.cache.allEvent['3'+containerKey+''+allKey] = this.collapseAll.bindAsEventListener(this, containerElement, allElement);   Event.observe(allElement, 'click', this.cache.allEvent['3'+containerKey+''+allKey]);   }.bind(this)   );    this.cache.singleElements[containerKey] = Element.select(containerElement, this.config.accordionSingleElement);  this.cache.singleElements[containerKey].each(    function(singleElement, singleKey)    {    var clickedElement = Element.select(singleElement, this.config.accordionClickElement).first();    if(clickedElement)    {    this.cache.singleEvent['2'+containerKey+''+singleKey] = this.toggleSingle.bindAsEventListener(this, clickedElement, singleElement);    Event.observe(clickedElement, 'click', this.cache.singleEvent['2'+containerKey+''+singleKey]);    }
   }.bind(this)   );  }.bind(this)  ); }, toggleAll: function(event, containerElement, allElement) {  var contentElements = Element.select(containerElement, this.config.accordionContentElement); contentElements.each(  function(value)  {  Element.show(value);  }
 );  var clickElements = Element.select(containerElement, this.config.accordionClickElement); clickElements.each(  function(value)  {  if(Element.hasClassName(value, this.config.accordionActiveClass))  {  Element.removeClassName(value, this.config.accordionActiveClass);  }
 }
 ); }, collapseAll: function(event, containerElement, allElement) { var contentElements = Element.select(containerElement, this.config.accordionContentElement); contentElements.each(  function(value)  {  Element.hide(value);  }
 );  var clickElements = Element.select(containerElement, this.config.accordionArrowElement); clickElements.each(  function(value)  {  if(Element.hasClassName(value, this.config.upArrow))  {  Element.removeClassName(value, this.config.upArrow);  }
 Element.addClassName(value, this.config.downArrow);  }.bind(this)  ); }, toggleSingle: function(event, clickedElement, singleElement) {  if(Element.select(singleElement, this.config.accordionContentElement).first()) { Element.toggle(Element.select(singleElement, this.config.accordionContentElement).first()); }
 if(Element.hasClassName(clickedElement, this.config.accordionActiveClass)) { Element.removeClassName(clickedElement, this.config.accordionActiveClass); }
else { Element.addClassName(clickedElement, this.config.accordionActiveClass); }
}
}; firstInit('ptAccordion');
 self.ptAccordionProfile = {}; self.ptAccordionProfile = Class.create(); self.ptAccordionProfile.prototype = { config: { }, cache: { clickable: [], toggleAll: [], wrapper: [], clickEvent: [] }, initialize: function() { this.start(); }, start: function() { this.startListener(); }, startListener: function() { this.cache.wrapper = $$('.bcom_js_accordion_profile_wrapper'); this.cache.wrapper.each(  function(value, key)  {   this.cache.clickable[key] = Element.select(value, 'a.bcom_js_accordion_profile_click');  this.cache.clickable[key].each(   function(clickedElement, clickKey)   {   this.cache.clickEvent['1'+key+''+clickKey] = this.toggleSingle.bindAsEventListener(this, clickedElement, clickedElement.up('tr').next('.bcom_js_accordion_profile_content'));   Event.observe(clickedElement, 'click', this.cache.clickEvent['1'+key+''+clickKey]);   }.bind(this)   );   this.cache.toggleAll = Element.select(value, 'a.bcom_js_accordion_profile_all');  this.cache.toggleAll.each(   function(clickedElement, clickKey)   {   Event.observe(clickedElement, 'click', this.toggleAll.bindAsEventListener(this, clickedElement.up('tbody'), clickedElement));   }.bind(this)   );  }.bind(this)  ); }, toggleAll: function(event, containerElement, allElement) { Element.select(containerElement, '.bcom_js_accordion_profile_content').invoke('show'); }, toggleSingle: function(event, clickedElement, singleElement) { Element.toggle(singleElement); }
}; firstInit('ptAccordionProfile');
 self.ptSlider = {}; self.ptSlider = Class.create(); self.ptSlider.prototype = { config: { sliderContainerClass: '.pt_js_boxSlider_container', sliderLeftButtonClass: '.pt_js_boxSlider_left', sliderRightButtonClass: '.pt_js_boxSlider_right', sliderContentClass: '.pt_js_boxSlider_content', sliderPageCounterClass: '.pt_js_boxSlider_pageCount', sliderActualContentClass: 'pt_js_boxSlider_content_actual', carousel: true }, cache: { sliderEvent: [], slider: [] }, initialize: function() { this.start(); }, start: function() { this.cache.slider = $$(this.config.sliderContainerClass); this.prepareSlider(); this.stopListener(); this.startListener(); }, prepareSlider: function() { this.cache.slider.each(  function(value, key)  {  var contentElements = Element.select(value, this.config.sliderContentClass);  contentElements.each(   function(value)   {   if(Element.visible(value))   {   Element.addClassName(value, this.config.sliderActualContentClass);   }
  }.bind(this)   );  this.updatePageCount(value);  }.bind(this)  ); }, startListener: function() { this.cache.slider.each(  function(value, key)  {  var leftButton = Element.select(value, this.config.sliderLeftButtonClass).first();  if(leftButton)  {  this.cache.sliderEvent[key] = this.previousText.bindAsEventListener(this, value);  Event.observe(leftButton, 'click', this.cache.sliderEvent[key]);  }
 var rightButton = Element.select(value, this.config.sliderRightButtonClass).first();  if(rightButton)  {  this.cache.sliderEvent['1'+key] = this.nextText.bindAsEventListener(this, value);  Event.observe(rightButton, 'click', this.cache.sliderEvent['1'+key]);  }
 }.bind(this)  ); }, stopListener: function() { this.cache.slider.each(  function(value, key)  {  var leftButton = Element.select(value, this.config.sliderLeftButtonClass).first();  if(leftButton)  {  Event.stopObserving(leftButton, 'click', this.cache.sliderEvent[key]);  }
 var rightButton = Element.select(value, this.config.sliderRightButtonClass).first();  if(rightButton)  {  Event.stopObserving(rightButton, 'click', this.cache.sliderEvent['1'+key]);  }
 }.bind(this)  ); }, previousText: function(event, container) { var content = Element.select(container, '.'+this.config.sliderActualContentClass).first(); var previous = content.previous(this.config.sliderContentClass);  if(previous) { Element.hide(content); Element.removeClassName(content, this.config.sliderActualContentClass); Element.show(previous); Element.addClassName(previous, this.config.sliderActualContentClass); }
 else if(this.config.carousel == true) { Element.hide(content); Element.removeClassName(content, this.config.sliderActualContentClass); var content = Element.select(container, this.config.sliderContentClass).last(); Element.show(content); Element.addClassName(content, this.config.sliderActualContentClass); }
this.updatePageCount(container); }, nextText: function(event, container) { var content = Element.select(container, '.'+this.config.sliderActualContentClass).first(); var next = content.next(this.config.sliderContentClass);  if(next) { Element.hide(content); Element.removeClassName(content, this.config.sliderActualContentClass); Element.show(next); Element.addClassName(next, this.config.sliderActualContentClass); }
 else if(this.config.carousel == true) { Element.hide(content); Element.removeClassName(content, this.config.sliderActualContentClass); var content = Element.select(container, this.config.sliderContentClass).first(); Element.show(content); Element.addClassName(content, this.config.sliderActualContentClass); }
this.updatePageCount(container); }, updatePageCount:function(sliderElement) { var contentElements = Element.select(sliderElement, this.config.sliderContentClass); var actualPage = this.getActualPageCount(contentElements); var pageCounter = Element.select(sliderElement, this.config.sliderPageCounterClass).first(); if(pageCounter) { Element.update(pageCounter, (actualPage+1)+'/'+contentElements.length); }
}, getActualPageCount: function(contentElements) { this.cache.actual = false; contentElements.each(  function(value, key)  {  if(Element.hasClassName(value, this.config.sliderActualContentClass))  {  this.cache.actual = key;  }
 }.bind(this)  ); return this.cache.actual; }
}; firstInit('ptSlider');
 self.ptSwing = {}; self.ptSwing = Class.create(); self.ptSwing.prototype = { config: { swingSelector: '.pt_js_swing, .pt_js_swing_hover, .pt_js_swing_hover_teaser, .pt_js_swing_click', swingContainerSelector: '.pt_js_swing_container', swingHoverClass: 'pt_js_swing_hover', swingHoverTeaserClass: 'pt_js_swing_hover_teaser', swingClickClass: 'pt_js_swing_click', swingActiveClass: 'tui_active', swingEffect: true }, cache: { swingElements: [], swingEventClick: [], swingEventOver: [], swingEventOut: [] }, initialize: function() { this.start(); }, start: function() { this.stopListener(); this.startListener(); }, startListener: function() { this.cache.swingElements = $$(this.config.swingSelector); this.cache.swingElements.each(  function(value, key)  {  if(Element.hasClassName(value, this.config.swingHoverTeaserClass))  {  this.cache.swingEventOver[key] = this.show.bindAsEventListener(this, value, key);  Event.observe(value, 'mouseover', this.cache.swingEventOver[key]);  }
 else if(Element.hasClassName(value, this.config.swingClickClass))  {  this.cache.swingEventOver[key] = this.showClick.bindAsEventListener(this, value, key);  Event.observe(value, 'click', this.cache.swingEventOver[key]);  }
 else if(Element.hasClassName(value, this.config.swingHoverClass))  {  this.cache.swingEventOver[key] = this.show.bindAsEventListener(this, value, key);  Event.observe(value, 'mouseover', this.cache.swingEventOver[key]);  }
 else  {  var swingEffect = Element.readAttribute(value, 'href');  var swingEffect = new Boolean(swingEffect);  this.cache.swingEventClick[key] = this.toggle.bindAsEventListener(this, value, swingEffect);  Event.observe(value, 'click', this.cache.swingEventClick[key]);  }
 }
.bind(this)  ); }, stopListener: function() { this.cache.swingElements.each(  function(value, key)  {  if(Element.hasClassName(value, this.config.swingHoverClass))  {  Event.stopObserving(value, 'mouseover', this.cache.swingEventOver[key]);  Event.stopObserving(document.body, 'mouseover', this.cache.swingEventOut[key]);  }
 else if(Element.hasClassName(value, this.config.swingHoverTeaserClass))  {  Event.stopObserving(value, 'mouseover', this.cache.swingEventOver[key]);  Event.stopObserving(document.body, 'mouseover', this.cache.swingEventOut[key]);  }
 else  {  Event.stopObserving(value, 'click', this.cache.swingEventClick[key]);  }
 }
.bind(this)  ); }, show: function(event, clickedElement, key) {  $$('.pt_js_swing_hover','.pt_js_swing_hover_teaser' ).each(  function(hoverElement)  {  if(hoverElement != clickedElement)  {  var swingContainer = Element.select($(hoverElement), this.config.swingContainerSelector); if(Element.hasClassName($(hoverElement), this.config.swingActiveClass)) {  Element.removeClassName($(hoverElement), this.config.swingActiveClass); }
 swingContainer.invoke('hide');  }
 }.bind(this)  );  var swingContainer = Element.select($(clickedElement), this.config.swingContainerSelector); swingContainer.each(  function(value)  {  if(!Element.visible(value))  {  this.toggle(event, clickedElement, false);  if( !Element.hasClassName( $(clickedElement), Core.ptSwing.config.swingHoverTeaserClass ) )  {  this.cache.swingEventOut[key] = this.hide.bindAsEventListener(this, clickedElement, key);  Event.observe(document.body, 'mouseover', this.cache.swingEventOut[key]);  }
 }
 }.bind(this)  ); }, showClick: function(event, clickedElement, key) {  $$('.pt_js_swing_click').each(  function(hoverElement)  {  if(hoverElement != clickedElement)  {  var swingContainer = Element.select($(hoverElement), this.config.swingContainerSelector); if(Element.hasClassName($(hoverElement), this.config.swingActiveClass)) {  Element.removeClassName($(hoverElement), this.config.swingActiveClass);  Element.setStyle($(hoverElement), {zIndex: 0}); }
 swingContainer.invoke('hide');  }
 }.bind(this)  );  this.toggle(event, clickedElement, false, true); }, hide: function(event, clickedElement, key) { var swingContainer = Element.select($(clickedElement), this.config.swingContainerSelector); swingContainer.each(  function(value)  {  if(Element.visible(value) &&  !Event.findElement(event, '.'+this.config.swingHoverClass )&&  !Event.findElement(event, '.'+this.config.swingHoverTeaserClass))  {  this.toggle(event, clickedElement, false);  Event.stopObserving(document.body, 'mouseover', this.cache.swingEventOut[key]);  }
 }.bind(this)  ); }, toggle: function(event, clickedElement, effect, swingClick) { if(!Event.element(event).up(this.config.swingContainerSelector)) { var swingContainer = Element.select($(clickedElement), this.config.swingContainerSelector); if(!Element.visible(swingContainer.first()) && Element.hasAttribute(clickedElement, 'href')) { this.cache.clickedElement = clickedElement; Core.ptCall.call(Element.readAttribute(clickedElement, 'href'), null, 'Core.ptSwing.showReload()'); }
else { if(Element.hasAttribute(clickedElement, 'href')) { this.cache.clickedElement = clickedElement; Core.ptCall.call(Element.readAttribute(clickedElement, 'href')); }
if(this.config.swingEffect == true && effect != false) { swingContainer.each(  function(value)  {  this.toggleEffect(value);  }.bind(this)  ); }
else { swingContainer.invoke('toggle'); if(swingClick == true) { Element.setStyle(clickedElement, {zIndex: 2}); }
}
}
Element.toggleClassName(clickedElement, this.config.swingActiveClass); }
else if(swingClick) { var swingContainer = Event.element(event).up(this.config.swingContainerSelector); Element.toggle(swingContainer); }
}, showReload: function() { var swingContainer = Element.select($(this.cache.clickedElement), this.config.swingContainerSelector); if(this.config.swingEffect == true) { swingContainer.each(  function(value)  {  this.toggleEffect(value);  }.bind(this)  ); }
else { swingContainer.invoke('toggle'); }
}, toggleEffect: function(value) { if(Element.visible(value)) { Effect.BlindUp(value, {duration: 0.5}); }
else { Effect.BlindDown(value, {duration: 0.5}); }
}, reopenFooter: function(link, element) { this.cache.clickedElement = $(element); }
}; firstInit('ptSwing');
 self.ptSearch = {}; self.ptSearch = Class.create( { config: { searchFieldId: 'pt_searchSite', searchFieldClass: 'input.pt_js_search_field', searchContainerId: 'pt_searchSite_hidden', searchActiveClass: 'pt_header_search_active', searchCloseButtonId: 'pt_js_search_close', searchDelay: 0.6 }, cache: { searchEvent: [], searchFields: [] }, initialize: function() { this.startListener(); }, startListener: function() { if($(this.config.searchCloseButtonId)) { Event.observe($(this.config.searchCloseButtonId), 'click', this.hide.bindAsEventListener(this)); }
if($(this.config.searchFieldId)) { Event.observe($(this.config.searchFieldId), 'keyup', this.preparesearch.bindAsEventListener(this, $(this.config.searchFieldId))); }
this.stopListener(); this.cache.searchFields = $$(this.config.searchFieldClass); this.cache.searchFields.each(  function(value, key )  {  this.cache.searchEvent[key] = this.preparesearch.bindAsEventListener(this, value);  Event.observe(value, 'keyup', this.cache.searchEvent[key]);  }.bind(this)  ); }, stopListener: function() { this.cache.searchFields.each(  function(value, key)  {  Event.stopObserving(value, 'keyup', this.cache.searchEvent[key]);  }.bind(this)  ); }, preparesearch: function(event, searchField) { if (((event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == Event.KEY_BACKSPACE || event.keyCode == Event.KEY_RETURN || event.keyCode == Event.KEY_DELETE || event.keyCode == 16 || event.keyCode == 17 || event.keyCode == 18)) { if(searchField.value.length == 0) { Element.hide($(this.config.searchContainerId)); if(this.searchTimer) { clearTimeout(this.searchTimer); }
if( !searchField.hasClassName( 'pt_js_search_field' )) { return; }
}
if(this.searchTimer) { clearTimeout(this.searchTimer); }
var timeout = this.config.searchDelay; if( searchField.hasClassName( 'pt_js_search_field' )) { timeout = 5; if( event.keyCode == Event.KEY_RETURN ) timeout = 0.01; }
this.searchTimer = this.search.bind(this, searchField).delay(timeout); }
}, search: function(searchField) { var link = Element.readAttribute(searchField, 'href'); if( searchField.hasClassName( 'pt_js_search_field' )) { Core.ptCall.prepareCall('', searchField ); }
else { Core.ptCall.call(link, {search: searchField.value}); }
}, show: function() { Element.show($(this.config.searchContainerId)); var searchContainer = $(this.config.searchContainerId).up('div.pt_header_search'); if(!Element.hasClassName(searchContainer, this.config.searchActiveClass)) { Element.addClassName(searchContainer, this.config.searchActiveClass); }
}, hide: function(event) { Element.hide($(this.config.searchContainerId)); var searchContainer = $(this.config.searchContainerId).up('div.pt_header_search'); if(Element.hasClassName(searchContainer, this.config.searchActiveClass)) { Element.removeClassName(searchContainer, this.config.searchActiveClass); }
}
}
); firstInit('ptSearch');
 self.ptJbst = {}; self.ptJbst = Class.create( { initialize: function() {}, config: { swingEffect: true }, cache: { template: [], data: [], parsedTemplate: '', functionElements: [], functionEvents: [], jbstContainer: [], dropdownEvents: [], dropdownElements: [] }, start: function(data, template, config) {  var jbstName = config.name; if(jbstName) { var callback = "Core.ptJbst.startListener('"+jbstName+"');" +  "Core.ptJbst.openJbst('"+jbstName+"');"; Core.ptService.add('jbst', 'jbst/ptJbstConfig', 'set', [jbstName, config]); Core.ptService.add('jbst', 'jbst/ptJbstData', 'initData', [jbstName, data]); Core.ptService.add('jbst', 'jbst/ptJbstTemplate', 'set', [jbstName, template], callback); Core.ptService.exec('jbst'); }
}, openJbst: function(jbstName) { var config = Core.ptJbstConfig.get(jbstName);  if(config.open == true) { if(this.config.swingEffect == true) { $$('.pt_js_jbst_'+jbstName+'_wrapper').each(   function(value)   {   if(Element.visible(value))   {   Effect.BlindUp(value);   }
  else   {   Effect.BlindDown(value);   }
  }
  ); }
else { $$('.pt_js_jbst_'+jbstName+'_wrapper').invoke('show'); }
}
}, startListener: function(jbstName) { this.stopListener(jbstName); this.cache.functionElements[jbstName] = $$(   '.pt_js_jbst_'+jbstName+'_sort',   '.pt_js_jbst_'+jbstName+'_order',   '.pt_js_jbst_'+jbstName+'_pageCounter',   '.pt_js_jbst_'+jbstName+'_filter',   '.pt_js_jbst_'+jbstName+'_filter_radio',   '.pt_js_jbst_'+jbstName+'_search',   '.pt_js_jbst_'+jbstName+'_pagination_left',   '.pt_js_jbst_'+jbstName+'_pagination_right',   '.pt_js_jbst_'+jbstName+'_pagination_direct',   '.pt_js_jbst_'+jbstName+'_container'  ); this.cache.functionEvents[jbstName] = []; this.cache.functionElements[jbstName].each(   function(value, key)   {   if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_sort') ||   Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_order'))   {     if(value.tagName == 'SELECT')   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.sortSelect.bindAsEventListener(this, jbstName, value);   Event.observe(value, 'change', this.cache.functionEvents[jbstName][key]);   }
    else   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.sortButton.bindAsEventListener(this, jbstName, value);   Event.observe(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pageCounter'))   {     if(value.tagName == 'SELECT')   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.pageCountSelect.bindAsEventListener(this, jbstName, value);   Event.observe(value, 'change', this.cache.functionEvents[jbstName][key]);   }
    else   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.pageCountButton.bindAsEventListener(this, jbstName, value);   Event.observe(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_search'))   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.search.bindAsEventListener(Core.ptJbstData, jbstName, value);   Event.observe(value, 'keyup', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pagination_left'))   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.pagination.bindAsEventListener(this, jbstName, value, 'left');   Event.observe(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pagination_right'))   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.pagination.bindAsEventListener(this, jbstName, value, 'right');   Event.observe(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_filter_radio'))   {   this.cache.functionEvents[jbstName][key] = Core.ptJbstData.filterRadio.bindAsEventListener(this, jbstName, value);   Event.observe(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_container'))   {   this.cache.jbstContainer[jbstName] = value;   this.update(jbstName);   }
  }.bind(this)  ); }, stopListener: function(jbstName) { if(this.cache.functionElements[jbstName]) { this.cache.functionElements[jbstName].each(   function(value, key)   {   if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_sort'))   {   Event.stopObserving(value, 'change', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_order'))   {   Event.stopObserving(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pageCounter'))   {   Event.stopObserving(value, 'click', this.cache.functionEvents[jbstName][key]);   Event.stopObserving(value, 'change', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_search'))   {   Event.stopObserving(value, 'keyup', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pagination_left'))   {   Event.stopObserving(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  else if(Element.hasClassName(value, 'pt_js_jbst_'+jbstName+'_pagination_right'))   {   Event.stopObserving(value, 'click', this.cache.functionEvents[jbstName][key]);   }
  }.bind(this)   ); }
}, update: function(jbstName) { var data = Core.ptJbstData.get(jbstName); var template = Core.ptJbstTemplate.get(jbstName); var config = Core.ptJbstConfig.get(jbstName); var parsedTemplate = this.prepareData(data, template); Element.update(this.cache.jbstContainer[jbstName], parsedTemplate);  var pageCount = $$('.pt_js_jbst_'+jbstName+'_pageCount').first(); if(pageCount) { Element.update(pageCount, Core.ptJbstData.getPageCount(jbstName)); }
 var pageCount = $$('.pt_js_jbst_'+jbstName+'_page').first(); if(pageCount) { Element.update(pageCount, Core.ptJbstData.getPage(jbstName)); }
 var pageSelect = $$('.pt_js_jbst_'+jbstName+'_pagination_direct').first(); if(pageSelect) { Element.update(pageSelect, Core.ptJbstData.getPageSelect(jbstName));  var dropdownElements = Element.select(pageSelect, 'div.pt_js_jbst_dropdown'); var dropdownEvent = Core.ptJbstData.pagination.bindAsEventListener(this, jbstName, pageSelect, 'direct'); this.initDropdown(dropdownElements, dropdownEvent, 0); }
 var pageSelect = $$('.pt_js_jbst_'+jbstName+'_pagination_direct_show').first(); if(pageSelect) { Element.update(pageSelect, 'Seite '+(config.page+1)); }
 var filter = $$('.pt_js_jbst_'+jbstName+'_filter').first(); if(filter) { var dropdownElements = Element.select(filter, 'div.pt_js_jbst_dropdown'); var dropdownEvent = Core.ptJbstData.filter.bindAsEventListener(this, jbstName, filter); this.initDropdown(dropdownElements, dropdownEvent, 1); }
 var filter = $$('.pt_js_jbst_'+jbstName+'_timeFilter').first(); if(filter) { var dropdownElements = Element.select(filter, 'div.pt_js_jbst_dropdown'); var dropdownEvent = Core.ptJbstData.timeFilter.bindAsEventListener(this, jbstName, filter); this.initDropdown(dropdownElements, dropdownEvent, 2); }
if(!config.carousel) { this.checkPagination(jbstName); }
Core.ptCall.startListener();  if(config.callback) { eval(config.callback); }
}, checkPagination:function(jbstName) {  $$('.pt_js_jbst_'+jbstName+'_pagination_left', '.pt_js_jbst_'+jbstName+'_pagination_right').each(   function(value)   {   if(Element.hasClassName(value, 'bcom_slider_buttonPrevInactive'))   {   Element.removeClassName(value, 'bcom_slider_buttonPrevInactive');   }
  else if(Element.hasClassName(value, 'bcom_slider_buttonNextInactive'))   {   Element.removeClassName(value, 'bcom_slider_buttonNextInactive');   }
  }
  ); var config = Core.ptJbstConfig.get(jbstName); var maxPage = Core.ptJbstData.getPageCount(jbstName); var maxPage = Math.floor(maxPage/config.pageCount);  if(config.page == 0) { $$('.pt_js_jbst_'+jbstName+'_pagination_left' ).each(   function(value)   {   if(!Element.hasClassName(value, 'bcom_slider_buttonPrevInactive'))   {   Element.addClassName(value, 'bcom_slider_buttonPrevInactive');   }
  }
  ); }
 if(config.page == maxPage) { $$('.pt_js_jbst_'+jbstName+'_pagination_right' ).each(   function(value)   {   if(!Element.hasClassName(value, 'bcom_slider_buttonNextInactive'))   {   Element.addClassName(value, 'bcom_slider_buttonNextInactive');   }
  }
  ); }
}, initDropdown: function(dropdownElements, dropdownEvent, dropdownKey) {  if(this.cache.dropdownElements[dropdownKey]) { this.cache.dropdownElements[dropdownKey].each(   function(value)   {   Event.stopObserving(value, 'click', this.cache.dropdownEvents[dropdownKey]);   }.bind(this)   ); }
 this.cache.dropdownEvents[dropdownKey] = dropdownEvent; this.cache.dropdownElements[dropdownKey] = dropdownElements;  this.cache.dropdownElements[dropdownKey].each(   function(value)   {   Event.observe(value, 'click', this.cache.dropdownEvents[dropdownKey]);   }.bind(this)   ); }, prepareData: function(data, template) { if(data && template) { var content = ''; data.each(  function(value)  {  content += template.interpolate(value);  }.bind(this)  ); return content; }
}
}); firstInit('ptJbst');
 self.ptTab = {}; self.ptTab = Class.create( { config: { }, cache: { tabWrapper: [], tabClick: [], tabEvent: [] }, initialize: function() { this.start(); }, start: function() { this.cache.tabWrapper = $$('.pt_js_tab_wrapper'); this.cache.tabWrapper.each(  function(value, key)  {  this.cache.tabClick[key] = Element.select(value, '.pt_js_tab_click');  this.cache.tabClick[key].each(   function(clickValue, clickKey)   {   var eventkey = '1'+key+clickKey;   this.cache.tabEvent[eventkey] = this.activateTab.bindAsEventListener(this, value, clickValue, clickKey);   Event.observe(clickValue, 'click', this.cache.tabEvent[eventkey]);   }.bind(this)   );  }.bind(this)  ); }, activateTab: function(event, container, clickValue, clickedKey) { var tabContainer = Element.select(container, '.pt_js_tab_container'); tabContainer.invoke('hide'); Element.show(tabContainer[clickedKey]);  var activeElement = Element.select(container, 'li[class*="_active"]').first(); var activeClass = Element.readAttribute(activeElement, 'pt_js_tab_class'); Element.removeClassName(activeElement, activeClass+'_active'); Element.addClassName(activeElement, activeClass);  var activeClass = Element.readAttribute(clickValue, 'pt_js_tab_class'); Element.removeClassName(clickValue, activeClass); Element.addClassName(clickValue, activeClass+'_active'); }
}); firstInit('ptTab');
 self.ptPoll = {}; self.ptPoll = Class.create( { initialize: function() { this.start(); }, start: function() { $$('.pt_js_formBuilder_page_button').each(   function(value)   {   Event.observe(value, 'click', this.nextPage.bindAsEventListener(this, value));   }.bind(this)   ); }, nextPage: function(event, clickedButton) {  var parentContainer = clickedButton.up('[containerId^="pt_js_formBuilder_preview_page_"]'); var nextContainer = parentContainer.next('[containerId^="pt_js_formBuilder_preview_page_"]');  if(nextContainer) { Element.hide(parentContainer); Element.show(nextContainer);  var paginationButton = Element.select(nextContainer, '.pt_js_formBuilder_page_button').first(); if(!Element.visible(paginationButton)) { Element.show($('pt_js_poll_submit_button')); }
}
}
}); firstInit('ptPoll');
 var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; function ControlVersion() { var version; var axo; var e; try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); version = axo.GetVariable("$version"); }
catch (e) { }
if (!version) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");  version = "WIN 6,0,21,0"; axo.AllowScriptAccess = "always"; version = axo.GetVariable("$version"); }
catch (e) { }
}
if (!version) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = axo.GetVariable("$version"); }
catch (e) { }
}
if (!version) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = "WIN 3,0,18,0"; }
catch (e) { }
}
if (!version) { try { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); version = "WIN 2,0,0,11"; }
catch (e) { version = -1; }
}
return version; }
function GetSwfVer(){ var flashVer = -1; if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; var descArray = flashDescription.split(" "); var tempArrayMajor = descArray[2].split("."); var versionMajor = tempArrayMajor[0]; var versionMinor = tempArrayMajor[1]; var versionRevision = descArray[3]; if (versionRevision == "") { versionRevision = descArray[4]; }
if (versionRevision[0] == "d") { versionRevision = versionRevision.substring(1); }
else if (versionRevision[0] == "r") { versionRevision = versionRevision.substring(1); if (versionRevision.indexOf("d") > 0) { versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); }
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; }
}
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; else if ( isIE && isWin && !isOpera ) { flashVer = ControlVersion(); }
return flashVer; }
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { versionStr = GetSwfVer(); if (versionStr == -1 ) { return false; }
else if (versionStr != 0) { if(isIE && isWin && !isOpera) { tempArray = versionStr.split(" "); tempString = tempArray[1]; versionArray = tempString.split(","); }
else { versionArray = versionStr.split("."); }
var versionMajor = versionArray[0]; var versionMinor = versionArray[1]; var versionRevision = versionArray[2]; if (versionMajor > parseFloat(reqMajorVer)) { return true; }
else if (versionMajor == parseFloat(reqMajorVer)) { if (versionMinor > parseFloat(reqMinorVer)) return true; else if (versionMinor == parseFloat(reqMinorVer)) { if (versionRevision >= parseFloat(reqRevision)) return true; }
}
return false; }
}
function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; }
function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ''; if (isIE && isWin && !isOpera) { str += '<object '; for (var i in objAttrs) { str += i + '="' + objAttrs[i] + '" '; }
str += '>'; for (var i in params) { str += '<param name="' + i + '" value="' + params[i] + '" /> '; }
str += '</object>'; }
else { str += '<embed '; for (var i in embedAttrs) { str += i + '="' + embedAttrs[i] + '" '; }
str += '> </embed>'; }
document.write(str); }
function AC_FL_RunContent(){ var ret = AC_GetArgs ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" , "application/x-shockwave-flash" ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); }
function AC_SW_RunContent(){ var ret = AC_GetArgs ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000" , null ); AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs); }
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){ var ret = new Object(); ret.embedAttrs = new Object(); ret.params = new Object(); ret.objAttrs = new Object(); for (var i=0; i < args.length; i=i+2){ var currArg = args[i].toLowerCase(); switch (currArg){ case "classid": break; case "pluginspage": ret.embedAttrs[args[i]] = args[i+1]; break; case "src": case "movie": args[i+1] = AC_AddExtension(args[i+1], ext); ret.embedAttrs["src"] = args[i+1]; ret.params[srcParamName] = args[i+1]; break; case "onafterupdate": case "onbeforeupdate": case "onblur": case "oncellchange": case "onclick": case "ondblclick": case "ondrag": case "ondragend": case "ondragenter": case "ondragleave": case "ondragover": case "ondrop": case "onfinish": case "onfocus": case "onhelp": case "onmousedown": case "onmouseup": case "onmouseover": case "onmousemove": case "onmouseout": case "onkeypress": case "onkeydown": case "onkeyup": case "onload": case "onlosecapture": case "onpropertychange": case "onreadystatechange": case "onrowsdelete": case "onrowenter": case "onrowexit": case "onrowsinserted": case "onstart": case "onscroll": case "onbeforeeditfocus": case "onactivate": case "onbeforedeactivate": case "ondeactivate": case "type": case "codebase": case "id": ret.objAttrs[args[i]] = args[i+1]; break; case "width": case "height": case "align": case "vspace": case "hspace": case "class": case "title": case "accesskey": case "name": case "tabindex": ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1]; break; default: ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1]; }
}
ret.objAttrs["classid"] = classid; if (mimeType) ret.embedAttrs["type"] = mimeType; return ret; }

 self.ptCalendar = {}; self.ptCalendar = Class.create(); self.ptCalendar.prototype = { config: { dateFormat: 'dd.mm.yyyy', selector: '.pt_js_date' }, cache: { calendarElements: [], calendarEvents: [] }, initialize: function() { this.start(); }, start: function() { this.startListener(); }, startListener: function() { this.stopListener();  this.cache.calendarElements = $$(this.config.selector); this.cache.calendarElements.each(  function(value, key)  {  this.cache.calendarEvents[key] = this.show.bindAsEventListener(this, value);  Event.observe(value, 'focus', this.cache.calendarEvents[key]);  }.bind(this)  ); }, stopListener: function() { this.cache.calendarElements.each(  function(value, key)  {  Event.observe(value, 'focus', this.cache.calendarEvents[key]);  }.bind(this)  ); }, show: function(event, selectedElement) { displayCalendar($(selectedElement), this.config.dateFormat, selectedElement); $('calendarDiv').style.position = 'absolute'; }
}; firstInit('ptCalendar');
 self.ptGallery = {}; self.ptGallery = Class.create( { config: { jbstName: 'gallery' }, cache: { images: [], actualImage: 0, viewEvent: false }, initialize: function() { this.cache.viewEvent = this.switchView.bindAsEventListener(this); this.cache.viewNextEvent = this.nextImage.bindAsEventListener(this); this.cache.viewPreviousEvent = this.previousImage.bindAsEventListener(this); this.cache.viewFirstEvent = this.firstImage.bindAsEventListener(this); this.cache.viewLastEvent = this.lastImage.bindAsEventListener(this); }, start: function() { this.stopListener(); this.startListener(); }, startListener: function() {  this.cache.images = $$('.pt_js_gallery_image'); this.cache.images.each(  function(value, key)  {  var jbstId = Element.readAttribute(value, 'pt_js_jbst_id');  Event.observe(value, 'click', this.showImage.bindAsEventListener(this, jbstId));  }.bind(this)  );   if($('pt_js_gallery_switch_view')) { Event.observe($('pt_js_gallery_switch_view'), 'click', this.cache.viewEvent); }
 Event.observe($('pt_js_gallery_left'), 'click', this.cache.viewPreviousEvent); Event.observe($('pt_js_gallery_right'), 'click', this.cache.viewNextEvent); Event.observe($('pt_js_gallery_first'), 'click', this.cache.viewFirstEvent); Event.observe($('pt_js_gallery_last'), 'click', this.cache.viewLastEvent); }, stopListener: function() { if($('pt_js_gallery_switch_view')) { Event.stopObserving($('pt_js_gallery_switch_view'), 'click', this.cache.viewEvent); }
 Event.stopObserving($('pt_js_gallery_left'), 'click', this.cache.viewPreviousEvent); Event.stopObserving($('pt_js_gallery_right'), 'click', this.cache.viewNextEvent); Event.stopObserving($('pt_js_gallery_first'), 'click', this.cache.viewFirstEvent); Event.stopObserving($('pt_js_gallery_last'), 'click', this.cache.viewLastEvent); }, showImage: function(event, jbstId) {  var data = Core.ptJbstData.getDataById(this.config.jbstName, jbstId);  var counter = Core.ptJbstData.getPageCount(this.config.jbstName); var position = Core.ptJbstData.getSelectedById(this.config.jbstName, jbstId); $('pt_js_gallery_image_count').innerHTML = 'Bild '+ (position+1) + ' von ' + counter;  this.cache.actualImage = position;  Element.hide($('pt_js_gallery_small_container'));  var imageBig = Element.select($('pt_js_gallery_big_container'), 'img').first(); Element.writeAttribute(imageBig, 'src', data.imagePath);  Element.update($('pt_js_gallery_description'), '<span class="tui_bold">Bild:</span> '+data.imageDescription);  Element.show($('pt_js_gallery_big_container'));  Element.writeAttribute($('pt_js_gallery_download'), 'href', data.imagePath); Element.show($('pt_js_gallery_download')); Element.show($('pt_js_gallery_navigation')); }, switchView: function(event) {  if(Element.visible($('pt_js_gallery_big_container'))) { var thumbContent = this.prepareThumbs(); $('pt_js_gallery_small_container').innerHTML = thumbContent; Element.hide($('pt_js_gallery_big_container')); Element.show($('pt_js_gallery_small_container'));   Element.hide($('pt_js_gallery_download')); Element.hide($('pt_js_gallery_navigation'));  this.start(); }
 else if(Element.visible($('pt_js_gallery_small_container'))) { Element.hide($('pt_js_gallery_small_container')); Element.show($('pt_js_gallery_big_container'));   Element.show($('pt_js_gallery_download')); Element.show($('pt_js_gallery_navigation')); }
}, prepareThumbs: function() { var data = Core.ptJbstData.getRawData(this.config.jbstName); this.template = ''; data.each( function(value) {  var link = value.imagePathThumb;  this.template += '<div class="tui_thumbImage"><a href="#" onclick="return false"><img src="'+link+'" alt="" border="0" class="pt_js_gallery_image" pt_js_jbst_id="'+value.id+'" /></a></div>'; }.bind(this) ); return this.template+'<div class="tui_clear"></div>'; }, nextImage: function(event) { var maxPosition = Core.ptJbstData.getPageCount(this.config.jbstName); var newposition = this.cache.actualImage+1;  if(newposition < maxPosition) { var data = Core.ptJbstData.getSelectedByPosition(this.config.jbstName, newposition); this.showImage(event, data.id); }
}, previousImage: function(event) { var newposition = this.cache.actualImage-1;  if(newposition >= 0) { var data = Core.ptJbstData.getSelectedByPosition(this.config.jbstName, newposition); this.showImage(event, data.id); }
}, firstImage: function(event) { var data = Core.ptJbstData.getSelectedByPosition(this.config.jbstName, 0); this.showImage(event, data.id); }, lastImage: function(event) { var maxPosition = Core.ptJbstData.getPageCount(this.config.jbstName); var data = Core.ptJbstData.getSelectedByPosition(this.config.jbstName, maxPosition-1); this.showImage(event, data.id); }
}); firstInit('ptGallery');
 self.ptFlyer = {}; self.ptFlyer = Class.create( { config: {  }, cache: { clearElements: [], clearEvents: [],  headlineElements: [], headlineEvents: [],  infoElements: [], infoEvents: [],  filterOpenElements: [], filterOpenEvents: [],  filterCloseElements: [], filterCloseEvents: [],  open: false }, initialize: function() { this.startListener(); }, start: function() { this.startListener(); }, startListener: function() { this.stopListener();  this.cache.clearElements = $$('.pt_js_flyer_clear'); this.cache.clearElements.each(  function(value, key)  {  this.cache.clearEvents[key] = this.clear.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.clearEvents[key]);  }.bind(this)  );   this.cache.headlineElements = $$('.pt_js_flyer_headline'); this.cache.headlineElements.each(  function(value, key)  {  this.cache.headlineEvents[key] = this.select.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.headlineEvents[key]);  }.bind(this)  );   this.cache.infoElements = $$('.pt_js_flyer_info'); this.cache.infoElements.each(  function(value, key)  {  this.cache.infoEvents[key] = this.showInfo.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.infoEvents[key]);  }.bind(this)  );   this.cache.filterOpenElements = $$('.pt_js_flyer_open'); this.cache.filterOpenElements.each(  function(value, key)  {  this.cache.filterOpenEvents[key] = this.showFilter.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.filterOpenEvents[key]);  }.bind(this)  );   this.cache.filterCloseElements = $$('.pt_js_flyer_close'); this.cache.filterCloseElements.each(  function(value, key)  {  this.cache.filterCloseEvents[key] = this.hideFilter.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.filterCloseEvents[key]);  }.bind(this)  );   }, stopListener: function() { this.cache.clearElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.clearEvents[key]);  }.bind(this)  );   this.cache.headlineElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.headlineEvents[key]);  }.bind(this)  );   this.cache.infoElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.infoEvents[key]);  }.bind(this)  );   this.cache.filterOpenElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.filterOpenEvents[key]);  }.bind(this)  );   this.cache.filterCloseElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.filterCloseEvents[key]);  }.bind(this)  ); }, showFilter: function(event, clicked) { var container = Element.select(clicked, '.pt_js_flyer_container').first(); if(!Event.findElement(event, '.pt_js_flyer_close')) { Element.show(container); Element.setStyle(clicked, {zIndex: 1}); }
 }, hideFilter: function(event, clicked) { if(Element.hasClassName(clicked, 'pt_js_flyer_close')) { var container = Element.select(clicked.up('.pt_js_flyer_open'), '.pt_js_flyer_container').first();   var icon = Element.select(clicked.up('.pt_js_flyer_open'), '.pt_js_flyer_icon').first(); if(Element.hasClassName(icon, 'tui_icon_filterChoose')) { Element.removeClassName(icon, 'tui_icon_filterChoose'); }
if(Element.hasClassName(icon, 'tui_icon_filterChange')) { Element.removeClassName(icon, 'tui_icon_filterChange'); }
 var form = Element.select(clicked.up('.pt_js_flyer_open'), 'form').first(); var form = Form.serialize(form, true);  var keys = Object.keys(form); if(Array.in_array('filter_region[]', keys)) { Element.addClassName(icon, 'tui_icon_filterChange'); }
else { Element.addClassName(icon, 'tui_icon_filterChoose'); }
Element.hide(container); Element.setStyle(clicked.up('.pt_js_flyer_open'), {zIndex: 0}); }
 }, clear: function(event, clicked) { var trElement = clicked.up('tr'); var elements = Element.select(trElement, 'input'); elements.each(  function(value)  {  value.checked = false;  }
 ); }, select: function(event, clicked) { var selected = clicked.innerHTML; var realSelected = Element.readAttribute(clicked, 'pt_js_flyer_headline');  $('pt_js_flyer_headline').innerHTML = selected;  if($('flyer_headline')) { $('flyer_headline').value = selected; }
}, showInfo: function(event, clicked) {  $$('.pt_js_flyer_info').each(  function(value)  {  if(Element.hasClassName(value, 'tui_icon_information_active'))  {  Element.removeClassName(value, 'tui_icon_information_active');  Element.addClassName(value, 'tui_icon_information');  Element.hide(value.next());  }
   }
 ); if(this.cache.open != clicked) { if(Element.hasClassName(clicked, 'tui_icon_information')) { Element.removeClassName(clicked, 'tui_icon_information'); Element.addClassName(clicked, 'tui_icon_information_active'); Element.show(clicked.next());  this.cache.open = clicked; }
}
else { this.cache.open = false; }
}
}); firstInit('ptFlyer');
 self.ptCallConfirm = {}; self.ptCallConfirm = Class.create(); self.ptCallConfirm.prototype = { initialize: function(){}, config: { selector: '.pt_js_call_confirm' }, cache: { callElements: [], callEvent: [], callbacks: '' }, initialize: function() { this.startListener(); }, startListener: function() { this.stopListener(); this.cache.callElements = $$(this.config.selector); var load = false; this.cache.callElements.each(  function(value, key)  {  load = true;  this.cache.callEvent[key] = this.prepareCall.bindAsEventListener(this, value);  Event.observe(value, 'click', this.cache.callEvent[key]);  }.bind(this)  ); if (load) Core.ptService.call('ptDialog', 'initialize' ); }, stopListener: function() { this.cache.callElements.each(  function(value, key)  {  Event.stopObserving(value, 'click', this.cache.callEvent[key]);  }.bind(this)  ); }, prepareCall: function(event, clickedElement) { var title = Element.readAttribute(clickedElement, 'title'); var link = Element.readAttribute(clickedElement, 'href'); var form = Element.readAttribute(clickedElement, 'pt_js_call'); if( !title ) title = " "; if( form ) { form = "pt_js_call='" + form + "'"; }
else { var form2 = clickedElement.up('form'); if(form2 && form2.id) { form = "pt_js_call='ptForm::" + form2.id + "'"; }
}
text =' <div class="back01_overlaySmall back01_overlay_confirm"> <div class="back01_overlay_border01"> <div class="back01_overlay_border02"> <div class="back01_overlay_headline"> <div class="back01_overlay_headline_iconLeft"><span class="back01_icon_exclamationMark">&nbsp;</span></div> <div class="back01_overlay_headline_iconRight"><span title="schließen" class="back01_icon_close" onclick="Core.ptDialog.closeDialog();">&nbsp;</span></div> ' + title.charAt(0).toUpperCase() + title.substr(1) + '</div> <div class="back01_overlaySmall_content">M&ouml;chten Sie wirklich ' + title.charAt(0).toLowerCase() + title.substr(1) + '?</div> <div class="back01_overlaySmall_buttons"> <a class="back01_button_cancel" onclick="Core.ptCallConfirm.startListener(); Core.ptDialog.closeDialog();return false;" href="#">abbrechen</a> <a onclick="window.setTimeout( Core.ptDialog.closeDialog ,100 ); $(this).hide(); return false;" class="back01_button_accept pt_js_call" '+ form +' href=" '+ link + '">ok</a> </div> <div class="back01_clear"></div> </div> </div> </div> </div> '; Core.ptService.call('ptDialog', 'create', [text] ); Core.ptCall.startListener(); }
}; firstInit('ptCallConfirm');
