/* eWAVE.cz JavaScript Tools, Copyright (c) 2011 eWAVE.cz - all rights reserved */

var tools_calendar = new Class({
Implements:[Options],options:{'url':null,'delay':0,'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsNumbers = (function(type,value){return (type == 'prev' ? (value.toInt()-1) : (value.toInt()+1));});
this.toolsCounter = {'sending':0,'actuals':{'mont':0,'year':0}};
this.toolsObjects = {'initial':null,'buttons':{'prev':null,'next':null,'date':null},'started':null,'efected':null,'actuals':new Array(),'loading':null,'tooltip':null};
this.toolsDelayed = null;
this.toolsRequest = new Request.HTML({'url':this.options['url'],'encoding':'utf-8','noCache':true,'onRequest':(function(){this.toolsObjects['efected'].apply('block');}).bind(this),'onSuccess':(function(tree,elements,html,script){this.toolsObjects['loading'].setProperty('html',html);this.toolsDelayed = this.toolsObjects['efected'].delay(this.options['delay'],this,['none']);this.tooltip.apply(this);}).bind(this)});
this.toolsLoading = null;
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['buttons']['prev'] = this.toolsObjects['initial'].getElement('div.list span.button.prev');
this.toolsObjects['buttons']['next'] = this.toolsObjects['initial'].getElement('div.list span.button.next');
this.toolsObjects['buttons']['date'] = this.toolsObjects['initial'].getElement('div.list span.button.date');
this.toolsObjects['actuals'] = JSON.decode(this.toolsObjects['initial'].getElement('div.list').getProperty('title'));
this.toolsObjects['loading'] = this.toolsObjects['initial'].getElement('div.load');
if(this.toolsObjects['buttons']['prev'] != null && this.toolsObjects['buttons']['next'] != null && this.toolsObjects['buttons']['date'] != null && this.toolsObjects['loading'] != null && this.toolsObjects['actuals']['mont'] != null && this.toolsObjects['actuals']['year'] != null) {
this.toolsObjects['initial'].getElement('div.list').removeProperty('title');
this.toolsObjects['actuals']['mont'] = this.toolsObjects['actuals']['mont'].toInt();
this.toolsObjects['actuals']['year'] = this.toolsObjects['actuals']['year'].toInt();
this.toolsObjects['buttons']['prev'].addEvents({'click':(function(){this.request.apply(this,['prev']);clearTimeout(this.toolsDelayed);}).bind(this)});
this.toolsObjects['buttons']['next'].addEvents({'click':(function(){this.request.apply(this,['next']);clearTimeout(this.toolsDelayed);}).bind(this)});
this.toolsObjects['started'] = new Element('span',{'class':'loading','html':this.options['language']['loading']}).inject(this.toolsObjects['loading'].getParent('div.insides'),'bottom').setStyles({'display':'none'});
this.toolsObjects['efected'] = (function(display){this.toolsObjects['started'].setStyles({'display':display});}).bind(this);
this.request.apply(this,['automat']);
}
}
},
request:function(type) {
this.toolsCounter['sending'] = (type == 'automat' ? '0' : this.toolsNumbers.apply(this,[type,this.toolsCounter['sending']]));
this.toolsCounter['actuals']['mont'] = (type == 'automat' ? this.toolsObjects['actuals']['mont'] : this.toolsNumbers.apply(null,[type,this.toolsObjects['actuals']['mont']]));
this.toolsCounter['actuals']['year'] = (type == 'automat' ? this.toolsObjects['actuals']['year'] : this.toolsNumbers.apply(null,[type,this.toolsObjects['actuals']['year']]));
this.toolsObjects['actuals']['mont'] = (this.toolsCounter['actuals']['mont'] < '1' ? '12' : (this.toolsCounter['actuals']['mont'] > '12' ? '1' : this.toolsCounter['actuals']['mont']));
this.toolsObjects['actuals']['year'] = (this.toolsCounter['actuals']['mont'] < '1' || this.toolsCounter['actuals']['mont'] > '12' ? this.toolsCounter['actuals']['year'] : this.toolsObjects['actuals']['year']);
this.toolsObjects['buttons']['date'].setProperty('html',(this.options['language']['month'][(this.toolsObjects['actuals']['mont']-1)] != null ? this.options['language']['month'][(this.toolsObjects['actuals']['mont']-1)] : this.toolsObjects['actuals']['mont'])+' '+this.toolsObjects['actuals']['year']);
this.toolsRequest.get({'mutation':config['language'],'month':this.toolsObjects['actuals']['mont'],'year':this.toolsObjects['actuals']['year']});
},
tooltip:function() {
if((this.toolsObjects['tooltip'] = (this.toolsObjects['loading'] != null ? this.toolsObjects['loading'].getElements('span.day.plans') : null)) != null) {
this.toolsTooltip = {'initial':new Array(),'content':new Array(),'arrayed':new Array()};
this.toolsObjects['tooltip'].each((function(el,num) {
this.toolsTooltip['initial'][num] = new Element('span',{'class':'table'}).inject(el,'bottom');
this.toolsTooltip['content'][num] = new Array();
this.toolsTooltip['arrayed'][num] = JSON.decode(el.getProperty('title'));
Object.each(this.toolsTooltip['arrayed'][num],(function(value,key) {
this.toolsTooltip['content'][num][key] = (value['title'] != null && value['seourl'] != null && value['public'] != null ? new Element('a',{'class':((Object.getLength(this.toolsTooltip['arrayed'][num])-1) == key ? 'normal' : 'border'),'href':value['seourl'],'html':value['title']+'<em>'+value['public']+'</em>'}).inject(this.toolsTooltip['initial'][num],'bottom') : null);
}).bind(this));
el.removeProperty('title');
}).bind(this));
}
}
});

var tools_remove = new Class({
initialize:function(element) {
this.toolsObjects = {'initial':null,'valueds':new Array(),'evented':new Array()};
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['initial'].each((function(el,num) {
this.toolsObjects['valueds'][num] = el.getProperty('value');
this.toolsObjects['evented'][num] = el.addEvents({'focus':(function(){el.setProperty('value',(el.getProperty('value') == this.toolsObjects['valueds'][num] ? null : el.getProperty('value')));}).bind(this),'blur':(function(){el.setProperty('value',(el.getProperty('value') == false ? this.toolsObjects['valueds'][num] : el.getProperty('value')));}).bind(this)});
}).bind(this));
}
});

