//-------------TOOLBAR------------// var SiemensToolbar = Class.create(); SiemensToolbar.prototype = { initialize: function( buttons_container, open_class, noeffect) { this.block = $(buttons_container); if(!this.block) return false; this.openers = $A( this.block.getElementsByClassName('a') ); this.blocks = new Array(); this.open_class = open_class; this.header = $( 'header_img' ); this.content = $('content_zone'); this.min = 144; this.max = 393; if ( $('close_btn') ) $('close_btn').onclick = this.close_se.bind(this); this.noeffect = noeffect; if(navigator.userAgent.indexOf('MSIE 6') != -1) this.IE6 = true; for( i=0, n=this.openers.length; i 0 && this.openers.length == this.blocks.length) ) return false; for( i=0, n=this.openers.length; i -1 ) { Element.toggleClassName(this.openers[this.index], this.open_class); if(this.index == index) { if(!this.noeffect) this.effect(); Element.toggle(this.blocks[this.index]); return true; } Element.hide(this.blocks[this.index]); this.openers[this.index].removeClassName(this.open_class).removeClassName('hover'); } this.index = index; if(!this.noeffect) this.effect(); Element.show(this.blocks[this.index]); Element.toggleClassName(this.openers[this.index],this.open_class); }, hover: function(elm,over) { if( Element.hasClassName(elm,this.open_class) ) return false; Element.toggleClassName(elm, 'hover'); }, close_se: function() { if(!this.noeffect) this.effect(); $('siemens_site_explorer_block').hide(); $('siemens_site_explorer').className = ''; }, effect: function() { if( this.openers[this.index].id && this.openers[this.index].id == 'siemens_site_explorer' ) { if( this.blocks[this.index].style.display == 'none' ) { this.effectUpDown(this.max,false);//up if(!this.IE6) this.contentHeight(73); } else { this.effectUpDown(this.min,true);//down if(!this.IE6) setTimeout( this.contentHeight.bind(this,40), 800 ); } } else { if( this.header.style.height == this.min+'px' ) { this.effectUpDown(this.min,true);//down if(!this.IE6) setTimeout( this.contentHeight.bind(this,40), 800 ); } else return false; } }, contentHeight: function(h) { Element.setStyle( this.content, { minHeight: h+'%'} ); }, effectUpDown: function(ch,open) { c = false; if( open ) { ch += 15; if( ch > this.max ) ch = this.max; if( ch < this.max ) c = true; } else { ch -= 15; if( ch < this.min ) ch = this.min; if( ch > this.min ) c = true; } Element.setStyle( this.header, { height: ch+'px'} ); if( !c ) return true; this.timeout = setTimeout( this.effectUpDown.bind(this,ch,open), 5 ); } }; //-------------CONTACTS------------// var SiemensContacts = Class.create(); SiemensContacts.prototype = { initialize: function( contacts_container, p_class, adress_class, active_class, hide_class ) { this.container = $(contacts_container); this.p_class = p_class; this.adress_class = adress_class; this.active = active_class; this.hide_class = hide_class; this.p = $A( this.container.getElementsByTagName('p') ); this.cities = $A( this.container.getElementsByTagName('strong') ); this.adress_block = $A( this.container.getElementsByTagName('span') ); for( i=0; i 0 ) this.cities.first().className = this.active; for( i=0; i 0 ) { for( i=0; i 0 ) this.spans[0].className = 'hide'; this.b = $A( $(this.cl_block).getElementsByTagName('div') ); for( i=0; i'); this.header_img = this.new_tmp.down('img'); this.new_tmp = true; } this.flash.parentNode.style.visibility = 'hidden'; } t = this.styles[t]; Element.update(this.header_text, t.text); Element.update(this.header, t.title); if( t.src ) this.header_img.src = t.src.gsub(/url\(([\"\']{0,})/, '').gsub(/([\"\']{0,})\)/, ''); ; return true; } this.restore(); return true; } };