
LSF={Net:{},UI:{},DOM:{},Data:{}};(function(){var func_toString=function(){return"[Delegate : function = "+method+", this = "+thisObject;};Delegate=function(thisObject,method){if(typeof method=='function'){var func=function(){return method.apply(thisObject,arguments);}}else{var func=function(){return thisObject[method].apply(thisObject,arguments);}}
func.toString=func_toString;return func;}
DelegateIterate=function(thisObject,objectList){if(typeof objectList=='function'){objectList=Delegate(objectList);}else if(objectList instanceof Array){for(var i=0;i<objectList.length;i++){objectList[i]=Delegate(thisObject,objectList[i]);}}else{for(var i in objectList){objectList[i]=Delegate(thisObject,objectList[i]);}}
return objectList;}
var browsers={opera:'opera',safari:'webkit',gecko:'gecko',ie:'msie'}
var br;var uag=navigator.userAgent.toLowerCase();for(var b in browsers){if(uag.indexOf(b)>-1)br=browsers[b];}
var ver=null;if(br==browsers.ie){ver=parseFloat(navigator.appVersion.match(/MSIE\s*(\d+(\.\d+)?)/)[1]);}
LSF.Browser={name:br,version:ver};})();LSF.emptyFunction=function(){}
LSF.abstractFunction=function(message){var fn=function(){throw new Error(message);}
fn.isAbstract=true;return fn;}
LSF.clone=function(obj){if(obj instanceof Array){var cloned=[];for(var i=0;i<obj.length;i++){cloned[i]=obj[i];}}else{var cloned={};for(var i in obj){cloned[i]=obj[i];}}
return cloned;}
LSF.each=function(array,callback,context){if(typeof context!='undefined'){if(array instanceof Array||(array.length&&typeof array.length=='number')){for(var i=0;i<array.length;i++){callback.call(context,array[i],i);}}else{for(var i in array){callback.call(context,array[i],i);}}}else{if(array instanceof Array||(array.length&&typeof array.length=='number')){for(var i=0;i<array.length;i++){callback(array[i],i);}}else{for(var i in array){callback(array[i],i);}}}}
LSF.quickAccess=function(shortHand,namespace,level){level=level||2;if(LSF_quickAccess>=level){window[shortHand]=namespace;}}
LSF.Callback={Modifier:function(modifier,callback){return function(response){var result=modifier(response);if(typeof callback=='function'){callback(result);}else{return result;}}},Helper:function(callback,preModifier,postModifier){var postM=LSF.Callback.Modifier(postModifier,callback);if(typeof callback=='function'){preModifier(postM);}else{return postM(preModifier());}}};LSF.Language={term:function(term){return term;},terms:{}};
(function(){if("".replace(/^/,String)){var default_replace=String.prototype.replace;String.prototype.replace=function(search,replace){if(typeof replace!="function"){return default_replace.apply(this,arguments)}
var str=""+this;var callback=replace;if(!(search instanceof RegExp)){var idx=str.indexOf(search);return idx==-1?str:default_replace.apply(str,[search,callback(search,idx,str)])}
var reg=search;var result=[];var lastidx=reg.lastIndex;var re;while((re=reg.exec(str))!=null){var idx=re.index;var args=re.concat(idx,str);result.push(str.slice(lastidx,idx),callback.apply(null,args).toString());if(!reg.global){lastidx+=RegExp.lastMatch.length;break}else{lastidx=reg.lastIndex;}}
result.push(str.slice(lastidx));return result.join("")}}
var camelizeCSSProperty=function(property){return property.replace(/\-([a-z])/g,function(){return RegExp.$1.toUpperCase()})}
if(typeof window.addEventListener=='undefined'){window.addEventListener=function(eventType,callback,dummy){window.attachEvent('on'+eventType,function(){var e=window.event;e.target=e.srcElement;e.preventDefault=function(){this.returnValue=false;}
callback(e);});}
document.addEventListener=function(eventType,callback,dummy){document.attachEvent('on'+eventType,function(){var e=window.event;e.target=e.srcElement;e.preventDefault=function(){this.returnValue=false;}
callback(e);});}}
window.addMainListener=function(eventType,callback){if(document.all){document.addEventListener(eventType,callback,null);}else{window.addEventListener(eventType,callback,true);}}
if(typeof window.getComputedStyle=='undefined'){window.getComputedStyle=function(element,pseudoclass){return new function(){this.getPropertyValue=function(property){return element.currentStyle[camelizeCSSProperty(property)];}}}}})();
(function(){var callerSupported=(function(){return typeof arguments.callee.caller=='function';})();var detectCaller=function(cls,caller,realParent){for(var i=cls.__proptable.length-1;i>=0;i--){var o=cls.__proptable[i];for(var prop in o[1]){if(o[1][prop]==caller){par=undefined;for(var j=i-1;realParent&&j>=0;j--){var po=cls.__proptable[j];if(po[1][prop]!=caller){break;}}
if(j>=0)par=cls.__proptable[j][1];return{caller:prop,callerClass:o[0],callerParent:par};}}}};var detectClass=function(cls,dClass){for(var i=0;i<cls.__proptable.length;i++){var o=cls.__proptable[i];if(o[0]==dClass)return o[1];}};var baseClass=function(){this.__construct.apply(this,arguments);};baseClass.prototype.__proptable=[];baseClass.prototype.__construct=function(){};baseClass.prototype.__callBaseMethod=function(){return detectClass(this,arguments[0])[arguments[1]].apply(this,Array.prototype.slice.apply(arguments,[2]));};if(callerSupported){baseClass.prototype.__callBase=function(){var info=detectCaller(this,arguments.callee.caller);return detectClass(this,arguments[0])[info.caller].apply(this,Array.prototype.slice.apply(arguments,[1]));}
baseClass.prototype.__callParentMethod=function(){var info=detectCaller(this,arguments.callee.caller);return info.callerParent[arguments[0]].apply(this,Array.prototype.slice.apply(arguments,[1]));}
baseClass.prototype.__callParent=function(){var info=detectCaller(this,arguments.callee.caller,true);return info.callerParent[info.caller].apply(this,arguments);}}else{baseClass.prototype.__callBase=function(){alert(this.__caller+"?");var info=detectCaller(this,this.__caller);return detectClass(this,arguments[0])[info.caller].apply(this,Array.prototype.slice.apply(arguments,[1]));}
baseClass.prototype.__callParentMethod=function(){var info=detectCaller(this,this.__caller);return info.callerParent[arguments[0]].apply(this,Array.prototype.slice.apply(arguments,[1]));}
baseClass.prototype.__callParent=function(){var info=detectCaller(this,this.__caller,true);return info.callerParent[info.caller].apply(this,arguments);}}
Class=function(properties,base){base=base||baseClass;var cls=function(){this.__construct.apply(this,arguments);}
for(var property in base.prototype){cls.prototype[property]=base.prototype[property];}
cls.prototype.__parent=base;if(callerSupported){for(var property in properties){cls.prototype[property]=properties[property];}}else{var functionWrapper=function(prop,property){return function(){this.__caller=arguments.callee;return prop.apply(this,arguments);}}
for(var property in properties){var prop=properties[property];if(typeof prop=='function'){cls.prototype[property]=functionWrapper(prop,property);}else{cls.prototype[property]=prop;}}}
var pt=[];var ppt=base.prototype.__proptable;for(var i=0;i<ppt.length;i++)pt.push(ppt[i]);pt.push([cls,cls.prototype]);cls.prototype.__proptable=pt;return cls;}})();
LSF.DOM.Element={mass:function(action,elements){var m=LSF.DOM.Element[action];LSF.each(elements,function(element){m(element);});},compatNode:function(node){node=LSF.DOM.Element.get(node);if(typeof node.addEventListener=='undefined')node.addEventListener=function(eventType,callback,dummy){node.attachEvent('on'+eventType,function(){callback(LSF.DOM.Event.compatEvent());});}
return node;},focus:function(element){setTimeout(function(){try{LSF.DOM.Element.get(element).focus();}catch(e){}},100);},toggle:function(element){element=LSF.DOM.Element.get(element);if(getComputedStyle(element,null).getPropertyValue('display')=='none'){element.style.display='block';}else{element.style.display='none';}},hide:function(element){element=LSF.DOM.Element.get(element);element.style.display='none';},show:function(element){element=LSF.DOM.Element.get(element);element.style.display='block';},hasClass:function(element,className){element=LSF.DOM.Element.get(element);var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');return re.test(element.className||'');},addClass:function(element,className){element=LSF.DOM.Element.get(element);if(LSF.DOM.Element.hasClass(element,className))return;element.className=element.className&&element.className.length?element.className+' '+className:className;},removeClass:function(element,className){element=LSF.DOM.Element.get(element);if(!LSF.DOM.Element.hasClass(element,className))return;element.className=element.className.replace(new RegExp('(^'+className+'( |$)| '+className+'\\b)'),'');},next:function(element){var e=element;do{e=e.nextSibling;if(!e)return;if(e.nodeType==1){return e;}}while(1);},previous:function(element){var e=element;do{e=e.previousSibling;if(!e)return;if(e.nodeType==1){return e;}}while(1);},get:function(elementRef){return typeof elementRef=='string'?document.getElementById(elementRef):elementRef;},fillCombo:function(combo,data,leaveFirst){combo.options.length=leaveFirst?1:0;for(var id in data){combo.options.add(new Option(data[id],id));}},camelizeCSSProperty:function(property){return property.replace(/\-([a-z])/g,function(){return RegExp.$1.toUpperCase()})},setAttributes:function(element,attributes){attributes=attributes||{};for(var i in attributes){if(i=='className'){element.className=attributes[i];}else if(i=='style'){for(var j in attributes[i]){element.style[LSF.DOM.Element.camelizeCSSProperty(j)]=attributes[i][j];}}else{element.setAttribute(i,attributes[i]);}}},addChildren:function(element,children){children=children||[];LSF.each(children,function(child){if(typeof child=='function'){child(element);}
if(typeof child=='string'||typeof child=='number'){child=document.createTextNode(child);}
try{element.appendChild(child);}catch(e){}});},setContent:function(container,contents){container.innerHTML='';if(typeof(contents)=='undefined')return;if(typeof(contents)=='string'||typeof(contents)=='number'){container.innerHTML=contents;return;}
if(typeof(contents)=='function'){contents(container);return;}
if(!(contents instanceof Array))contents=[contents];LSF.each(contents,function(content){container.appendChild(content);});},create:function(tag,attributes,children,parentNode){if(typeof children!='undefined'&&!(children instanceof Array))children=[children];var el=document.createElement(tag.toUpperCase());this.setAttributes(el,attributes);this.addChildren(el,children);if(typeof parentNode!='undefined'){parentNode.appendChild(el);}
return el;},createSpecial:{select:{}}};LSF.DOM.HTML={escape:function(html){return String(html).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");},unescape:function(html){var temp=document.createElement('DIV');temp.innerHTML=str;return temp.firstChild.nodeValue;}}
LSF.quickAccess('dom',LSF.DOM.Element);LSF.quickAccess('cn',LSF.DOM.Element.compatNode);LSF.quickAccess('$el',LSF.DOM.Element.get);
(function(){var zIndex=500;var currentIndex=0;var layerDefaultStyle={width:"100%",height:"100%",borderStyle:"none",display:"none",position:'fixed',overflow:'hidden',filter:'alpha(opacity=50)','-moz-opacity':.5,opacity:.5,backgroundColor:'black'};var layers=[document.createElement('DIV')];LSF.each(layers,function(layer,i){var layerStyle=layer.style;for(var prop in layerDefaultStyle){layerStyle[prop]=layerDefaultStyle[prop];}
layer.className='lsf_layer_fog';layer.id='lsf_layer_'+i;});var isInitialized=false;function init(){if(!isInitialized){document.body.insertBefore(layers[0],document.body.firstChild);isInitialized=true;}}
LSF.UI.LayerManager={requestLayer:function(){init();var needsShow=currentIndex==0;currentIndex++;zIndex+=3;LSF.each(layers,function(layer,i){layer.style.zIndex=zIndex-2+i;if(needsShow){layer.style.display='block';}});return zIndex;},disposeLayer:function(){init();zIndex-=3;currentIndex--;LSF.each(layers,function(layer,i){if(currentIndex==0){layer.style.display='none';layer.style.zIndex=0;}else{layer.style.zIndex=zIndex-2+i;}});return zIndex;}}})();
LSF.UI.Popup=new Class({__construct:function(content,options){options=options||{};this.cssClass=options.cssClass||'lsf_popup';this.container=LSF.DOM.Element.get(options.container)||document.body;var popup=document.createElement('DIV');popup.className=this.cssClass;popup.style.display='none';popup.style.position='absolute';if(options.position=='center'||options.position=='horizontal'){popup.style.left=((this.container.offsetWidth-(options.width||0))/2)+'px';}else{popup.style.left=(options.left||0)+'px';}
if(options.position=='center'||options.position=='vertical'){popup.style.top=((this.container.offsetHeight-(options.height||0))/2)+'px';}else{popup.style.top=(options.top||0)+'px';}
if(options.width)popup.style.width=options.width+'px';if(options.height)popup.style.height=options.height+'px';this.container.appendChild(popup);this.dom=popup;this.isShown=false;this.setContent(content);if(options.resizable){this.resizer=new LSF.UI.DragNDrop.ResizerFactory(popup,this.cssClass,options.resizable);}
this.fadeEffect=options.fade?parseFloat(options.fade):false;if(isNaN(this.fadeEffect))this.fadeEffect=1;},setContent:function(content){LSF.DOM.Element.setContent(this.dom,content);},show:function(callback){callback=typeof callback=='function'?callback:LSF.emptyFunction;if(this.isShown)return;this.dom.style.zIndex=LSF.UI.LayerManager.requestLayer();this.dom.style.display='block';this.isShown=true;if(this.fadeEffect){f=new LSF.UI.Effects.Fader(this.dom);f.run(0,1,this.fadeEffect*1000,callback);}else{callback(this);}},hide:function(callback){callback=typeof callback=='function'?callback:LSF.emptyFunction;if(!this.isShown)return;var whenDone=Delegate(this,function(){this.isShown=false;this.dom.style.display='none';LSF.UI.LayerManager.disposeLayer();callback(this);});if(this.fadeEffect){f=new LSF.UI.Effects.Fader(this.dom);f.run(1,0,this.fadeEffect*1000,whenDone);}else{whenDone();}},destroy:function(){this.dom.parentNode.removeChild(this.dom);}});
LSF.DOM.Event={addMainListener:function(eventType,callback){if(document.all){document.addEventListener(eventType,callback,null);}else{window.addEventListener(eventType,callback,true);}},preventDefaultCallback:function(event){event.preventDefault();},compatEvent:function(event){var e=event||window.event;e.target=e.target||e.srcElement;if(typeof e.preventDefault!='function'){e.preventDefault=function(){this.returnValue=false;}}
if(typeof e.stopPropagation!='function'){e.stopPropagation=function(){this.cancelBubble=true;}}
return e;},simulateMouseClick:function(node){try{var evt=document.createEvent("MouseEvents");evt.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);node.dispatchEvent(evt);}catch(e){node.fireEvent('onclick');}}};(function(){var isLoaded=false;var safariTimer=undefined;var callbacks=[];var onLoad=function(){if(isLoaded)return;isLoaded=true;if(typeof safariTimer!='undefined')clearInterval(safariTimer);if(LSF.Browser.name=='gecko'||LSF.Browser.name=='opera'){document.removeEventListener("DOMContentLoaded",onLoad,true)}
for(var i=0;i<callbacks.length;i++){callbacks[i]();}
callbacks=null;}
LSF.DOM.Event.onload=function(callback){callbacks.push(callback);}
if(LSF.Browser.name=='gecko'||LSF.Browser.name=='opera'){document.addEventListener("DOMContentLoaded",onLoad,true);}else if(LSF.Browser.name=='msie'){document.write('<scr'+'ipt id="lsf_event_onload_defer" defer="defer" src="/'+'/:"></scr'+"ipt>");var script=document.getElementById('lsf_event_onload_defer');script.attachEvent('onreadystatechange',function(){if(script.readyState=="complete")onLoad();});}else{safariTimer=setInterval(function(){var state=document.readyState;if(state=="loaded"||state=="complete")onLoad();},10);}
window.onload=onLoad;})();LSF.quickAccess('$onload',LSF.DOM.Event.onload);
LSF.UI.DragNDrop={};LSF.UI.DragNDrop.Listener=new Class({__construct:function(boxClassName,draggerClassName,handler){this.boxClassName=boxClassName;this.draggerClassName=draggerClassName||boxClassName;this.dragObject=undefined;this.handler=handler||new LSF.UI.DragNDrop.Mover();LSF.DOM.Event.addMainListener('mousedown',Delegate(this,'mouseDown'));LSF.DOM.Event.addMainListener('mousemove',Delegate(this,'mouseMove'));LSF.DOM.Event.addMainListener('mouseup',Delegate(this,'mouseUp'));},findRelativeObject:function(element){var el=element;while(el.nodeName!='#document'){var pos=getComputedStyle(el,null).getPropertyValue('position');if(pos=='absolute'||pos=='relative')return el;el=el.parentNode;}
return document.body;},findDragObject:function(element,className){var el=element;while(el.nodeName!='#document'){if(LSF.DOM.Element.hasClass(el,className))return el;el=el.parentNode;}},mouseDown:function(event){var dragger=this.findDragObject(event.target,this.draggerClassName);if(dragger){var box=this.findDragObject(dragger,this.boxClassName);}
if(box){this.parentContainer=this.findRelativeObject(box.parentNode);this.dragObject=box;this.startX=event.screenX;this.startY=event.screenY;this.handler.storeInitialState(this);}},mouseMove:function(event){if(typeof this.dragObject!='undefined'){this.handler.setCurrentState(this,event.screenX-this.startX,event.screenY-this.startY);}},mouseUp:function(event){if(typeof this.dragObject!='undefined'){this.dragObject=undefined;}}});LSF.UI.DragNDrop.Mover=new Class({__construct:function(){},storeInitialState:function(listener){this.dragX=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('left'));this.dragY=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('top'));},setCurrentState:function(listener,offsetX,offsetY){var posX=this.dragX+offsetX;var posY=this.dragY+offsetY;if(posX+listener.dragObject.offsetWidth>listener.parentContainer.scrollWidth){posX=listener.parentContainer.scrollWidth-listener.dragObject.offsetWidth;}
if(posY+listener.dragObject.offsetHeight>listener.parentContainer.scrollHeight){posY=listener.parentContainer.scrollHeight-listener.dragObject.offsetHeight;}
if(posX<0)posX=0;if(posY<0)posY=0;listener.dragObject.style.left=posX+'px';listener.dragObject.style.top=posY+'px';}});LSF.UI.DragNDrop.Resizer=new Class({__construct:function(directionX,directionY,minWidth,minHeight){if(directionX>1)directionX=1;if(directionX<-1)directionX=-1;if(directionX>1)directionY=1;if(directionX<-1)directionY=-1;this.directionX=directionX;this.directionY=directionY;this.minWidth=minWidth;this.minHeight=minHeight;},storeInitialState:function(listener){this.dragX=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('left'));this.dragY=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('top'));this.dragW=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('width'));this.dragH=parseInt(getComputedStyle(listener.dragObject,null).getPropertyValue('height'));},setCurrentState:function(listener,offsetX,offsetY){var posX=this.directionX==-1?this.dragX+offsetX:this.dragX;var posY=this.directionY==-1?this.dragY+offsetY:this.dragY;var sizeX=this.directionX==0?this.dragW:this.dragW+offsetX*this.directionX;var sizeY=this.directionY==0?this.dragH:this.dragH+offsetY*this.directionY;if(this.minWidth!==false&&sizeX<this.minWidth){if(this.directionX==-1){posX-=this.minWidth-sizeX;}
sizeX=this.minWidth;}
if(this.minHeight!==false&&sizeY<this.minHeight){if(this.directionY==-1){posY-=this.minHeight-sizeY;}
sizeY=this.minHeight;}
if(posX+listener.dragObject.offsetWidth>listener.parentContainer.scrollWidth){posX=listener.parentContainer.scrollWidth-listener.dragObject.offsetWidth;}
if(posY+listener.dragObject.offsetHeight>listener.parentContainer.scrollHeight){posY=listener.parentContainer.scrollHeight-listener.dragObject.offsetHeight;}
if(posX<0)posX=0;if(posY<0)posY=0;listener.dragObject.style.left=posX+'px';listener.dragObject.style.top=posY+'px';listener.dragObject.style.width=sizeX+'px';listener.dragObject.style.height=sizeY+'px';}});(function(){var directionMapping={top:[0,-1],bottom:[0,1],left:[-1,0],right:[1,0],top_left:[-1,-1],top_right:[1,-1],bottom_left:[-1,1],bottom_right:[1,1]}
LSF.UI.DragNDrop.ResizerFactory=new Class({__construct:function(container,containerClassName,options){this.container=container
this.containerClassName=containerClassName;if(options===true){options={horizontal:true,vertical:true}}
this.minWidth=options.minWidth||false;this.minHeight=options.minHeight||false;this.cssClassBase=options.cssClassBase||'lsf_ui_resizer';this.horizontal=options.horizontal;this.vertical=options.vertical;this.dom=[];this.createResizers();},createResizers:function(){var hasBottom=this.vertical===true||this.vertical=='bottom';var hasTop=this.vertical===true||this.vertical=='top';var hasRight=this.horizontal===true||this.horizontal=='right';var hasLeft=this.vertical===true||this.vertical=='top';var hasBottomRight=hasBottom&&hasRight;var hasBottomLeft=hasBottom&&hasLeft;var hasTopRight=hasTop&&hasRight;var hasTopLeft=hasTop&&hasLeft;if(hasBottom)this.createResizer('bottom');if(hasTop)this.createResizer('top');if(hasRight)this.createResizer('right');if(hasLeft)this.createResizer('left');if(hasBottomRight)this.createResizer('bottom_right');if(hasBottomLeft)this.createResizer('bottom_left');if(hasTopRight)this.createResizer('top_right');if(hasTopLeft)this.createResizer('top_left');},createResizer:function(position){var dom=document.createElement('div');dom.className=this.cssClassBase+' '+this.cssClassBase+'_'+position;dom.innerHTML=' ';var dm=directionMapping[position];var temp=new LSF.UI.DragNDrop.Listener(this.containerClassName,this.cssClassBase+'_'+position,new LSF.UI.DragNDrop.Resizer(dm[0],dm[1],this.minWidth,this.minHeight));this.container.appendChild(dom);this.dom[position]=dom;}});})();
(function(){LSF.UI.PopupWindow=new Class({__construct:function(title,content,options){options=options||{};titleCssClass=options.titleBarCssClass||'lsf_popupwindow_titlebar';this.titleBar=LSF.DOM.Element.create('div',{className:titleCssClass});this.setTitle(title);if(options.onClose){var closeButton=LSF.DOM.Element.create('div',{className:options.closeButtonCssClass||'lsf_popupwindow_closebutton'},'x');LSF.DOM.Element.compatNode(closeButton).addEventListener('click',options.onClose,true);this.titleBar.insertBefore(closeButton,this.titleBar.firstChild);}
this.contentBar=LSF.DOM.Element.create('div',{className:options.contentBarCssClass||'lsf_popupwindow_contentbar'});this.setContent(content);this.popup=new LSF.UI.Popup([this.titleBar,this.contentBar],options);this.windowCssClass=options.windowCssClass||'lsf_popupwindow';LSF.DOM.Element.addClass(this.popup.dom,this.windowCssClass);this.dragger=new LSF.UI.DragNDrop.Listener(this.windowCssClass,titleCssClass);},show:function(callback){this.popup.show(callback);},hide:function(callback){this.popup.hide(callback);},setContent:function(content){LSF.DOM.Element.setContent(this.contentBar,content);},setTitle:function(content){LSF.DOM.Element.setContent(this.titleBar,content);},destroy:function(){this.popup.destroy();}});var popups=[];LSF.UI.PopupWindowManager={open:function(title,content,options){var popup=new LSF.UI.PopupWindow(title,content,options);popup.show();popups.push(popup);return popup;},close:function(){var popup=popups.pop();popup.hide(function(){popup.destroy();popup=null;});},setTopTitle:function(content){popups[popups.length-1].setTitle(content);}};})();
Carousel={register:function(container,itemsShown,itemsCount,itemWidth,jumpStep){var l=document.getElementById(container+'_move_left');if(!l)return;var r=document.getElementById(container+'_move_right');var w=document.getElementById(container+'_items_wrapper');jumpStep=jumpStep||1
var isRunning=false;var dx,to;var z=function(){w.scrollLeft+=dx;if(w.scrollLeft==to){isRunning=false;return;}
setTimeout(z,3);}
l.onclick=function(){if(isRunning)return false;if(w.scrollLeft>0){isRunning=true;dx=-jumpStep;to=w.scrollLeft-itemWidth;z();}
return false;}
r.onclick=function(){if(isRunning)return false;if(w.scrollLeft<(itemsCount-itemsShown)*itemWidth){isRunning=true;dx=+jumpStep;to=w.scrollLeft+itemWidth;z();}
return false;}
return function(){return w.scrollLeft/itemWidth;}}}