var tools_booking = new Class({
Implements:[Options],options:{'url':null,'delay':0,'index':999,'protect':true,'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'clicked':new Array(),'datings':new Array(),'parents':new Array(),'checked':new Array(),'valueds':new Array(),'dragers':new Array(),'content':{'listed':new Array(),'nameds':new Array(),'relate':new Array(),'loader':new Array(),'inform':new Array(),'dating':new Array()},'objects':new Array(),'started':new Array(),'perexed':{'firsts':new Array(),'second':new Array()},'buttons':{'firsts':new Array(),'second':new Array()},'actuals':{'months':new Array(),'yeards':new Array(),'dating':new Array()}};
this.toolsValueds = new Array();
this.toolsClicked = new Array();
this.toolsContent = new Array();
this.toolsNumbers = (function(type,value){return (type == 'prev' ? (value.toInt()-1) : (value.toInt()+1));});
this.toolsCounter = {'sending':0,'actuals':{'months':new Array(),'yeards':new Array()}};
this.toolsProtect = null;
this.toolsEfected = (function(num,display){if(this.toolsObjects['started'][num] != null){this.toolsObjects['started'][num].setStyle('display',display);}}).bind(this);
this.toolsDelayed = new Array();
this.toolsRequest = new Array();
this.toolsResized = null;
this.toolsReturns = new Array();
if((this.toolsObjects['initial'] = $(document.body)) != null && (this.toolsObjects['clicked'] = this.toolsObjects['initial'].getElements(element)) != null && this.toolsObjects['clicked'].length != false) {
this.toolsObjects['clicked'].each((function(el,num) {
if((this.toolsObjects['checked'][num] = (el.getParent('form') != null ? el.getParent('form').getElement('input[name="product"]') : null)) != null && (this.toolsObjects['valueds'][num] = this.toolsObjects['checked'][num].getProperty('value')) != null && this.toolsObjects['valueds'][num].match(new RegExp('^([0-9]+)$','i'))) {
this.toolsValueds[num] = el.getCoordinates();
this.toolsClicked[num] = el.addEvent('click',(function() {
if((this.toolsObjects['datings'][num] = el.getProperty('value').match(new RegExp('^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4})$','i'))) && this.toolsObjects['parents'][num] == null) {
this.toolsCounter['actuals']['months'][num] = 0;
this.toolsCounter['actuals']['yeards'][num] = 0;
this.toolsObjects['parents'][num] = new Element('div',{'class':'booking','styles':{'left':this.toolsValueds[num]['left'],'top':this.toolsValueds[num]['top']},'events':{'mouseover':(function(){Object.each(this.toolsObjects['parents'],(function(value,key){if(value != null){value.setStyle('z-index',this.options['index']);}}).bind(this));this.toolsObjects['parents'][num].setStyles({'z-index':(this.options['index']+1)});}).bind(this),'click':(function(){return false;}).bind(this)}}).inject(this.toolsObjects['initial'],'top');
this.toolsObjects['parents'][num].fireEvent('mouseover');
this.toolsObjects['dragers'][num] = new Drag.Move(this.toolsObjects['parents'][num]);
this.toolsObjects['content']['listed'][num] = new Element('div',{'class':'list'}).inject(this.toolsObjects['parents'][num],'bottom');
this.toolsObjects['content']['nameds'][num] = new Element('div',{'class':'name'}).inject(this.toolsObjects['parents'][num],'bottom');
this.toolsObjects['content']['relate'][num] = new Element('div',{'class':'dump'}).inject(this.toolsObjects['parents'][num],'bottom');
this.toolsObjects['content']['loader'][num] = new Element('div',{'class':'load'}).inject(this.toolsObjects['content']['relate'][num],'bottom');
this.toolsObjects['content']['inform'][num] = new Element('div',{'class':'info'}).inject(this.toolsObjects['parents'][num],'bottom');
this.toolsObjects['buttons']['firsts'][num] = new Element('span',{'class':'arrow prev','events':{'click':(function(){this.request.apply(this,['prev',num]);clearTimeout(this.toolsDelayed[num]);}).bind(this)}}).inject(this.toolsObjects['content']['listed'][num],'bottom');
this.toolsObjects['buttons']['second'][num] = new Element('span',{'class':'arrow next','events':{'click':(function(){this.request.apply(this,['next',num]);clearTimeout(this.toolsDelayed[num]);}).bind(this)}}).inject(this.toolsObjects['content']['listed'][num],'bottom');
this.toolsObjects['content']['dating'][num] = new Element('span',{'class':'dated'}).inject(this.toolsObjects['buttons']['firsts'][num],'after');
this.toolsObjects['objects'][num] = Object.each(this.options['language']['booking']['days'],(function(value,key){this.toolsContent[key] = new Element('span',{'class':'day','html':value}).inject(this.toolsObjects['content']['nameds'][num],'bottom');}).bind(this));
this.toolsObjects['started'][num] = new Element('span',{'class':'loading'}).inject(this.toolsObjects['content']['relate'][num],'bottom');
this.toolsObjects['perexed']['firsts'][num] = new Element('span',{'class':'text','html':'<span class="day order"></span>'+this.options['language']['booking']['perex']['order']}).inject(this.toolsObjects['content']['inform'][num],'bottom');
this.toolsObjects['perexed']['second'][num] = new Element('span',{'class':'text','html':'<span class="day books"></span>'+this.options['language']['booking']['perex']['books']}).inject(this.toolsObjects['content']['inform'][num],'bottom');
this.toolsObjects['actuals']['months'][num] = this.toolsObjects['datings'][num]['2'].toInt();
this.toolsObjects['actuals']['yeards'][num] = this.toolsObjects['datings'][num]['3'].toInt();
this.toolsObjects['actuals']['dating'][num] = this.toolsObjects['datings'][num]['1'].toInt();
this.request.apply(this,['initial',num]);
} else {
this.toolsObjects['parents'][num].fireEvent('mouseover');
}
return false;
}).bind(this));
this.toolsRequest[num] = new Request.JSON({'url':this.options['url'],'encoding':'utf-8','noCache':true,'onRequest':(function(){this.toolsEfected.apply(this,[num,'block']);}).bind(this),'onSuccess':(function(data){this.toolsObjects['content']['loader'][num].empty();Object.each(data,(function(value,key){this.toolsReturns[key] = new Element('span',{'class':'day '+value['class']+' '+(value['disable'] != false ? 'cross' : 'click')+''+(this.toolsObjects['datings'][num]['1'].toInt() == value['day'] && this.toolsObjects['datings'][num]['2'].toInt() == value['month'] && this.toolsObjects['datings'][num]['3'].toInt() == value['year'] && value['class'].test('^(works|weeks)$') ? ' active' : ''),'html':value['day'],'events':{'click':(function(){if(value['disable'] == false && value['class'].test('^(works|weeks)$')){el.setProperty('value',value['day']+'.'+this.toolsObjects['actuals']['months'][num]+'.'+this.toolsObjects['actuals']['yeards'][num]);this.toolsObjects['parents'][num].dispose();this.toolsObjects['parents'][num] = null;} else {alert(this.options['language']['booking']['alert'][(value['disable'] != false ? 'disable' : value['class'])]);}}).bind(this)}}).inject(this.toolsObjects['content']['loader'][num],'bottom');}).bind(this));this.toolsDelayed[num] = this.toolsEfected.delay(this.options['delay'],this,[num,'none']);}).bind(this)});
this.toolsProtect = this.toolsObjects['initial'].addEvent('click',(function(){if(this.toolsObjects['parents'][num] != null) {this.toolsObjects['parents'][num].dispose();this.toolsObjects['parents'][num] = null;}}).bind(this));
this.toolsResized = window.addEvent('resize',(function(){this.toolsObjects['clicked'].each((function(el,num) {if(this.toolsObjects['parents'][num] != null) {this.toolsValueds[num] = el.getCoordinates();this.toolsObjects['parents'][num].setStyles({'left':this.toolsValueds[num]['left'],'top':this.toolsValueds[num]['top']});}}).bind(this));}).bind(this));
}
}).bind(this));
}
},
request:function(type,num) {
this.toolsCounter['sending'] = (type == 'initial' ? '0' : this.toolsNumbers.apply(this,[type,this.toolsCounter['sending']]));
this.toolsCounter['actuals']['months'][num] = (type == 'initial' ? this.toolsObjects['actuals']['months'][num] : this.toolsNumbers.apply(null,[type,this.toolsObjects['actuals']['months'][num]]));
this.toolsCounter['actuals']['yeards'][num] = (type == 'initial' ? this.toolsObjects['actuals']['yeards'][num] : this.toolsNumbers.apply(null,[type,this.toolsObjects['actuals']['yeards'][num]]));
this.toolsObjects['actuals']['months'][num] = (this.toolsCounter['actuals']['months'][num] < '1' ? '12' : (this.toolsCounter['actuals']['months'][num] > '12' ? '1' : this.toolsCounter['actuals']['months'][num]));
this.toolsObjects['actuals']['yeards'][num] = (this.toolsCounter['actuals']['months'][num] < '1' || this.toolsCounter['actuals']['months'][num] > '12' ? this.toolsCounter['actuals']['yeards'][num] : this.toolsObjects['actuals']['yeards'][num]);
this.toolsObjects['content']['dating'][num].setProperty('html',(this.options['language']['month'][(this.toolsObjects['actuals']['months'][num]-1)] != null ? this.options['language']['month'][(this.toolsObjects['actuals']['months'][num]-1)] : this.toolsObjects['actuals']['months'][num])+' '+this.toolsObjects['actuals']['yeards'][num]);
this.toolsRequest[num].get({'mutation':config['language'],'month':this.toolsObjects['actuals']['months'][num],'year':this.toolsObjects['actuals']['yeards'][num],'protect':(this.options['protect'] != false ? '1' : '0'),'id':this.toolsObjects['valueds'][num]});
}
});

