/* eWAVE.cz JavaScript Tools, Copyright (c) 2011 eWAVE.cz - all rights reserved */

var tools_alerts = new Class({
initialize:function(element) {
this.toolsInitial = $(document.body).getElement(element);
this.toolsObjects = {'content':null,'returns':null};
if(this.toolsInitial != null) {
this.toolsObjects['content'] = this.toolsInitial.getProperty('html');
this.toolsObjects['returns'] = (this.toolsObjects['content'] != false ? alert(this.toolsObjects['content']) : null);
}
}
});

var tools_blank = new Class({
initialize:function(element) {
$(document.body).getElements(element).each((function(el,num){el.setProperty('target','blank');}).bind(this));
}
});

var tools_click = (function(modul,id) {
return new Request({'url':config['url']+'statistic.php','encoding':'utf-8','noCache':true}).send({'method':'get','data':'mutation='+config['language']+'&modul='+modul+'&type=click&id='+id});
});

var tools_multibox = new Class({
Implements:[Options],options:{'element':'multibox','duration':600,'transition':Fx.Transitions.Sine.easeInOut,'padding':[188,30],'size':[500,240],'panel':{'panel':true,'slide':{'status':true,'automat':false,'duration':4000},'drag':{'status':true}},'url':null,'automat':false,'opacity':false,'language':new Array()},
initialize:function(element,options) {
this.toolsSetting = (options ? this.setOptions(options) : null);
this.toolsObjects = {'initial':null,'numbers':false,'started':new Array(),'statuse':false,'loaders':true,'delayed':500,'evented':['resize','scroll'],'arrayed':new Array(),'content':new Array(),'regular':new Array(),'runners':new Array(),'sliders':false,'clicked':false,'fulleds':false};
this.toolsArrayed = {'objects':new Array(),'insides':new Array()};
this.toolsToolbar = new Array();
this.toolsCleared = new Array();
this.toolsEfected = new Array();
this.toolsClicked = new Array();
this.toolsShadows = new Array();
this.toolsCounter = 0;
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['initial'].each((function(el,num){this.toolsObjects['arrayed'][num] = {'object':el,'content':(el.get('tag') == 'a' ? el.getProperty('href') : (el.getNext('div.multibox-content') != null ? el.getNext('div.multibox-content').getProperty('html') : null)),'perex':el.getElement('span.perex'),'size':(el.getProperty('rel') != null ? ((this.toolsObjects['regular'][num] = el.getProperty('rel').match(/^(\d+)\;(\d+)$/i)) ? {'width':this.toolsObjects['regular'][num]['1'].toInt(),'height':this.toolsObjects['regular'][num]['2'].toInt()} : {'width':0,'height':0}) : {'width':0,'height':0}),'title':el.getElement('span.title')};if(this.toolsObjects['arrayed'][num]['content'] != null){this.toolsObjects['content'][this.toolsCounter] = this.toolsObjects['arrayed'][num];this.toolsCounter++;}}).bind(this));
this.toolsObjects['numbers'] = (this.toolsCounter-1);
Object.each(this.toolsObjects['content'],(function(value,key) {
this.toolsObjects['runners'][key] = value['object'].addEvent('click',(function() {
this.cleared.apply(this,['deleted']);
this.toolsArrayed['objects']['numbers'] = key.toInt();
this.toolsArrayed['objects']['markeds'] = value['content'].substr(value['content'].lastIndexOf('.')+1).toLowerCase();
this.toolsArrayed['objects']['windows'] = {'load':{'widths':value['size']['width'],'height':value['size']['height']},'news':{'widths':(window.getSize().x-(this.options['padding']['1']*2)).limit(this.options['size']['0'],value['size']['width']),'height':(window.getSize().y-(this.options['padding']['0']+this.options['padding']['1'])).limit(this.options['size']['1'],value['size']['height'])}};
this.toolsArrayed['objects']['configs'] = {'type':(this.toolsArrayed['objects']['markeds'].test('gif|jpg|jpeg|png') != false ? 'image' : (this.toolsArrayed['objects']['markeds'].test('fla|flv|mov|mp3|mp4|wav') != false ? 'movie' : 'text')),'resizer':((this.toolsArrayed['objects']['windows']['load']['widths'] <= this.toolsArrayed['objects']['windows']['news']['widths'] && this.toolsArrayed['objects']['windows']['load']['height'] <= this.toolsArrayed['objects']['windows']['news']['height']) || this.toolsObjects['fulleds'] != false ? {'widths':this.toolsArrayed['objects']['windows']['load']['widths'],'height':this.toolsArrayed['objects']['windows']['load']['height']} : (((this.toolsArrayed['objects']['windows']['news']['widths']/this.toolsArrayed['objects']['windows']['load']['widths'])*this.toolsArrayed['objects']['windows']['load']['height']) < this.toolsArrayed['objects']['windows']['news']['height'] ? {'widths':this.toolsArrayed['objects']['windows']['news']['widths'],'height':((this.toolsArrayed['objects']['windows']['news']['widths']/this.toolsArrayed['objects']['windows']['load']['widths'])*this.toolsArrayed['objects']['windows']['load']['height']).round()} : {'widths':((this.toolsArrayed['objects']['windows']['news']['height']/this.toolsArrayed['objects']['windows']['load']['height'])*this.toolsArrayed['objects']['windows']['load']['widths']).round(),'height':this.toolsArrayed['objects']['windows']['news']['height']}))};
this.toolsArrayed['objects']['termeds'] = ((this.toolsArrayed['objects']['configs']['resizer']['widths'] < this.toolsArrayed['objects']['windows']['load']['widths']) || (this.toolsArrayed['objects']['configs']['resizer']['height'] < this.toolsArrayed['objects']['windows']['load']['height']) ? true : false);
this.toolsArrayed['objects']['content'] = (value['content'] != false ? value['content'] : this.options['language']['multibox']['content']);
this.toolsArrayed['insides']['clicked'] = new Element('div',{'class':this.options['element']+' repeat','styles':{'height':$(document.body).getScrollSize().y},'events':{'click':(function(){this.cleared.apply(this,['deleted']);this.cleared.apply(this,['sliders']);this.cleared.apply(this,['cookies']);this.toolsObjects['fulleds'] = false;}).bind(this)}}).inject($(document.body),'top').set({'opacity':(this.options['opacity'] != false ? this.options['opacity'] : '1.0')});
this.toolsArrayed['insides']['initial'] = new Element('div',{'id':this.options['element'],'class':this.options['element']+' loaded','styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths'],'top':((window.getHeight()/2)+$(document.body).getScrollTop())},'events':{'selectstart':(function(){return false;})}}).inject($(document.body),'top').set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}});
this.toolsArrayed['insides']['boxings'] = new Element('div',{'class':this.options['element']}).inject(this.toolsArrayed['insides']['initial'],'top');
this.toolsArrayed['insides']['insider'] = new Element('div',{'class':'inside','styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths'],'height':this.toolsArrayed['objects']['configs']['resizer']['height']}}).inject(this.toolsArrayed['insides']['boxings'],'bottom');
this.toolsArrayed['insides']['content'] = new Element('div',{'class':'hidden'+(this.options['automat'] != false || this.toolsObjects['fulleds'] != false ? ' normal' : ''),'html':(this.toolsArrayed['objects']['configs']['type'] == 'movie' ? '<embed src="'+this.options['url']+'data/player/player.swf" width="'+this.toolsArrayed['objects']['configs']['resizer']['widths']+'" height="'+this.toolsArrayed['objects']['configs']['resizer']['height']+'" allowscriptaccess="always" allowfullscreen="true" flashvars="width='+this.toolsArrayed['objects']['configs']['resizer']['widths']+'&amp;height='+this.toolsArrayed['objects']['configs']['resizer']['height']+'&amp;file='+this.toolsArrayed['objects']['content']+'&amp;fullscreen=true&amp;stretching=uniform&amp;skin='+this.options['url']+'data/player/skin.swf" wmode="transparent"></embed>' : (this.toolsArrayed['objects']['configs']['type'] == 'image' ? null : this.toolsArrayed['objects']['content'])),'styles':(this.toolsArrayed['objects']['configs']['type'] == 'text' ? {'width':(this.toolsArrayed['objects']['configs']['resizer']['widths']-this.options['padding']['1']),'height':(this.toolsArrayed['objects']['configs']['resizer']['height']-this.options['padding']['1']),'padding':(this.options['padding']['1']/2),'overflow-x':'hidden','overflow-y':'auto'} : {'width':this.toolsArrayed['objects']['configs']['resizer']['widths'],'height':this.toolsArrayed['objects']['configs']['resizer']['height']})}).inject(this.toolsArrayed['insides']['insider'],'bottom');
this.toolsArrayed['insides']['loading'] = new Element('div',{'class':'loading','styles':{'display':(this.options['automat'] != false || this.toolsObjects['fulleds'] != false ? 'none' : 'block')}}).inject(this.toolsArrayed['insides']['insider'],'bottom').set({'opacity':'1','morph':{'duration':this.options['duration'],'transition':this.options['transition']}});
this.toolsArrayed['insides']['imageds'] = (this.toolsArrayed['objects']['configs']['type'] == 'image' ? Asset.images([this.toolsArrayed['objects']['content']],{'onComplete':(function(){this.toolsArrayed['insides']['content'].setStyle('display','block');this.toolsArrayed['insides']['loading'].morph({'opacity':'0'});}).bind(this)}).addClass('image').addEvents({'click':(function(){this.toolsToolbar['buttons']['ends'].fireEvent('click');}).bind(this)}).inject(this.toolsArrayed['insides']['content'],'bottom') : false);
this.toolbar.apply(this,[value]);
this.shadows.apply(this);
if(this.options['panel']['slide']['automat'] != false && this.toolsObjects['loaders'] != false) { this.sliders.apply(this); }
this.efected.apply(this);
this.toolsArrayed['insides']['sizedes'] = this.toolsArrayed['insides']['initial'].getSize();
this.toolsArrayed['insides']['initial'].setStyles({'margin':'-'+(this.toolsArrayed['insides']['sizedes'].y/2).round(0)+'px 0 0 -'+(this.toolsArrayed['insides']['sizedes'].x/2).round(0)+'px'});
return false;
}).bind(this));
if(this.options['automat'] != false && Cookie.read('disabled') != 'yes') { this.toolsObjects['runners'][key].fireEvent('click'); }
}).bind(this));
this.clicked.apply(this);
},
toolbar:function(value) {
if(this.options['panel']['panel'] != false) {
this.toolsToolbar = {'headers':false,'footers':false,'runners':false,'dragers':false,'checked':false,'removed':false,'numbers':new Array(),'termeds':new Array(),'styleds':new Array(),'totaled':false,'buttons':new Array(),'moveds':false,'actuals':(this.toolsArrayed['objects']['numbers']+1),'counter':(this.toolsObjects['numbers']+1)};
this.toolsToolbar['headers'] = new Element('div',{'class':'toolbar header','html':(value['title'] != null || value['perex'] != null ? '<p>'+(value['title'] != null ? '<strong>'+(value['title'].getProperty('html') != false ? value['title'].getProperty('html') : this.options['language']['multibox']['undefined'])+'</strong>' : '')+''+(value['perex'] != null ? (value['perex'].getProperty('html') != false ? value['perex'].getProperty('html') : this.options['language']['multibox']['undefined']) : '')+'</p>' : ''),'styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths']}}).inject(this.toolsArrayed['insides']['initial'],'top');
this.toolsToolbar['footers'] = new Element('div',{'class':'toolbar footer','html':'<strong>'+this.options['language']['multibox']['box']+' '+(this.toolsToolbar['actuals'] < '10' ? '0'+this.toolsToolbar['actuals'] : this.toolsToolbar['actuals'])+' '+this.options['language']['multibox']['from']+' '+(this.toolsToolbar['counter'] < '10' ? '0'+this.toolsToolbar['counter'] : this.toolsToolbar['counter'])+'</strong>','styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths']}}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsToolbar['insides'] = (function(type){this.toolsToolbar['numbers'][type] = (type == 'next' ? (this.toolsArrayed['objects']['numbers']+1) : (this.toolsArrayed['objects']['numbers']-1));this.toolsToolbar['termeds'][type] = (type == 'next' ? (this.toolsObjects['numbers'] >= this.toolsToolbar['numbers'][type]) : (this.toolsToolbar['numbers'][type] >= '0'));this.toolsToolbar['styleds'][type] = (this.toolsToolbar['termeds'][type] == false ? this.toolsToolbar['buttons'][type].addClass('disable') : this.toolsToolbar['buttons'][type].removeClass('disable'));return (this.toolsToolbar['termeds'][type] != false ? this.toolsToolbar['numbers'][type] : 'nothing');}).bind(this);
this.toolsToolbar['runners'] = (function(type){this.toolsToolbar['totaled'] = this.toolsToolbar['insides'].apply(this,[type]);this.cleared.apply(this,[(this.toolsToolbar['totaled'] != 'nothing' ? 'sliders' : false)]);return (this.toolsToolbar['totaled'] != 'nothing' ? this.toolsObjects['content'][this.toolsToolbar['totaled']]['object'].fireEvent('click') : false);}).bind(this);
this.toolsToolbar['dragers'] = (function(type){if(this.options['panel']['drag']['status'] != false){this.toolsToolbar['removed'] = (type == 'none' ? this.toolsToolbar['buttons']['drop'].dispose() : false);this.toolsToolbar['buttons']['drop'] = new Element('span',{'class':'button drop'+(this.toolsObjects['statuse'] == false ? ' actives' : ' disable')}).inject(this.toolsToolbar['buttons']['ends'],'before');this.toolsToolbar['moveds'] = (this.toolsObjects['statuse'] == false ? new Drag.Move(this.options['element'],{'handle':this.toolsToolbar['buttons']['drop']}) : false);}}).bind(this);
this.toolsToolbar['checked'] = (this.options['panel']['panel'] != false && this.options['panel']['slide']['status'] != false && this.toolsObjects['numbers'] != false ? true : false);
this.toolsToolbar['buttons']['prev'] = new Element('span',{'class':'button prev','events':{'click':(function(){this.toolsToolbar['runners'].apply(this,['prev']);}).bind(this)}}).inject(this.toolsToolbar['footers'],'bottom');
this.toolsToolbar['buttons']['play'] = new Element('span',{'class':'button '+(this.toolsObjects['statuse'] != false ? 'stop' : 'play')+''+(this.toolsToolbar['checked'] != false ? '' : ' disable'),'events':{'click':(function(){this.sliders.apply(this);}).bind(this)}}).inject(this.toolsToolbar['footers'],'bottom');
this.toolsToolbar['buttons']['next'] = new Element('span',{'class':'button next','events':{'click':(function(){this.toolsToolbar['runners'].apply(this,['next']);}).bind(this)}}).inject(this.toolsToolbar['footers'],'bottom');
this.toolsToolbar['buttons']['full'] = new Element('span',{'class':'button full '+(this.toolsArrayed['objects']['termeds'] != false ? 'actives' : 'disable'),'styles':{'display':(this.toolsArrayed['objects']['configs']['type'] == 'image' ? 'inline-block' : 'none')},'events':{'click':(function(){if(this.toolsArrayed['objects']['termeds'] != false && this.toolsObjects['fulleds'] == false){this.toolsObjects['fulleds'] = true;this.toolsObjects['runners'][this.toolsArrayed['objects']['numbers']].fireEvent('click');}}).bind(this)}}).inject(this.toolsToolbar['footers'],'bottom');
this.toolsToolbar['buttons']['ends'] = new Element('span',{'class':'button ends','events':{'click':(function(){this.cleared.apply(this,['deleted']);this.cleared.apply(this,['sliders']);this.cleared.apply(this,['cookies']);this.toolsObjects['clicked'] = false;this.toolsObjects['fulleds'] = false;}).bind(this)}}).inject(this.toolsToolbar['footers'],'bottom');
this.toolsToolbar['insides'].apply(this,['prev']);
this.toolsToolbar['insides'].apply(this,['next']);
this.toolsToolbar['dragers'].apply(this,['true']);
this.toolsObjects['fulleds'] = false;
}
},
cleared:function(type) {
this.toolsCleared = {'efected':false,'sliders':false,'deleted':false,'cookies':false};
this.toolsCleared['efected'] = (function(){clearTimeout(this.toolsObjects['started']);});
this.toolsCleared['sliders'] = (function(){clearTimeout(this.toolsObjects['sliders']);this.toolsObjects['statuse'] = false;});
this.toolsCleared['deleted'] = (function(){this.cleared.apply(this,['efected']);$$('div.'+this.options['element']).dispose();});
this.toolsCleared['cookies'] = (function(){if(this.options['automat'] != false){Cookie.write('disabled','yes',{'duration':false});}});
return (type != false ? this.toolsCleared[type].apply(this) : false);
},
efected:function() {
this.toolsEfected = {'insides':false,'cleared':false};
this.toolsEfected['insides'] = (this.toolsObjects['clicked'] == false ? this.toolsArrayed['insides']['initial'].morph({'opacity':'1'}) : this.toolsArrayed['insides']['initial'].set({'opacity':'1'}));
this.toolsObjects['started'] = (function(){this.toolsArrayed['insides']['content'].setStyle('display','block');this.toolsArrayed['insides']['loading'].morph({'opacity':'0'});}).bind(this).delay(this.toolsObjects['delayed']);
this.toolsObjects['clicked'] = (this.toolsObjects['clicked'] == false ? true : this.toolsObjects['clicked']);
this.toolsEfected['cleared'] = (this.toolsArrayed['objects']['configs']['type'] == 'image' ? this.cleared.apply(this,['efected']) : false);
},
sliders:function() {
if((this.options['panel']['panel'] != false ? this.toolsToolbar['checked'] : false) != false) {
if(this.toolsObjects['statuse'] == false) {
this.toolsObjects['sliders'] = (function(element,number){element[(this.counter = (this.counter == number ? 0 : (this.counter+1)))]['object'].fireEvent('click');}).periodical(this.options['panel']['slide']['duration'],{'counter':this.toolsArrayed['objects']['numbers']},[this.toolsObjects['content'],this.toolsObjects['numbers']]);
this.toolsObjects['statuse'] = true;
this.toolsObjects['loaders'] = false;
this.toolsToolbar['buttons']['play'].addClass('stop');
this.toolsToolbar['dragers'].apply(this,['none']);
} else {
this.toolsObjects['statuse'] = false;
this.toolsToolbar['buttons']['play'].removeClass('stop').addClass('play');
this.toolsToolbar['dragers'].apply(this,['none']);
this.cleared.apply(this,['sliders']);
}
}
},
clicked:function() {
this.toolsClicked = {'insides':false};
this.toolsClicked['insides'] = this.toolsObjects['evented'].each((function(el,num){window.addEvent(el,(function(){$$('div.'+this.options['element']+'.repeat').setStyles({'width':$(document.body).getScrollSize().x,'height':$(document.body).getScrollSize().y});}).bind(this));}).bind(this));
},
shadows:function() {
this.toolsShadows = {'headers':false,'footers':false,'lefteds':false,'righted':false,'edgedes':new Array()};
this.toolsShadows['headers'] = new Element('span',{'class':'header','styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths']}}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['footers'] = new Element('span',{'class':'footer','styles':{'width':this.toolsArrayed['objects']['configs']['resizer']['widths']}}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['lefteds'] = new Element('span',{'class':'left','styles':{'height':(this.toolsArrayed['objects']['configs']['resizer']['height']+(this.options['panel']['panel'] != false ? (this.toolsToolbar['headers'].getSize().y+this.toolsToolbar['footers'].getSize().y) : 0))}}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['righted'] = new Element('span',{'class':'right','styles':{'height':(this.toolsArrayed['objects']['configs']['resizer']['height']+(this.options['panel']['panel'] != false ? (this.toolsToolbar['headers'].getSize().y+this.toolsToolbar['footers'].getSize().y) : 0))}}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['firsts'] = new Element('span',{'class':'edges header left'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['second'] = new Element('span',{'class':'edges header right'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['thirds'] = new Element('span',{'class':'edges footer left'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['fourth'] = new Element('span',{'class':'edges footer right'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
}
});

var tools_popup = (function(url,name,width,height,scrollbar) {
return window.open(url,name,'height='+height+',width='+width+',top='+((screen.height-height)/2)+',left='+((screen.width-width)/2)+',scrollbars='+scrollbar);
});

var tools_scroller = new Class({
Implements:[Options],options:{'period':1,'duration':500,'transition':Fx.Transitions.Sine.easeInOut,'automat':{'status':false,'period':0}},
initialize:function(element,options) {
this.toolsSetting = (options ? this.setOptions(options) : null);
this.toolsInitial = $(document.body).getElement(element);
this.toolsObjects = {'insides':null,'paginat':null,'element':null,'scrolls':null};
this.toolsCounter = 0;
this.toolsActuals = 0;
this.toolsPaginat = new Array();
this.toolsProtect = false;
this.toolsTimeout = null;
if(this.toolsInitial != null) {
this.toolsObjects['insides'] = this.toolsInitial.getElement('div.inside');
this.toolsObjects['paginat'] = new Element('div',{'class':'page'}).inject(this.toolsInitial,'bottom');
this.toolsObjects['element'] = (this.toolsObjects['insides'] != null ? this.toolsObjects['insides'].getElements('div.hidden p') : null);
this.toolsObjects['scrolls'] = (this.toolsObjects['insides'] != null ? new Fx.Scroll(this.toolsObjects['insides'],{'duration':this.options['duration'],'transition':this.options['transition'],'onComplete':(function(){if(this.toolsPaginat[this.toolsActuals] != null) {$$(this.toolsPaginat).removeClass('active');this.toolsPaginat[this.toolsActuals].addClass('active');}this.toolsProtect = false;}).bind(this)}) : null);
if((this.toolsCounter = (Object.getLength(this.toolsObjects['element'])-1)) != false) {
this.toolsObjects['element'].each((function(el,num){this.toolsActuals += (num == false ? num : 0);this.toolsPaginat[num] = new Element('span',{'class':'num '+(num == false ? 'active' : 'disable'),'events':{'click':(function(){this.sliders.apply(this,[num]);}).bind(this)}}).inject(this.toolsObjects['paginat'],'bottom');}).bind(this));
this.sliders.apply(this,[0]);
this.automat.apply(this);
}
}
},
sliders:function(num) {
if(this.toolsCounter >= this.options['period'] && this.toolsProtect == false) {
this.toolsProtect = true;
this.toolsActuals = (num != null ? num : (this.toolsActuals+this.options['period']));
this.toolsActuals = (this.toolsActuals >= this.toolsCounter ? 0 : this.toolsActuals);
if(this.toolsObjects['element'][this.toolsActuals] != null) {this.toolsObjects['scrolls'].toElement(this.toolsObjects['element'][this.toolsActuals]);}
}
},
automat:function() {
if(this.options['automat']['status'] != false) {
this.toolsTimeout = this.sliders.periodical(this.options['automat']['period'],this,[null]);
this.toolsInitial.addEvents({'mouseover':(function(){clearTimeout(this.toolsTimeout);}).bind(this),'mouseout':(function(){this.toolsTimeout = this.sliders.periodical(this.options['automat']['period'],this,[null]);}).bind(this)});
}
}
});

var tools_scrollbar = new Class({
Implements:[Options],options:{'minimum':1,'steps':100},
initialize:function(element,options) {
this.dataDefaults = new Array();
this.dataDefaults['initial'] = $(document.body);
this.dataDefaults['setting'] = (options ? this.setOptions(options) : null);
this.dataDefaults['element'] = this.dataDefaults['initial'].getElement(element);
this.dataDefaults['prevent'] = false;
this.retrieve.apply(this);
},
mousewheel:function(event) {
if(this.dataDefaults['prevent'] == false) {
this.dataMousewheel = new Array();
this.dataMousewheel['initial'] = new Event(event);
this.dataMousewheel['calling'] = this.position.apply(this,[event.wheel,'wheel']);
this.dataMousewheel['initial'].stop();
}
},
retrieve:function() {
if(this.dataDefaults['element'] != null) {
this.dataRetrieve = new Array();
this.dataRetrieve['initial'] = this.dataDefaults['element'].getElement('div.scroll');
this.dataRetrieve['toolbar'] = this.dataDefaults['element'].getElement('div.knob');
this.dataRetrieve['handler'] = this.dataDefaults['element'].getElement('div.point');
if(this.dataRetrieve['initial'] != null && this.dataRetrieve['toolbar'] != null && this.dataRetrieve['handler'] != null) {
this.dataRetrieve['scrolls'] = 0;
this.dataRetrieve['protect'] = {'initial':this.dataRetrieve['initial'].getStyle('width').toInt(),'toolbar':this.dataRetrieve['toolbar'].getComputedSize().totalWidth};
this.dataRetrieve['calling'] = this.changing.apply(this,['load']);
this.dataRetrieve['draging'] = new Drag(this.dataRetrieve['handler'],{'snap':'0','limit':{'x':[0,0],'y':[0,this.dataChanging['limiter']]},'onStart':(function(){this.position.apply(this,[this.dataRetrieve['draging'].value.now['y'],'drag']);}).bind(this),'onDrag':(function(){this.position.apply(this,[this.dataRetrieve['draging'].value.now['y'],'drag']);}).bind(this),'onBeforeStart':(function(){this.dataDefaults['prevent'] = true;}).bind(this),'onCancel':(function(){this.dataDefaults['prevent'] = false;}).bind(this),'onComplete':(function(){this.dataDefaults['prevent'] = false;}).bind(this)});
this.dataRetrieve['initial'].addEvents({'mousewheel':(function(event){this.mousewheel.apply(this,[event]);}).bind(this)});
}
}
},
changing:function(type) {
this.dataChanging = new Array();
this.dataChanging['styleds'] = new Array();
this.dataChanging['styleds']['sized'] = this.dataRetrieve['initial'].getScrollSize().y;
this.dataChanging['styleds']['total'] = this.dataRetrieve['toolbar'].getStyle('height').toInt();
this.dataChanging['styleds']['start'] = this.dataRetrieve['handler'].getStyle('top').toInt();
this.dataChanging['counter'] = new Array();
this.dataChanging['counter']['first'] = (this.dataRetrieve['initial'].getCoordinates().height/this.dataChanging['styleds']['sized']);
this.dataChanging['counter']['secon'] = (this.dataChanging['styleds']['sized']/this.dataChanging['styleds']['total']);
this.dataChanging['setting'] = (this.dataChanging['styleds']['total']*this.dataChanging['counter']['first']).limit(this.options['minimum'],this.dataChanging['styleds']['total']);
this.dataChanging['limiter'] = (this.dataChanging['styleds']['total']-this.dataChanging['setting']);
this.dataRetrieve['handler'].setStyles({'height':this.dataChanging['setting'],'top':(type == 'reset' ? 0 : this.dataChanging['styleds']['start'])});
this.dataRetrieve['scrolls'] = (type == 'reset' ? 0 : this.dataRetrieve['scrolls']);
if(this.dataChanging['limiter'] <= '0') {this.dataRetrieve['initial'].setStyle('width',(this.dataRetrieve['protect']['initial']+this.dataRetrieve['protect']['toolbar']));this.dataRetrieve['toolbar'].setStyle('display','none');} else {this.dataRetrieve['initial'].setStyle('width',this.dataRetrieve['protect']['initial']);this.dataRetrieve['toolbar'].setStyle('display','block');}
if(this.dataRetrieve['draging'] != null) {this.dataRetrieve['draging'].options.limit.y['1'] = this.dataChanging['limiter'];}
},
update:function() {
this.dataRetrieve['initial']['scrollTop'] = (this.dataPosition['valueds']*this.dataChanging['counter']['secon']);
this.dataRetrieve['handler'].setStyle('top',Math.floor(this.dataPosition['valueds']));
this.dataRetrieve['scrolls'] = this.dataRetrieve['initial'].getScrollTop();
this.changing.apply(this,['load']);
},
position:function(position,type) {
this.dataPosition = new Array();
this.dataPosition['valueds'] = (type == 'wheel' ? Math.round(((this.dataRetrieve['scrolls']-(this.options['steps']*(position < 0 ? -1 : 1)))/this.dataChanging['counter']['secon'])) : position).limit('0',this.dataChanging['limiter']);
this.update.apply(this);
}
});

window.addEvent('domready',function() {

// jazykove mutace javascriptu
var initializeMutation = {'contents':new Array(),'retrieve':new Array()};
initializeMutation['contents']['cs'] = {'multibox':{'box':'Box','from':'z','undefined':'Nedefinováno','content':'Obsah není definován'}};
initializeMutation['retrieve'] = (config['language'] != null && initializeMutation['contents'][config['language']] != null ? initializeMutation['contents'][config['language']] : null);

// inicializace funkci
new tools_alerts('div.message.alerts');
new tools_blank('a.blank, a[rel="blank"]');
new tools_multibox('.multibox-window.content',{'url':(config['url'] != null ? config['url'] : null),'language':initializeMutation['retrieve'],'opacity':0.9});
new tools_multibox('.multibox-window.message',{'url':(config['url'] != null ? config['url'] : null),'language':initializeMutation['retrieve'],'opacity':0.9,'automat':true});
new tools_scroller('div.news.scroll',{'automat':{'status':true,'period':5000}});
new Tips($(document.body).getElements('div.formular label.wrong'),{'className':'tooltip'});
new tools_scrollbar('div.center.middle div#scrollbar');

});
