var Site = { // yellow background-color on all input fields initFocus: function() { var iFocus = new inputFocus({ form_id: 'contactform', setborder : false, txtcolor : '#3d3d3d', bgcolor : '#fefa8f', duration : 0 }); }, // input focus color on textareas initFocus2: function() { ffocus = $$('textarea'); ffocus.each(function(focus){ focus.addEvent('focus', function(){focus.setStyles({backgroundColor:'#fefa8f', color:'#000000'});}); focus.addEvent('blur', function(){focus.setStyles({backgroundColor:'#fefefe',color:'#585757'});}); }); }, // clears and restores default value on searchform input field initClear: function() { var iClear1 = new inputClear({ collection: $$('input[type=text], input[type=password]') }); }, // hover li for crappy ie initHoverLi: function() { if ($('navstart')) { var IeHover1 = new ieHover({ collection: $('navstart').getChildren('li') }); } }, // ie6 hover initIEHover: function() { var IeHover2 = new ieHover({ collection: $$('.hover') }); }, // opens modal enlarged images initRemooz: function() { ReMooz.assign('#content .graphicbox a.enlarge', { 'origin': 'img', 'shadow': 'onOpen', // fx is faster because shadow appears after resize animation 'resizeFactor': 0.9, // resize to maximum 80% of screen size 'cutOut': false, // don't hide the original 'opacityResize': 0.4, // opaque resize 'dragging': false, // disable dragging 'centered': true // resize to center of the screen, not relative to the source element }); }, // opens unobstrusive popup windows initMooPop: function() { var MooPop = new moopop({ attrVal:'popup' }); }, // injects the flash clock initFlashClock: function() { var obj = new Swiff('/cps/rde/xfw/SID-6BD633F1-0BC54982/fk-rgk_de/flash_clock_xml.swf', { id: 'flashClock', container: 'clock', width: 70, height: 70, params: { wmode: 'transparent', align: 'middle', scale: 'scale' }, vars: { configurl: '' } }); }, // opens form submits in a new windows initOpenForms: function() { var OpenForm = new openForms({ collection: $$('.formopen') }); }, // prints the page initWindowPrint: function() { var print = new windowPrint({ collection: $$('a.print') }); }, // form validation contactform initFormCheck: function() { var CheckContact = new FormCheck('contactform', { display : { showErrors : 0, indicateErrors : 1, // 0 will turn off the tooltips errorsLocation: 1, tipsPosition: 'left', tipsOffsetX: -30, addClassErrorToField: 'error', closeTipsButton : 1, flashTips : 1 } }) }, // form validation feedbackform initFeedCheck: function() { var CheckContact = new FormCheck('feedbackform', { submitByAjax: true, onAjaxRequest:function(){ $('request').setStyles({display: 'block', zIndex: '100'}); $('feedbackbutton').disabled = !($('feedbackbutton').disabled);}, onAjaxSuccess:function(){ (function(){ $('success').setStyles({display: 'block', zIndex: '100'}); }).delay(1500); }, onAjaxFailure:function(){ (function(){ $('failure').setStyles({display: 'block', zIndex: '100'}); }).delay(1500); }, display : { showErrors : 0, indicateErrors : 1, errorsLocation: 1, tipsPosition: 'left', tipsOffsetX: -30, addClassErrorToField: 'error', closeTipsButton : 1, flashTips : 1 } }); }, initFeedbackOpen: function() { if ($('feedbackbox')) { var fxfeed = new Fx.Reveal($('feedbackbox'), {duration: 500, mode: 'vertical'}); $$('.feedback').each(function(el) { el.addEvent('click', function(evt) { $('feedbackbutton').disabled = false; $('feedmessage').set('value', ''); new Event(evt).stop(); (function(){ $('request').setStyles({display: 'none', zIndex: '0'}); $('success').setStyles({display: 'none', zIndex: '0'}); $('failure').setStyles({display: 'none', zIndex: '0'}); $('anon').setStyles({display: 'block', zIndex: '100'}); }).delay(1500); fxfeed.toggle().chain( function(){ var myFx = new Fx.Scroll(window, { duration: 750, transition: Fx.Transitions.Sine.easeOut}).toBottom(); } ); }); }); }; }, //Scrolls the window to the top initEmailTips: function() { var myTips = new Tips('.thisisatooltip'); }, //Scrolls the window to the top initScrollTop: function() { $(document.body).getElements('a[href$=top]').addEvents({ 'click': function(e){ evt = new Event(e); var myFx = new Fx.Scroll(window, { duration: 1000, transition: Fx.Transitions.Sine.easeOut, wait: false }).toTop(); evt.stop(); } }); }, initMootoolsBreadcrumb: function() { if($('breadcrumbs') != null){ $('breadcrumbs').addEvents({ 'mouseenter': function(){ // Always sets the duration of the tween to 1000 ms and a bouncing transition // And then tweens the height of the element this.set('tween', { duration: 500, transition: Fx.Transitions.Sine }).tween('width', '900px'); }, 'mouseleave': function(){ // Resets the tween and changes the element back to its original size this.set('tween', {}).tween('width', '525px'); } }); } } } window.addEvent('domready', function(){ Site.initFocus(); Site.initFocus2(); Site.initClear(); Site.initHoverLi(); Site.initIEHover(); Site.initRemooz(); Site.initMooPop(); Site.initFlashClock(); Site.initOpenForms(); Site.initWindowPrint(); Site.initFormCheck(); Site.initFeedCheck(); Site.initFeedbackOpen(); Site.initEmailTips(); Site.initMootoolsBreadcrumb(); });