var tools_alerts = new Class({
initialize:function(element) {
this.toolsObjects = {'initial':null,'valueds':null,'evented':null};
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['valueds'] = this.toolsObjects['initial'].getProperty('html');
this.toolsObjects['evented'] = (this.toolsObjects['valueds'] != false ? alert(this.toolsObjects['valueds']) : null);
}
}
});

var tools_friend = new Class({
Implements:[Options],options:{'url':null,'duration':500,'transition':Fx.Transitions.Sine.easeInOut,'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'fromeds':null,'closeds':null,'submits':null,'spamers':new Array(),'parents':null,'clicked':null,'setting':null};
this.toolsInitial = new Array();
this.toolsSending = new Array();
this.toolsRequest = new Request.JSON({'url':this.options['url'],'encoding':'utf-8','noCache':true,'onSuccess':(function(message){this.success.apply(this,[message]);}).bind(this),'onFailure':(function(){this.failure.apply(this);}).bind(this)});
this.toolsActives = false;
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['formeds'] = this.toolsObjects['initial'].getElement('form');
this.toolsObjects['closeds'] = this.toolsObjects['initial'].getElement('span.button.closed');
this.toolsObjects['submits'] = this.toolsObjects['initial'].getElement('span.button.submit');
this.toolsObjects['spamers'] = this.toolsObjects['initial'].getElements('div.count strong');
this.toolsObjects['parents'] = this.toolsObjects['initial'].getParent('div.tools');
this.toolsObjects['clicked'] = this.toolsObjects['initial'].getParent('div.tools a.icon.friend');
this.toolsObjects['setting'] = this.toolsObjects['initial'].set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}});
if(this.toolsObjects['formeds'] != null && this.toolsObjects['submits'] != null && this.toolsObjects['closeds'] != null && this.toolsObjects['spamers'] != null && this.toolsObjects['parents'] != null && this.toolsObjects['clicked'] != null) {
this.toolsObjects['clicked'].addEvent('click',(function(){this.efected.apply(this,['start']);return false;}).bind(this)).removeProperty('href');
this.toolsObjects['closeds'].addEvent('click',(function(){this.efected.apply(this,['close']);return false;}).bind(this));
this.toolsObjects['submits'].addEvent('click',(function(){if(this.toolsActives == false){this.request.apply(this,['start']);}this.toolsActives = true;return false;}).bind(this));
}
}
},
request:function(type) {
this.toolsInitial['insides'] = new Element('table',{'class':'message'}).inject(this.toolsObjects['initial'],'bottom').set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}}).morph({'opacity':'1'});
this.toolsInitial['blocked'] = new Element('tr').inject(this.toolsInitial['insides'],'bottom');
this.toolsInitial['content'] = new Element('td',{'html':'<strong>'+this.options['language']['friend']['titles']['progress']+'</strong>'+this.options['language']['friend']['perexs']['progress']+'<br />'}).inject(this.toolsInitial['blocked'],'bottom');
this.toolsInitial['buttons'] = new Element('span',{'class':'button','html':this.options['language']['friend']['button']['cancel'],'events':{'click':(function(){this.toolsRequest.cancel();this.toolsInitial['insides'].set({'morph':{'onComplete':(function(){this.toolsInitial['insides'].dispose();}).bind(this)}}).morph({'opacity':'0'});this.toolsActives = false;return false;}).bind(this)}}).inject(this.toolsInitial['content'],'bottom');
this.toolsRequest.post(this.toolsObjects['formeds']);
},
success:function(message) {
this.toolsObjects['spamers']['0'].setProperty('html',message['antispam']['firsts']);
this.toolsObjects['spamers']['1'].setProperty('html',message['antispam']['second']);
this.toolsSending['insides'] = new Element('table',{'class':'message'}).inject(this.toolsObjects['initial'],'bottom').set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}}).morph({'opacity':'1'});
this.toolsSending['blocked'] = new Element('tr').inject(this.toolsSending['insides'],'bottom');
this.toolsSending['content'] = new Element('td',{'html':'<strong>'+(message['status'] != false ? this.options['language']['friend']['titles']['success'] : this.options['language']['friend']['titles']['failure'][message['type']])+'</strong>'+(message['status'] != false ? this.options['language']['friend']['perexs']['success'] : this.options['language']['friend']['perexs']['failure'][message['type']])+'<br />'}).inject(this.toolsSending['blocked'],'bottom');
this.toolsSending['buttons'] = new Element('span',{'class':'button','html':(message['status'] != false ? this.options['language']['friend']['button']['close'] : this.options['language']['friend']['button']['return']),'events':{'click':(function(){this.toolsInitial['insides'].dispose();this.toolsSending['insides'].set({'morph':{'onComplete':(function(){this.toolsSending['insides'].dispose();}).bind(this)}}).morph({'opacity':'0'});this.toolsActives = false;return false;}).bind(this)}}).inject(this.toolsSending['content'],'bottom');
},
failure:function() {
this.toolsSending['insides'] = new Element('table',{'class':'message'}).inject(this.toolsObjects['initial'],'bottom').set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}}).morph({'opacity':'1'});
this.toolsSending['blocked'] = new Element('tr').inject(this.toolsSending['insides'],'bottom');
this.toolsSending['content'] = new Element('td',{'html':'<strong>'+this.options['language']['friend']['titles']['failure']['faile']+'</strong>'+this.options['language']['friend']['perexs']['failure']['faile']+'<br />'}).inject(this.toolsSending['blocked'],'bottom');
this.toolsSending['buttons'] = new Element('span',{'class':'button','html':this.options['language']['friend']['button']['close'],'events':{'click':(function(){this.toolsInitial['insides'].dispose();this.toolsSending['insides'].set({'morph':{'onComplete':(function(){this.toolsSending['insides'].dispose();}).bind(this)}}).morph({'opacity':'0'});this.toolsActives = false;return false;}).bind(this)}}).inject(this.toolsSending['content'],'bottom');
},
efected:function(type) {
this.toolsObjects['setting'].setStyles({'display':'block','left':((this.toolsObjects['clicked'].getCoordinates().left-this.toolsObjects['parents'].getCoordinates().left)-19)}).morph({'opacity':(type == 'start' ? '1' : '0')});
}
});

var tools_print = new Class({
initialize:function(element) {
this.toolsObjects = {'initial':null,'clicked':null};
this.toolsObjects['initial'] = $(document.body).getElement(element);
this.toolsObjects['clicked'] = (this.toolsObjects['initial'] != null ? this.toolsObjects['initial'].addEvent('click',(function(){print();return false;}).bind(this)).removeProperty('href') : null);
}
});

var tools_slider = new Class({
Implements:[Options],options:{'number':{'total':0,'period':0},'duration':1000,'transition':Fx.Transitions.Expo.easeInOut,'automat':{'status':false,'period':0},'type':'scroll'},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'hiddens':null,'element':null,'buttons':{'prev':null,'next':null},'evented':{'init':null,'stop':null},'scrolls':null};
this.toolsActuals = 0;
this.toolsStyleds = null;
this.toolsCounter = 0;
this.toolsTermeds = {'prev':false,'next':false};
this.toolsAutomat = null;
this.toolsMethods = null;
this.toolsTimeout = null;
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['hiddens'] = this.toolsObjects['initial'].getElement('div.hiddens');
this.toolsObjects['element'] = (this.toolsObjects['hiddens'] != null ? this.toolsObjects['hiddens'].getElements('div.dumpeds p, div.dumpeds div.product') : null);
this.toolsObjects['buttons']['prev'] = this.toolsObjects['initial'].getElement('span.button.prev');
this.toolsObjects['buttons']['next'] = this.toolsObjects['initial'].getElement('span.button.next');
if(this.toolsObjects['hiddens'] != null && this.toolsObjects['element'] != null && this.toolsObjects['buttons']['prev'] != null && this.toolsObjects['buttons']['next'] != null) {
this.toolsObjects['evented']['init'] = (function(){this.toolsObjects['buttons']['prev'].addEvents({'click':(function(){this.sliders.apply(this,['prev',false]);}).bind(this)});this.toolsObjects['buttons']['next'].addEvents({'click':(function(){this.sliders.apply(this,['next',false]);}).bind(this)});});
this.toolsObjects['evented']['stop'] = (function(){this.toolsObjects['buttons']['prev'].removeEvents('click');this.toolsObjects['buttons']['next'].removeEvents('click');});
this.toolsObjects['scrolls'] = (this.options['type'] == 'scroll' ? new Fx.Scroll(this.toolsObjects['hiddens'],{'duration':this.options['duration'],'transition':this.options['transition'],'onStart':(function(){this.toolsObjects['evented']['stop'].apply(this);}).bind(this),'onComplete':(function(){this.toolsObjects['evented']['init'].apply(this);}).bind(this)}) : null);
this.toolsObjects['element'].each((function(el,num){this.toolsActuals += (el.hasClass('actives') == true ? num : false);this.toolsStyleds = (this.options['type'] == 'slideshow' ? el.setStyles({'display':'block','position':'absolute','left':'0px','top':'0px'}).set({'opacity':(el.hasClass('actives') == true ? '1' : '0'),'morph':{'duration':this.options['duration'],'transition':this.options['transition'],'onStart':(function(){this.toolsObjects['evented']['stop'].apply(this);}).bind(this),'onComplete':(function(){this.toolsObjects['evented']['init'].apply(this);}).bind(this)}}) : null);this.toolsCounter++;}).bind(this));
this.toolsObjects['evented']['init'].apply(this);
this.sliders.apply(this,[false,true]);
this.automat.apply(this);
}
}
},
sliders:function(type,automat) {
if(this.toolsCounter >= this.options['number']['total']) {
this.toolsActuals = (automat == true ? this.toolsActuals : (type == 'prev' ? (this.toolsActuals-this.options['number']['period']) : (this.toolsActuals+this.options['number']['period']))).limit(0,(this.toolsCounter-this.options['number']['total']));
this.toolsTermeds['prev'] = (this.toolsActuals == false ? false : true);
this.toolsTermeds['next'] = (this.toolsActuals == (this.toolsCounter-this.options['number']['total']) || this.toolsCounter < this.options['number']['total'] ? false : true);
if(this.options['type'] == 'scroll') {
this.toolsObjects['scrolls'].toElement(this.toolsObjects['element'][this.toolsActuals]);
} else {
if(this.toolsObjects['element'][this.toolsActuals].getStyle('opacity') == '0') {
this.toolsObjects['element'].morph({'opacity':'0'});
this.toolsObjects['element'][this.toolsActuals].morph({'opacity':'1'});
}
}
}
this.toolsObjects['buttons']['prev'].morph({'opacity':(this.toolsTermeds['prev'] == false ? '0' : '1')});
this.toolsObjects['buttons']['next'].morph({'opacity':(this.toolsTermeds['next'] == false ? '0' : '1')});
},
automat:function() {
if(this.options['automat']['status'] != false) {
this.toolsAutomat = (function(){this.toolsMethods = (this.toolsActuals == (this.toolsCounter-this.options['number']['total']) ? 'prev' : ((this.toolsMethods == 'prev' ? (this.toolsActuals == false ? 'next' : this.toolsMethods) : 'next')));this.sliders.apply(this,[this.toolsMethods,false]);}).bind(this);
this.toolsTimeout = this.toolsAutomat.periodical(this.options['automat']['period'],this);
this.toolsObjects['initial'].addEvents({'mouseover':(function(){clearTimeout(this.toolsTimeout);}).bind(this),'mouseout':(function(){this.toolsTimeout = this.toolsAutomat.periodical(this.options['automat']['period'],this);}).bind(this)});
}
}
});

var tools_statistic = new Class({
Implements:[Options],options:{'url':null,'modul':null},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'valueds':new Array(),'evented':new Array()};
this.toolsRequest = null;
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['initial'].each((function(el,num) {
this.toolsObjects['valueds'][num] = el.getProperty('href').match(/^(.*?)?(\?|&)numberStat=(\d+)$/i);
this.toolsObjects['evented'][num] = (this.toolsObjects['valueds'][num] && this.toolsObjects['valueds'][num]['3'] != null ? el.addEvent('click',(function(){this.toolsRequest = new Request({'url':this.options['url']}).send({'method':'get','data':'mutation='+config['language']+'&action=statistic&type=click&tables='+this.options['modul']+'&number='+this.toolsObjects['valueds'][num]['3']});}).bind(this)) : false);
}).bind(this));
}
});

var tools_popup = (function(url,name,width,height,scrollbar) {
this.toolsObjects = {'options':null};
this.toolsObjects['options'] = 'height='+height+',width='+width+',top='+((screen.height-height)/2)+',left='+((screen.width-width)/2)+',scrollbars='+scrollbar;
this.toolsObjects['initial'] = window.open(url,name,this.toolsObjects['options']);
});

var tools_search = new Class({
Implements:[Options],options:{'url':null,'duration':1000,'transition':Fx.Transitions.Expo.easeInOut,'delay':1000,'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'scrolls':null,'dumpeds':null,'formeds':null,'element':new Array(),'started':null,'loaders':null,'efected':null,'bokmark':new Array()};
this.toolsDelayed = null;
this.toolsActuals = null;
this.toolsValueds = new Array();
this.toolsEvented = new Array();
this.toolsFiredes = null;
this.toolsRequest = new Request.HTML({'url':this.options['url'],'encoding':'utf-8','noCache':true,'onRequest':(function(){this.toolsObjects['efected'].apply(this,['block']);}).bind(this),'onSuccess':(function(tree,elements,html,script){this.toolsObjects['dumpeds'].setProperty('html',html);this.toolsSliders = new tools_slider(this.toolsObjects['scrolls'],{'number':{'total':4,'period':4},'duration':this.options['duration'],'transition':this.options['transition'],'type':'scroll'});this.toolsDelayed = this.toolsObjects['efected'].delay(this.options['delay'],this,['none']);}).bind(this)});
this.toolsActives = null;
this.toolsSliders = null;
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['scrolls'] = this.toolsObjects['initial'].getElement('div.scrolls');
this.toolsObjects['dumpeds'] = this.toolsObjects['initial'].getElement('div.dumpeds');
this.toolsObjects['formeds'] = this.toolsObjects['initial'].getElement('div.configs form');
this.toolsObjects['element']['langes'] = (this.toolsObjects['formeds'] != null ? this.toolsObjects['formeds'].getElement('input[type="hidden"][name="mutation"]') : null);
this.toolsObjects['element']['values'] = (this.toolsObjects['formeds'] != null ? this.toolsObjects['formeds'].getElement('input[type="hidden"][name="filter"]') : null);
this.toolsObjects['element']['button'] = (this.toolsObjects['formeds'] != null ? this.toolsObjects['formeds'].getElement('input[type="button"]') : null);
if(this.toolsObjects['scrolls'] != null && this.toolsObjects['dumpeds'] != null && this.toolsObjects['element']['langes'] != null && this.toolsObjects['element']['values'] != null && this.toolsObjects['element']['button'] != null) {
this.toolsObjects['started'] = new Element('span',{'class':'loading','html':this.options['language']['loading']}).inject(this.toolsObjects['scrolls'],'bottom').setStyles({'display':'none'});
this.toolsObjects['loaders'] = new Element('span',{'class':'loaders'}).inject(this.toolsObjects['started'],'bottom');
this.toolsObjects['efected'] = (function(display){this.toolsObjects['started'].setStyles({'display':display});}).bind(this);
this.toolsObjects['bokmark'] = this.toolsObjects['initial'].getElements('ul.bookmark li');
this.toolsObjects['bokmark'].each((function(el,num) {
this.toolsActuals = (el.hasClass('actives') == true ? el : this.toolsActuals);
this.toolsValueds[num] = el.getProperty('title');
this.toolsEvented[num] = el.addEvents({'click':(function(){this.toolsObjects['formeds'].fireEvent('reset');this.request.apply(this,[num]);this.toolsObjects['bokmark'].removeClass('actives');el.addClass('actives');clearTimeout(this.toolsDelayed);}).bind(this)});
el.removeProperty('title');
}).bind(this));
this.toolsFiredes = (this.toolsActuals != null ? this.toolsActuals.fireEvent('click') : null);
this.toolsObjects['element']['button'].addEvent('click',(function(){this.request.apply(this,[this.toolsActives]);}).bind(this));
}
}
},
request:function(num) {
this.toolsObjects['element']['langes'].setProperty('value',config['language']);
this.toolsObjects['element']['values'].setProperty('value',this.toolsValueds[num]);
this.toolsActives = num;
this.toolsRequest.get(this.toolsObjects['formeds']);
}
});

var tools_gallery = new Class({
Implements:[Options],options:{'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'buttons':new Array(),'hiddens':new Array()};
this.toolsVotings = null;
this.toolsBoxings = null;
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['buttons'] = this.toolsObjects['initial'].getElements('ul.buttons li');
this.toolsObjects['hiddens'] = this.toolsObjects['initial'].getElements('div.hiddens div.dumpeds');
if((this.toolsObjects['buttons'].length == this.toolsObjects['hiddens'].length ? true : false) != false) {
this.toolsObjects['buttons'].each((function(el,num) {
el.addEvents({'click':(function(){this.toolsObjects['buttons'].removeClass('actives');el.addClass('actives');this.toolsObjects['hiddens'].removeClass('actives');this.toolsObjects['hiddens'][num].addClass('actives');}).bind(this)});
}).bind(this));
}
this.toolsVotings = new tools_voting('p.gallery span.image span.votes',{'url':config['url']+'statistic.php','modul':'multimedia','language':this.options['language']});
this.toolsBoxings = new tools_multibox('p.gallery a.multibox',{'url':config['url'],'language':this.options['language']});
}
}
});

var tools_favorite = new Class({
Implements:[Options],options:{'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'clicked':null,'setting':null};
this.toolsObjects['initial'] = $(document.body).getElement(element);
this.toolsObjects['clicked'] = (this.toolsObjects['initial'] != null ? this.toolsObjects['initial'].addEvent('click',(function(){this.toolsObjects['setting'] = (Browser.firefox ? window.sidebar.addPanel(document.title,window.location.href,false) : (Browser.ie ? window.external.AddFavorite(window.location.href,document.title) : alert(this.options['language']['favorite'])));return false;}).bind(this)).removeProperty('href') : null);
}
});

var tools_emoticon = new Class({
initialize:function(element) {
this.toolsObjects = {'initial':null,'iconeds':new Array(),'content':null,'inserts':null,'valueds':new Array(),'evented':new Array()};
this.toolsCursors = null;
this.toolsSelects = {'start':null,'end':null,'body':null};
if((this.toolsObjects['initial'] = $(document.body).getElement(element)) != null) {
this.toolsObjects['iconeds'] = this.toolsObjects['initial'].getElements('div.emoticon img');
this.toolsObjects['content'] = this.toolsObjects['initial'].getElement('label textarea');
if(this.toolsObjects['content'] != null) {
this.toolsObjects['inserts'] = (function(icon){if(icon != null) {if($(document).selection) {this.toolsObjects['content'].focus();this.toolsCursors = $(document).selection.createRange();this.toolsCursors.text = icon;} else if(this.toolsObjects['content'].selectionStart || this.toolsObjects['content'].selectionStart == "0") {this.toolsSelects['start'] = this.toolsObjects['content'].selectionStart;this.toolsSelects['end'] = this.toolsObjects['content'].selectionEnd;this.toolsSelects['body'] = this.toolsObjects['content'].getProperty('value');this.toolsObjects['content'].setProperty('value',this.toolsSelects['body'].substring(0,this.toolsSelects['start'])+''+icon+''+this.toolsSelects['body'].substring(this.toolsSelects['end'],this.toolsSelects['body'].length));} else {this.toolsObjects['content'].value += icon;}}});
this.toolsObjects['iconeds'].each((function(el,num) {
this.toolsObjects['valueds'][num] = el.getProperty('alt');
this.toolsObjects['evented'][num] = el.addEvents({'click':(function(){this.toolsObjects['inserts'].apply(this,[this.toolsObjects['valueds'][num]]);}).bind(this)});
}).bind(this));
}
}
}
});

var tools_multibox = new Class({
Implements:[Options],options:{'element':'boxedes','duration':600,'transition':Fx.Transitions.Sine.easeInOut,'padding':[190,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) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'numbers':false,'started':new Array(),'statuse':false,'loaders':true,'delayed':500,'evented':['resize','scroll'],'linkeds':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.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['numbers'] = (this.toolsObjects['initial'].length-1);
this.toolsObjects['initial'].each((function(el,num) {
this.toolsObjects['linkeds'][num] = (this.options['automat'] != false ? {'propers':el.getProperty('title'),'deleted':el.setStyle('display','none').removeProperty('title')} : {'propers':el.getProperty('href'),'deleted':el.removeProperty('href')});
if(this.toolsObjects['linkeds'][num]['propers'] != null) {
this.toolsObjects['runners'][num] = el.addEvents({'click':(function() {
if((this.toolsArrayed['objects']['valueds'] = this.toolsObjects['linkeds'][num]['propers'].match(/(^|^\?|&)widthBox=(\d+)(^|^\?|&)heightBox=(\d+)(^|^\?|&)titleBox=(.*?)?(^|^\?|&)descBox=(.*?)?(^|^\?|&)contentBox=(.*?)((^|^\?|&)numberStat=(\d+))?$/i))) {
this.cleared.apply(this,['deleted']);
this.toolsArrayed['objects']['numbers'] = num;
this.toolsArrayed['objects']['propers'] = (this.options['automat'] != false ? el.getProperty('html') : this.toolsArrayed['objects']['valueds']['10']);
this.toolsArrayed['objects']['markeds'] = this.toolsArrayed['objects']['propers'].substr(this.toolsArrayed['objects']['propers'].lastIndexOf('.')+1).toLowerCase();
this.toolsArrayed['objects']['windows'] = {'load':{'widths':this.toolsArrayed['objects']['valueds']['2'].toInt(),'height':this.toolsArrayed['objects']['valueds']['4'].toInt()},'news':{'widths':(window.getSize().x-(this.options['padding']['1']*2)).limit(this.options['size']['0'],this.toolsArrayed['objects']['valueds']['2'].toInt()),'height':(window.getSize().y-(this.options['padding']['0']+this.options['padding']['1'])).limit(this.options['size']['1'],this.toolsArrayed['objects']['valueds']['4'].toInt())}};
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'] = (this.toolsArrayed['objects']['propers'] != false ? this.toolsArrayed['objects']['propers'] : 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()),'margin':'-'+((this.toolsArrayed['objects']['configs']['resizer']['height']+(this.options['panel']['panel'] != false ? this.options['padding']['0'] : this.options['padding']['1']))/2).round(0)+'px 0 0 -'+((this.toolsArrayed['objects']['configs']['resizer']['widths']+this.options['padding']['1'])/2).round(0)+'px'}}).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':'insider','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':'hiddens'+(this.options['automat'] != false || this.toolsObjects['fulleds'] != false ? ' normals' : ''),'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)}).addEvents({'click':(function(){this.toolsToolbar['buttons']['ends'].fireEvent('click');}).bind(this)}).inject(this.toolsArrayed['insides']['content'],'bottom') : false);
this.toolbar.apply(this);
this.shadows.apply(this);
if(this.options['panel']['slide']['automat'] != false && this.toolsObjects['loaders'] != false) { this.sliders.apply(this); }
this.efected.apply(this);
return false;
}
}).bind(this)});
if(this.options['automat'] != false && Cookie.read('disabled') != 'yes') { this.toolsObjects['runners'][num].fireEvent('click'); } } else { this.toolsObjects['numbers']--; }
}).bind(this));
this.clicked.apply(this);
},
toolbar:function() {
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':'<strong>'+(this.toolsArrayed['objects']['valueds']['6'] != false ? this.toolsArrayed['objects']['valueds']['6'] : this.options['language']['multibox']['undefined'])+'</strong>'+(this.toolsArrayed['objects']['valueds']['8'] != false ? (this.toolsArrayed['objects']['valueds']['8'] != 'null' ? this.toolsArrayed['objects']['valueds']['8'] : '') : this.options['language']['multibox']['undefined']),'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['initial'][this.toolsToolbar['totaled']].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':'buttons 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':'buttons 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':'buttons '+(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':'buttons 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':'buttons 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':'buttons 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)))].fireEvent('click');}).periodical(this.options['panel']['slide']['duration'],{'counter':this.toolsArrayed['objects']['numbers']},[this.toolsObjects['initial'],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':'lefted','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':'rights','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':'edgeds header lefted'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['second'] = new Element('span',{'class':'edgeds header rights'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['thirds'] = new Element('span',{'class':'edgeds footer lefted'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
this.toolsShadows['edgedes']['fourth'] = new Element('span',{'class':'edgeds footer rights'}).inject(this.toolsArrayed['insides']['initial'],'bottom');
}
});

var tools_blank = new Class({
initialize:function(element) {
this.toolsObjects = {'initial':null};
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['initial'].each((function(el,num){el.setProperty('target','blank');}).bind(this));
}
});

var tools_input = new Class({
Implements:[Options],options:{'disabled':0.5},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'valueds':new Array(),'element':new Array(),'evented':new Array(),'reseted':null};
this.toolsReseted = null;
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['initial'].each((function(el,num) {
this.toolsObjects['valueds'][num] = el.getProperties('type','checked','disabled');
this.toolsObjects['element'][num] = new Element('span',{'class':'icon '+this.toolsObjects['valueds'][num]['type']+' '+(this.toolsObjects['valueds'][num]['checked'] == true ? 'actives' : 'disable')}).inject(el,'before').set({'opacity':(this.toolsObjects['valueds'][num]['disabled'] == true ? this.options['disabled'] : '1')});
this.toolsObjects['evented'][num] = (this.toolsObjects['valueds'][num]['disabled'] == true ? null : el.addEvents({'click':(function(event){event.stopPropagation();this.clicked.apply(this,[num]);}).bind(this)}));
}).bind(this));
this.toolsObjects['reseted'] = (this.toolsObjects['initial']['0'] != null ? ((this.toolsReseted = this.toolsObjects['initial']['0'].getParent('form'))!= null ? this.toolsReseted.addEvent('reset',(function(){this.toolsObjects['initial'].each((function(el,num){this.toolsObjects['element'][num].removeClass('actives');el.removeProperty('checked');if(this.toolsObjects['valueds'][num]['checked'] == true){this.toolsObjects['element'][num].addClass('actives');el.setProperty('checked','checked');}}).bind(this));}).bind(this)) : null) : null);
},
clicked:function(number) {
if(this.toolsObjects['valueds'][number]['type'] == 'radio') { Object.each(this.toolsObjects['element'],(function(value,key){value.removeClass('actives');}).bind(this));this.toolsObjects['element'][number].addClass('actives'); } else { if(this.toolsObjects['element'][number].hasClass('actives') == true) { this.toolsObjects['element'][number].removeClass('actives'); } else { this.toolsObjects['element'][number].addClass('actives'); } }
}
});

var tools_voting = new Class({
Implements:[Options],options:{'url':null,'modul':null,'duration':700,'transition':Fx.Transitions.Sine.easeOut,'automat':true,'language':new Array()},
initialize:function(element,options) {
if(options) { this.setOptions(options); }
this.toolsObjects = {'initial':null,'evented':false,'counter':false,'totaled':new Array(),'numbers':new Array(),'printed':false,'arrayed':{'spliter':new Array(),'valueds':new Array(),'counter':new Array(),'printed':new Array(),'parents':new Array(),'removed':new Array(),'morphed':new Array(),'runners':new Array()}};
this.toolsRequest = null;
this.toolsObjects['initial'] = $(document.body).getElements(element);
this.toolsObjects['evented'] = (function(number,opacity){this.toolsObjects['arrayed']['morphed'][number].morph({'opacity':opacity});});
this.toolsObjects['counter'] = (function(element,number){this.toolsObjects['totaled'][number] = {'counter':0,'delimit':0};this.toolsObjects['arrayed']['valueds'][number].each((function(el,num){this.toolsObjects['totaled'][number]['counter'] += ((num+1)*el.toInt());this.toolsObjects['totaled'][number]['delimit'] += el.toInt();}).bind(this));return(this.toolsObjects['totaled'][number]['counter']/this.toolsObjects['totaled'][number]['delimit']).round('0');});
this.toolsObjects['printed'] = (function(element,number){this.toolsObjects['numbers'][number] = {'element':new Array()};this.toolsObjects['arrayed']['valueds'][number].each((function(el,num){this.toolsObjects['numbers'][number]['element'][num] = new Element('span',{'class':'stars '+(num == false ? 'first' : 'other')+' '+(this.toolsObjects['arrayed']['counter'][number] > num ? 'actives' : 'disable'),'events':{'click':(function(event){event.stop();this.toolsRequest = new Request({'url':this.options['url'],'onSuccess':(function(){alert(this.options['language']['voting']['success']);}).bind(this),'onFailure':(function(){alert(this.options['language']['voting']['failure']);}).bind(this)}).send({'method':'get','data':'mutation='+config['language']+'&action=statistic&type=voted&tables='+this.options['modul']+'&number='+this.toolsObjects['arrayed']['spliter'][number]['1']+'&inside='+num});}).bind(this)}}).inject((num == false ? element : this.toolsObjects['numbers'][number]['element'][(num-1)]),'bottom');}).bind(this));});
this.toolsObjects['initial'].each((function(el,num) {
this.toolsObjects['arrayed']['spliter'][num] = (el.getProperty('title') != null ? el.getProperty('title').match(/^(\d+)-((\d+):(\d+):(\d+):(\d+):(\d+))$/i) : null);
if((this.toolsObjects['arrayed']['valueds'][num] = (this.toolsObjects['arrayed']['spliter'][num] != null ? this.toolsObjects['arrayed']['spliter'][num]['2'].split(':') : null)) != null) {
this.toolsObjects['arrayed']['counter'][num] = this.toolsObjects['counter'].apply(this,[el,num]);
this.toolsObjects['arrayed']['printed'][num] = this.toolsObjects['printed'].apply(this,[el,num]);
this.toolsObjects['arrayed']['parents'][num] = el.getParent('span.image');
this.toolsObjects['arrayed']['removed'][num] = el.removeProperty('title');
this.toolsObjects['arrayed']['morphed'][num] = el.setStyles({'visibility':'visible'}).set({'opacity':'0','morph':{'duration':this.options['duration'],'transition':this.options['transition']}});
this.toolsObjects['arrayed']['runners'][num] = (this.toolsObjects['arrayed']['parents'][num] != null && this.options['automat'] == false ? this.toolsObjects['arrayed']['parents'][num].addEvents({'mouseover':(function(){this.toolsObjects['evented'].apply(this,[num,'1']);}).bind(this),'mouseleave':(function(){this.toolsObjects['evented'].apply(this,[num,'0']);}).bind(this)}) : this.toolsObjects['evented'].apply(this,[num,'1']));
}
}).bind(this));
}
});

window.addEvent('domready',function() {

// definice jazykovych mutati javascriptu
var initializeLangs = {'defineds':new Array(),'retrieve':new Array()};
initializeLangs['defineds']['cs'] = {'booking':{'alert':{'blank':'Zvolené datum nelze použít!','books':'Zvolené datum nelze použít, je již rezervováno!','disable':'Zvolené datum nelze použít, je již expirováno!','order':'Zvolené datum nelze použít, je již objednáno!'},'days':['po','út','st','čt','pá','so','ne'],'perex':{'books':'rezervováno','order':'objednáno'}},'favorite':'Pro přidání do oblíbených zavřete tuto informační zprávu a stiskněte klávesy Ctrl+D, děkujeme.','friend':{'button':{'cancel':'Zrušit dotaz','close':'Zavřít zprávu','return':'Pokračovat'},'titles':{'failure':{'antispam':'Chybně vyplněný antispam','email':'Chybně vyplněný email','faile':'Systémová chyba','name':'Chybně vyplněné jméno','receiver':'Chybně vyplněný email příjemce'},'progress':'Čekejte prosím','success':'Vzkaz byl úspěšně odeslán'},'perexs':{'failure':{'antispam':'Součet je nesprávný, zkuste to prosím znovu.','email':'Zkontrolujte, zda jste svou emailovou adresu zadal(a) ve formátu: nazev@sluzba.domena.','faile':'Zopakujte prosím svůj požadavek později.','name':'Vyplňte své jméno a příjmení.','receiver':'Zkontrolujte, zda jste emailovou adresu příjemce zadal(a) ve formátu: nazev@sluzba.domena.'},'progress':'Váš dotaz se momentálně vyřizuje. Zpracování může trvat i několik sekund.','success':'Příjemci vzkazu byl odeslán email s upozorněním na Vámi aktuálně otevřenou stránku.'}},'loading':'Čekejte prosím, stahují se data','month':['Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec'],'multibox':{'box':'Box','from':'z','undefined':'Nedefinováno','content':'Obsah není definován'},'voting':{'success':'Hodnocení proběhlo úspěšně, výsledek se projeví až po znovunačtení stránky.','failure':'Hodnocení neproběhlo úspěšně, zkuste to prosím později.'}};
initializeLangs['retrieve'] = (initializeLangs['defineds'][config['language']] != null ? initializeLangs['defineds'][config['language']] : null);

// definice pomocnych javascriptovych funkci
new tools_alerts('div.message.alerts');
new tools_calendar('div.toolbar div.insides.calendar',{'url':config['url']+'calendar.php','delay':1000,'language':initializeLangs['retrieve']});
new tools_statistic('a.statistic',{'url':config['url']+'statistic.php','modul':'multimedia'});
new tools_remove('input[type="text"][name="keywords"], input[type="text"][name="name"][id="name-forum"], textarea[name="content"][id="content-forum"], input[type="text"][name="email"][id="email-newsletter"], input[type="text"][name="receiver"][id="receiver-friend"], input[type="text"][name="name"][id="name-friend"], input[type="text"][name="email"][id="email-friend"]');
new tools_voting('div.toolbar div.insides.pointers span.votes',{'url':config['url']+'statistic.php','modul':config['modul'],'language':initializeLangs['retrieve']});
new tools_slider('div.content div.insides.banners div.scrolls',{'number':{'total':1,'period':1},'transition':Fx.Transitions.Sine.easeInOut,'automat':{'status':true,'period':5000},'type':'slideshow'});
new tools_slider('div.toolbar div.insides.sliders div.scrolls',{'number':{'total':1,'period':1},'transition':Fx.Transitions.Sine.easeInOut,'automat':{'status':true,'period':5000},'type':'slideshow'});
new tools_slider('div.content div.insides.actuals div.scrolls',{'number':{'total':1,'period':1}});
new tools_search('div.content div.insides.searchs div.tableds',{'url':config['url']+'routes.php','language':initializeLangs['retrieve']});
new tools_slider('div.content div.insides.preview.photos div.scrolls',{'number':{'total':4,'period':4}});
new tools_slider('div.content div.insides.preview.movies div.scrolls',{'number':{'total':4,'period':4}});
new tools_slider('div.content div.insides.shopping div.scrolls',{'number':{'total':3,'period':3}});
new tools_blank('a.blank, a[rel="blank"]');
new tools_gallery('div.content div.insides.gallery',{'language':initializeLangs['retrieve']});
new tools_multibox('a.multibox.photos',{'url':config['url'],'language':initializeLangs['retrieve']});
new tools_multibox('a.multibox.slider',{'panel':{'panel':false,'slide':{'status':false,'automat':false,'duration':4000},'drag':{'status':false}},'url':config['url'],'language':initializeLangs['retrieve']});
new tools_multibox('span.multibox.alerts',{'url':config['url'],'automat':true,'language':initializeLangs['retrieve']});
new tools_emoticon('div.insides.message.formular');
new Tips($(document.body).getElements('label.wrongs'),{'className':'tooltip'});
new tools_slider('div.content div.insides.printed.product div.slideshow',{'number':{'total':1,'period':1},'transition':Fx.Transitions.Sine.easeInOut,'automat':{'status':true,'period':5000},'type':'slideshow'});
new tools_friend('div.tools div.friend',{'url':config['url']+'friend.php','language':initializeLangs['retrieve']});
new tools_print('div.tools a.icon.print');
new tools_favorite('div.tools a.icon.favorite',{'language':initializeLangs['retrieve']});
new tools_booking('input.booking',{'url':config['url']+'booking.php','delay':1000,'language':initializeLangs['retrieve']});

// definice transformacnich funkci formularu
new tools_input('label input[type="radio"][name^="distance"]');
new tools_input('label input[type="radio"][name^="length"]');
new tools_input('label input[type="radio"][name^="payment"]');
new tools_input('label input[type="checkbox"][name^="newsletter"]');
new tools_input('label input[type="checkbox"][name^="terms"]');

});
