/**	
 * JooS framework
 *
 * @license MIT
 * @author Andrey Mindubaev, http://joos.nnov.ru/
 * @version 1.0
 */


var JooS={Reflect:(function(F){return function(source,methods){if(!methods)
methods={};if(source){if(!source.prototype.__constructor)
source.prototype.__constructor=source;F.prototype=source.prototype;}
else
F.prototype={constructor:source=F};var c;if(methods.__constructor){F.prototype=new F;c=this.Virtual(F,{__constructor:methods.__constructor}).prototype.__constructor;c.prototype=new F;delete methods.__constructor;}
else{c=function(){if(this.__constructor)
this.__constructor.apply(this,arguments);};c.prototype=new F;}
c.constructor=source;return c.prototype.constructor=this.Virtual(c,methods);}})(new Function),Virtual:(function(hidden){var __index=1;var __extend=function(constructor,name,__self){var __parent=constructor.prototype[name],method;if(typeof __self=="function"){var __selfName=__self.__name=name+"::"+__index++;constructor.prototype[__selfName]=__self;if(__parent&&typeof __parent=="function"){var __thisObj,__originalParent=__self.__parent=__parent.__self||__parent;method=function(a1,a2,a3){__thisObj=this;__parent=__originalParent;switch(arguments.length){case 0:return this[__selfName]();case 1:return this[__selfName](a1);case 2:return this[__selfName](a1,a2);case 3:return this[__selfName](a1,a2,a3);default:return __self.apply(this,arguments);}};method.__parent=function(a1,a2,a3){var o=__parent,r;__parent=o.__parent;switch(arguments.length){case 0:r=__thisObj[o.__name]();break;case 1:r=__thisObj[o.__name](a1);break;case 2:r=__thisObj[o.__name](a1,a2);break;case 3:r=__thisObj[o.__name](a1,a2,a3);break;default:r=o.apply(__thisObj,arguments);}
__parent=o;return r;};method.__self=__self;}}
constructor.prototype[name]=method||__self;};for(var IE="IE"in{toString:IE})
hidden=false;return function(constructor,methods){for(var name in methods)
__extend(constructor,name,methods[name]);if(hidden)
for(var i=0;i<hidden.length,name=hidden[i];i++)
if(methods.hasOwnProperty(name))
__extend(constructor,name,methods[name]);return constructor;};})(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Mixin:function(destination,source){for(var i in source.prototype)
if(!destination.prototype[i]&&i!="constructor")
destination.prototype[i]=source.prototype[i];},Clone:(function(F){return function(Obj){F.prototype=Obj||{};return new F();};})(new Function),Extend:function(destination,source){for(var i in source)
destination[i]=source[i];return destination;}};JooS.Plugin=JooS.Mixin;JooS.Browser=new function(){var n,v,t,ua=navigator.userAgent;if(window.opera)
n="Opera",v=window.opera.version();else if(/*@cc_on!@*/false)
n="IE",v=parseInt(ua.match(/MSIE\s(\d+\.\d+)/)[1]);else if(t=ua.match(/AppleWebKit\/([\d.]+)/)){n="Safari";t=parseFloat(t[1]);if(t<522.11)v=2;else if(t<525.13)v=3;else if(t<526.9)v=3.1;else v=4;}
else if(t=ua.match(/\sGecko\/(\d{6})/)){n="Firefox";t=parseFloat(t[1]);if(t<200411)v=0.1;else if(t<200511)v=1;else if(t<200610)v=1.5;else if(t<200806)t=2.0;else v=3;}
else
n="Mobile",v=1;this.name=n;this[n]=this.version=v;this.pngExt=(this.IE&&this.IE<5.5?"gif":"png");this.pngClass=(this.IE&&this.IE<7?"png_scale":"");};JooS.Class=JooS.Reflect(null,{__common:new Object(),__destroy:function(){arguments.length?this.__destructor.apply(this,arguments):this.__destructor();},__constructor:function(){},__destructor:function(){}});JooS.Class.Plugin=JooS.Reflect(null);JooS.Settings=JooS.Reflect(JooS.Class,{getSettingsId:function(){return"JooS";},__constructor:function(Settings){this.__common[this.getSettingsId()]=this;JooS.Extend(this,Settings);}});JooS.Closure={Value:function(value){return function(){return value;};},Function:function(Action,Context){return function(){return Action.apply(Context||window,arguments);}}};JooS.Startup=(function(){var pageStartupActions=[],pageStarted=false;function onLoad(){if(!pageStarted){pageStarted=true;for(var i=0;i<pageStartupActions.length;i++)
pageStartupActions[i]();}
window.onload=null;};var Startup=function(Action){if(pageStarted)
Action();else{if(!pageStartupActions.length){if(this.Browser.Firefox||this.Browser.Opera>=9)
document.addEventListener("DOMContentLoaded",onLoad,false);else if(this.Browser.Safari){var __timer=setInterval(function(){if(/loaded|complete/.test(document.readyState))
clearInterval(__timer);},100);}
window.onload=onLoad;}
pageStartupActions.push(Action);}};Startup.onLoad_IEDefer=function(script){if(script.readyState=="complete")
onLoad();};return Startup;}());JooS.Fx=(function(optionsList){return JooS.Reflect(null,{fps:10,duration:500,transition:function(p){return p;},onStart:function(from){},onStep:function(delta){},onComplete:function(to){},setFps:function(fps){this.fps=fps;return this;},setDuration:function(duration){this.duration=duration;return this;},step:function(){var time=this.now();if(time<this.time+this.duration){var delta=this.transition((time-this.time)/this.duration);this.onStep.call(this.subject,this.compute(this.from,this.to,delta));this.startTimer();}
else{this.onStep.call(this.subject,this.compute(this.from,this.to,1));this.onComplete.call(this.subject,this.to);}},compute:function(from,to,delta){return from+(to-from)*delta;},startTimer:function(){this.timer=setTimeout(JooS.Closure.Function(this.step,this),this.fps);},stopTimer:function(){clearTimeout(this.timer);},start:function(from,to){this.stopTimer();this.from=from;this.to=to;this.time=this.now();this.step();this.onStart.call(this.subject,from);},now:(function(){return Date.now||function(){return new Date().getTime();};})(),__constructor:function(subject,options){options=options||{};this.subject=subject;var i,j;for(i in optionsList){j=optionsList[i];if(options[j])
this[j]=options[j];}}});})(["fps","duration","transition","onStart","onStep","onComplete"]);JooS.Fx.Transition=function(name,params){var m=name.split(":"),transition=JooS.Fx.Transitions[m[0]]||JooS.Fx.Transitions.Linear,ret;params=params||[];switch(m[1]){case"InOut":ret=function(pos){return(pos<=0.5)?transition(2*pos,params)*0.5:(2-transition(2*(1-pos),params))*0.5;};break;case"Out":ret=function(pos){return 1-transition(1-pos,params);};break;case"In":default:ret=function(pos){return transition(pos,params);};}
return ret;};JooS.Fx.Transitions={Expo:function(p){return Math.pow(2,8*(p-1));},Circ:function(p){return 1-Math.sin(Math.acos(p));},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2);},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x);},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3);}};(function(names){var i,name;for(i=0;i<names.length;i++){JooS.Fx.Transitions[names[i]]=(function(i){return function(p){return Math.pow(p,i+1);};})(i);}})(['Linear','Quad','Cubic','Quart','Quint']);JooS.XPathSelector=(function(){var cacheXPath={},cssToXPath=function(rule){var regElement=/^([#.]?)([a-z0-9\\*_-]*)((\|)([a-z0-9\\*_-]*))?/i;var regAttr1=/^\[([^\]]*)\]/i;var regAttr2=/^\[\s*([^~=\s]+)\s*(~?=)\s*"([^"]+)"\s*\]/i;var regPseudo=/^:([a-z_-])+/i;var regCombinator=/^(\s*[>+\s])?/i;var regComma=/^\s*,/i;var index=1;var parts=["descendant::","*"];var lastRule=null;while(rule.length&&rule!=lastRule){lastRule=rule;rule=rule.replace(/^\s*|\s*$/g,"");if(!rule.length)
break;var m=regElement.exec(rule);if(m){if(!m[1]){if(m[5])
parts[index]=m[5];else
parts[index]=m[2];}
else if(m[1]=='#')
parts.push("[@id='"+m[2]+"']");else if(m[1]=='.')
parts.push("[contains(concat(' ',normalize-space(@class),' '), ' "+m[2]+" ')]");rule=rule.substr(m[0].length);}
m=regAttr2.exec(rule);if(m){if(m[2]=="~=")
parts.push("[contains(@"+m[1]+", '"+m[3]+"')]");else
parts.push("[@"+m[1]+"='"+m[3]+"']");rule=rule.substr(m[0].length);}
else{m=regAttr1.exec(rule);if(m){parts.push("[@"+m[1]+"]");rule=rule.substr(m[0].length);}}
m=regPseudo.exec(rule);while(m){rule=rule.substr(m[0].length);m=regPseudo.exec(rule);}
m=regCombinator.exec(rule);if(m&&m[0].length){if(m[0].indexOf(">")!=-1)
parts.push("/");else if(m[0].indexOf("+")!=-1)
parts.push("/following-sibling::");else
parts.push("/descendant::");index=parts.length;parts.push("*");rule=rule.substr(m[0].length);}
m=regComma.exec(rule);if(m){parts.push(" | ","descendant::","*");index=parts.length-1;rule=rule.substr(m[0].length);}};return parts.join("");};return function(rule,elem){var xpath=cacheXPath[rule]||(cacheXPath[rule]=cssToXPath(rule));var result=document.evaluate(xpath,elem,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);var nodes=[];for(var item=result.iterateNext();item;item=result.iterateNext())
nodes.push(item);return nodes;};})();JooS.jQuerySelector=function(){var styleFloat=/*@cc_on!@*/false?"styleFloat":"cssFloat";var chars=(JooS.Browser.Safari&&JooS.Browser.Safari<2)||(JooS.Browser.Opera&&JooS.Browser.Opera<8)?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)";var quickChild=new RegExp("^>\\s*("+chars+"+)");var quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)");var quickClass=new RegExp("^([#.]?)("+chars+"*)");return{props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength",selectedIndex:"selectedIndex",defaultValue:"defaultValue",tagName:"tagName",nodeName:"nodeName"},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},merge:function(first,second){if(JooS.Browser.IE){for(var i=0;second[i];i++)
if(second[i].nodeType!=8)
first.push(second[i]);}
else{for(var i=0;second[i];i++)
first.push(second[i]);}
return first;},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,new RegExp("^([:.#]*)("+chars+"+)")],find:function(t,context,namespaceURIs){namespaceURIs=namespaceURIs||{};if(typeof t!="string")
return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)
return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=this.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)
for(var c=ret[i].firstChild;c;c=c.nextSibling)
if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))
r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}
if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=this.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}
m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!this.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((JooS.Browser.IE||JooS.Browser.Opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])
oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||this.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")
tag="param";r=this.merge(r,namespaceURIs[tag]?ret[i].getElementsByTagNameNS(namespaceURIs[tag],tag):ret[i].getElementsByTagName(tag));}
if(m[1]==".")
r=this.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)
if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}
r=tmp;}
ret=r;}
t=t.replace(re2,"");}}
if(t){var val=this.filter(t,r);ret=r=val.r;t=this.trim(val.t);}}
if(t)
ret=[];if(ret&&context==ret[0])
ret.shift();done=this.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)
tmp.push(r[i]);}
return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=this.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}
if(!m)
break;if(m[1]==".")
r=this.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],an=this.props[m[2]];var z=(an?a[an]:a.getAttribute(m[2]))||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)
tmp.push(a);}
r=tmp;}}
return{r:r,t:t};}};}();JooS.cssQuery=function(rule,elem,namespaceURIs){elem=elem||document;if(elem.querySelectorAll)
return elem.querySelectorAll(rule);else if(document.evaluate)
return this.XPathSelector(rule,elem);else
return this.jQuerySelector.find(rule,elem,namespaceURIs);};JooS.DOMEvent=JooS.Reflect(null,{launch:function(joosObj){var pfx=this.getEventEntryPrefix(),returnValue=false,i,cnt=joosObj.eventActions[this.type];for(i=1;cnt&&i<=cnt;i++)
returnValue=returnValue||joosObj[pfx+i](this);if(!returnValue)
this.preventDefault();},screenX:function(){return this.event.screenX;},screenY:function(){return this.event.screenY;},clientX:function(){return this.event.clientX;},clientY:function(){return this.event.clientY;},button:function(){return this.event.button;},wheelData:function(){var Delta=0;if(this.event.wheelDelta)
Delta=this.event.wheelDelta/120;else if(this.event.detail)
Delta=-this.event.detail/3;return Delta;},ctrlKey:function(){return this.event.ctrlKey;},altKey:function(){return this.event.altKey;},shiftKey:function(){return this.event.shiftKey;},keyCode:function(){return this.event.keyCode?this.event.keyCode:(this.event.which?this.event.which:this.event.charCode);},getEventEntryPrefix:function(Name){return"__eventEntry_"+(Name||this.type)+"_";},__constructor:function(event){this.event=event||window.event;this.type=this.event.type;},__destroy:function(){this.event=null;}});if(window.attachEvent){JooS.Virtual(JooS.DOMEvent,{preventDefault:function(){this.event.cancelBubble=true;this.event.returnValue=false;},offsetX:function(){return this.event.offsetX;},offsetY:function(){return this.event.offsetY;}});}
else{JooS.Virtual(JooS.DOMEvent,{preventDefault:function(){this.event.preventDefault();},offsetX:function(){return this.event.layerX;},offsetY:function(){return this.event.layerY;}});}
JooS.Extend(JooS.DOMEvent,{getEventName:function(Name){switch(Name){case"mousewheel":if(!JooS.Browser.Opera&&!JooS.Browser.Safari&&window.addEventListener)
Name="DOMMouseScroll";break;case"contextmenu":if(JooS.Browser.Opera)
Name=false;break;};return Name;},getEventEntryPrefix:JooS.DOMEvent.prototype.getEventEntryPrefix});JooS.NamespaceURI=(function(){var NamespaceURIs={},defaultName="@";return{register:function(prefix,URI){NamespaceURIs[prefix||defaultName]=URI;},get:function(prefix){return NamespaceURIs[prefix||defaultName]||false;}};})();JooS.NamespaceURI.register("","http://www.w3.org/1999/xhtml");JooS.NamespaceURI.register("joos","http://joos.nnov.ru/xmlns/joos");JooS.NamespaceURI.register("jsont","http://joos.nnov.ru/xmlns/jsont");JooS.Element=JooS.Reflect(JooS.Class,{prefix:"",getElementProperties:function(){return false;},getElementStyles:function(){return false;},getElement:function(TagName){if(!this.htmlElement){TagName=(this.prefix?this.prefix+":":"")+(TagName||this.TagName||"div");this.htmlElement=JooS.Browser.IE?document.createElement(TagName):document.createElementNS(JooS.NamespaceURI.get(this.prefix),TagName);if(window.$)
this.$=$(this.htmlElement);}
JooS.Extend(this.htmlElement,this.getElementProperties());JooS.Extend(this.htmlElement.style,this.getElementStyles());this.getElement=this.__getElement;return this.htmlElement;},__getElement:function(){return this.htmlElement;},create__eventEntry:function(){var joosObj=this;this.__eventEntry=function(event){var evt=new JooS.DOMEvent(event);evt.launch(joosObj);}},attachEvent:function(Name,Func){if(!this.__eventEntry)
this.create__eventEntry();if(Name=JooS.DOMEvent.getEventName(Name)){if(!this.eventActions[Name])
if(window.attachEvent)
this.getElement().attachEvent("on"+Name,this.__eventEntry);else
this.getElement().addEventListener(Name,this.__eventEntry,false);this.eventActions[Name]=this.eventActions[Name]?this.eventActions[Name]+1:1;this[JooS.DOMEvent.getEventEntryPrefix(Name)+this.eventActions[Name]]=Func;}},detachEvent:function(Name){if(Name=JooS.DOMEvent.getEventName(Name)){if(this.eventActions[Name]){if(window.attachEvent)
this.getElement().detachEvent("on"+Name,this.__eventEntry);else
this.getElement().removeEventListener(Name,this.__eventEntry,false);this.eventActions[Name]=null;}}},appendChild:function(Element){this.getElement().appendChild(Element.getElement());return this;},prependChild:function(Element){if(this.getElement().firstChild){this.getElement().insertBefore(Element.getElement(),this.getElement().firstChild);return this;}
else
return this.appendChild(Element);},insertBefore:function(Element,beforeElement){this.getElement().insertBefore(Element.getElement(),beforeElement.getElement());},removeChild:function(Element){this.getElement().removeChild(Element.getElement());return this;},removeNode:function(){if(this.htmlElement){var parentNode=this.htmlElement.parentNode;if(parentNode)
parentNode.removeChild(this.htmlElement);}},cssQuery:function(rule,namespaceURIs){return JooS.cssQuery(rule,this.getElement(),namespaceURIs);},cssQueryStrict:function(rule,namespaceURIs){var tmpClassName="strict_rule"+parseInt(Math.random()*1000),Ret;this.addClassName(tmpClassName);Ret=JooS.cssQuery("."+tmpClassName+" > "+rule,this.getElement().parentNode,namespaceURIs);this.removeClassName(tmpClassName);return Ret;},hasAttribute:function(name){return this.getElement().hasAttribute(name);},getAttribute:function(name){return this.getElement().getAttribute(name);},setAttribute:function(name,value){return this.getElement().setAttribute(name,value);},removeAttribute:function(name){return this.getElement().removeAttribute(name);},getAttributes:function(){var attrs=this.getElement().attributes,i,attr,ret={},value,name;for(i=0;i<attrs.length;i++){attr=attrs.item(i);if(JooS.Browser.IE&&!attr.value)
continue;ret[attr.name.toLowerCase()]=attr.value;}
return ret;},addClassName:function(className,elem){elem=elem||this.getElement();var currentClass=elem.className;if(!new RegExp(("(^|\\s)"+className+"(\\s|$)"),"i").test(currentClass)){elem.className=currentClass+(currentClass?" ":"")+className;}
return this;},removeClassName:function(className,elem){elem=elem||this.getElement();var classToRemove=new RegExp(("(^|\\s)"+className+"(\\s|$)"),"i");elem.className=(elem.className).replace(classToRemove,function(match){var retVal="";if(new RegExp("^\\s+.*\\s+$").test(match)){retVal=match.replace(/(\s+).+/,"$1");}
return retVal;}).replace(/^\s+|\s+$/g,"");return this;},replaceClassName:function(className,newClass,elem){elem=elem||this.getElement();var classToRemove=new RegExp(("(^|\\s)"+className+"(\\s|$)"),"i");elem.className=(elem.className||"").replace(classToRemove,function(match,p1,p2){var retVal=p1+newClass+p2;if(new RegExp("^\\s+.*\\s+$").test(match)){retVal=match.replace(/(\s+).+/,"$1");}
return retVal;}).replace(/^\s+|\s+$/g,"");return this;},hasClassName:function(className){return new RegExp(("(^|\\s)"+className+"(\\s|$)"),"i").test(this.getElement().className);},setStyle:function(name,value){this.getElement().style[name]=value;},getStyle:function(prop,elem){var currentStyle=[];elem=elem||this.getElement();if(document.defaultView&&document.defaultView.getComputedStyle)
currentStyle=document.defaultView.getComputedStyle(elem,null);else if(elem.currentStyle)
currentStyle=elem.currentStyle;return currentStyle[prop]||"";},__constructor:function(Tag,Properties,Styles){this.eventActions=[];if(Properties)
this.getElementProperties=JooS.Closure.Value(Properties);if(Styles)
this.getElementStyles=JooS.Closure.Value(Styles);if(Tag&&typeof Tag!="string"){this.htmlElement=Tag;this.getElement();}
else{if(Tag=="input"&&JooS.Browser.IE){var type=(Properties&&Properties.type)||"text";Tag="<input type='"+type+"' />";}
this.htmlElement=null;this.TagName=Tag;}},__destructor:function(){for(var i in this.eventActions)
this.detachEvent(i);this.htmlElement=null;}});JooS.TextElement=JooS.Reflect(JooS.Class,{getElement:function(nodeValue){if(!this.__htmlInit){if(!this.htmlElement)
this.htmlElement=document.createTextNode(nodeValue||this.nodeValue);this.__htmlInit=true;}
return this.htmlElement;},getNodeValue:function(){return this.getElement().nodeValue;},setNodeValue:function(nodeValue){this.getElement().nodeValue=nodeValue;},removeNode:JooS.Element.prototype.removeNode,__constructor:function(nodeValue){if(!nodeValue||typeof nodeValue=="string")
this.nodeValue=nodeValue||"";else
this.htmlElement=nodeValue;}});JooS.Element.Fx=JooS.Reflect(JooS.Fx,{beforeStartAction:function(){},onStart:function(value){this.beforeStartAction.call(this.subject);for(var i=0;i<this.actions.length;i++)
this.actions[i].onStart(value)},beforeStepAction:function(){},onStep:function(value){this.beforeStepAction.call(this.subject,value);for(var i=0;i<this.actions.length;i++)
this.actions[i].onStep(value);this.afterStepAction.call(this.subject,value);},afterStepAction:function(){},onComplete:function(value){for(var i=0;i<this.actions.length;i++)
this.actions[i].onComplete(value);this.afterCompleteAction.call(this.subject);},afterCompleteAction:function(){},beforeStart:function(func){this.beforeStartAction=func;return this;},beforeStep:function(func){this.beforeStepAction=func;return this;},afterStep:function(func){this.afterStepAction=func;return this;},afterComplete:function(func){this.afterCompleteAction=func;return this;},start:function(){this.start.__parent(0,1);},append:function(action){this.actions.push(action);},__constructor:function(subject){this.__constructor.__parent(this,{});this.Element=subject;this.actions=[];}});JooS.Virtual(JooS.Element,{Fx:function(){return new JooS.Element.Fx(this);}});(function(){var Action=JooS.Reflect(null,{onStart:function(value){},onStep:function(value){},onComplete:function(value){},setFrom:function(from){this.from=from;},setTo:function(to){this.to=to;},__constructor:function(Fx,property,transition,from,to){this.Fx=Fx;this.property=property;if(to==undefined){to=from;from=this.getFrom();}
this.setFrom(from);this.setTo(to);this.transition=JooS.Fx.Transition(transition);Fx.append(this);}});var NumberAction=JooS.Reflect(Action,{onStep:function(value){this.setValue(this.computeValue(this.transition(value)));},computeValue:function(value){return parseInt(this.from+(this.to-this.from)*value);},parseNumber:function(value){var number=value.toString().match(/^(-?\d+)(.*)/);if(number){this.unit=number[2];return number[1]*1;}
else
return 0;},setFrom:function(value){this.setFrom.__parent(this.parseNumber(value));},setTo:function(value){this.setTo.__parent(this.parseNumber(value));},__constructor:function(Fx,property,transition,from,to){this.unit="";this.__constructor.__parent(Fx,property,transition,from,to);}});var StringAction=JooS.Reflect(Action,{onStart:function(value){this.setValue(this.from);},onComplete:function(value){this.setValue(this.to);},__constructor:function(Fx,property,from,to){this.__constructor.__parent(Fx,property,"",from,to);}});JooS.Extend(JooS.Element.Fx,{styleNumber:JooS.Reflect(NumberAction,{getFrom:function(){return this.Fx.Element.getStyle(this.property);},setValue:function(value){try{this.Fx.Element.setStyle(this.property,value+this.unit);}catch(e){};}}),styleString:JooS.Reflect(StringAction,{getFrom:function(){return this.Fx.Element.getStyle(this.property);},setValue:function(value){try{this.Fx.Element.setStyle(this.property,value);}catch(e){};}}),attrNumber:JooS.Reflect(NumberAction,{getFrom:function(){return this.Fx.Element.getElement()[this.property];},setValue:function(value){try{this.Fx.Element.getElement()[this.property]=value+this.unit;}catch(e){};}}),attrString:JooS.Reflect(StringAction,{getFrom:function(){return this.Fx.Element.getElement()[this.property];},setValue:function(value){try{this.Fx.Element.getElement()[this.property]=value;}catch(e){};}})});})();(function(proto){function ucfirst(name){return name.substring(0,1).toUpperCase()+name.substring(1);};var type,i,algo,className,functionName,property,prototype={};for(type in proto){for(algo in proto[type]){className=type.toLowerCase()+ucfirst(algo);for(i in proto[type][algo]){property=proto[type][algo][i];functionName="fx"+ucfirst(type)+ucfirst(property);prototype[functionName]=(function(property,className){return function(){var a0=arguments[0]||null,a1=arguments[1]||null,a2=arguments[2]||null;var Fx=JooS.Element.Fx[className];new Fx(this,property,a0,a1,a2);return this;};})(property,className);}}}
JooS.Virtual(JooS.Element.Fx,prototype);})({style:{number:["width","height","top","left","fontSize","lineHeight"],string:["display","overflow","position"]},attr:{number:["width","height","cellSpacing","cellPadding","border"],string:["src"]}});Subsys_JsHttpRequest_Js=function(){this._construct();};(function(){var COUNT=0;var PENDING={};var CACHE={};Subsys_JsHttpRequest_Js.dataReady=function(id,text,js){var undef;var th=PENDING[id];delete PENDING[id];if(th){delete th._xmlReq;if(th.caching)CACHE[th.hash]=[text,js];th._dataReady(text,js);}else if(typeof(th)!=typeof(undef)){alert("ScriptLoader: unknown pending id: "+id);}};Subsys_JsHttpRequest_Js.prototype={onreadystatechange:null,readyState:0,responseText:null,responseXML:null,status:200,statusText:"OK",session_name:"PHPSESSID",responseJS:null,caching:false,_span:null,_id:null,_xmlReq:null,_openArg:null,_reqHeaders:null,dummy:function(){},abort:function(){if(this._xmlReq)return this._xmlReq.abort();if(this._span){this.readyState=0;if(this.onreadystatechange)this.onreadystatechange();this._cleanupScript();}},open:function(method,url,asyncFlag,username,password){this._openArg={'method':method,'url':url,'asyncFlag':asyncFlag,'username':username,'password':password};this._id=null;this._xmlReq=null;this._reqHeaders=[];return true;},send:function(content){var id=(new Date().getTime())+""+COUNT++;var query=this._hash2query(content);var url=this._openArg.url;var sid=null;var hash=this.hash=url+'?'+query;if(this.caching&&CACHE[hash]){var c=CACHE[hash];this._dataReady(c[0],c[1]);return false;}
this._xmlReq=this._obtainXmlReq(id,url);var hasSetHeader=this._xmlReq&&(window.ActiveXObject||this._xmlReq.setRequestHeader);var href,body;if(this._xmlReq&&hasSetHeader&&(""+this._openArg.method).toUpperCase()=="POST"){this._openArg.method="POST";href=url;body=query;}else{this._openArg.method="GET";href=url+(url.indexOf('?')>=0?'&':'?')+query;body=null;}
href=href+(href.indexOf('?')>=0?'&':'?')+id;PENDING[id]=this;if(this._xmlReq){var a=this._openArg;this._xmlReq.open(a.method,href+"-xml",a.asyncFlag,a.username,a.password);if(hasSetHeader){for(var i=0;i<this._reqHeaders.length;i++)
this._xmlReq.setRequestHeader(this._reqHeaders[i][0],this._reqHeaders[i][1]);this._xmlReq.setRequestHeader('Content-Type','application/octet-stream');}
return this._xmlReq.send(body);}else{this._obtainScript(id,href);return true;}},getAllResponseHeaders:function(){if(this._xmlReq)return this._xmlReq.getAllResponseHeaders();return'';},getResponseHeader:function(label){if(this._xmlReq)return this._xmlReq.getResponseHeader(label);return'';},setRequestHeader:function(label,value){this._reqHeaders[this._reqHeaders.length]=[label,value];},_construct:function(){},_dataReady:function(text,js){with(this){if(text!==null||js!==null){readyState=4;responseText=responseXML=text;responseJS=js;}else{readyState=0;responseText=responseXML=responseJS=null;}
if(onreadystatechange)onreadystatechange();_cleanupScript();}},_obtainXmlReq:function(id,url){if(url.match(new RegExp('^[a-z]+://','i')))return null;var req=null;if(window.XMLHttpRequest){try{req=new XMLHttpRequest();}catch(e){}}else if(window.ActiveXObject){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
if(!req)try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}}
if(req){var th=this;req.onreadystatechange=function(){var s=req.readyState;if(s==4){req.onreadystatechange=th.dummy;var responseText=req.responseText;try{eval(responseText);}catch(e){Subsys_JsHttpRequest_Js.dataReady(id,"JavaScript code generated by backend is invalid!\n"+responseText,null);}}else{th.readyState=s;if(th.onreadystatechange)th.onreadystatechange();}};this._id=id;}
return req;},_obtainScript:function(id,href){with(document){var span=null;span=body.appendChild(createElement("SPAN"));span.style.display='none';span.innerHTML='Text for stupid IE.<s'+'cript></'+'script>';setTimeout(function(){var s=span.getElementsByTagName("script")[0];s.type='text/javascript';s.charset="koi8-r";s.language="JavaScript";s.src=href;},10);this._id=id;this._span=span;}},_cleanupScript:function(){var span=this._span;if(span){this._span=null;setTimeout(function(){span.parentNode.removeChild(span);},50);}
return false;},_hash2query:function(content,prefix){if(prefix==null)prefix="";var query=[];if(content instanceof Object){for(var k in content){var v=content[k];if(v==null||((v.constructor||{}).prototype||{})[k])continue;var curPrefix=prefix?prefix+'['+this.escape(k)+']':this.escape(k);if(v instanceof Object)
query[query.length]=this._hash2query(v,curPrefix);else{query[query.length]=curPrefix+"="+this.escape(v);}}}else{query=[content];}
return query.join('&');},_getSid:function(){var m=document.location.search.match(new RegExp('[&?]'+this.session_name+'=([^&?]*)'));var sid=null;if(m){sid=m[1];}else{var m=document.cookie.match(new RegExp(s='(;|^)\\s*'+this.session_name+'=([^;]*)'));if(m)sid=m[2];}
return sid;},escape:function(s){return escape(s).replace(new RegExp('\\+','g'),'%2B');}}})();JooS.JSLoader=JooS.Reflect(JooS.Element,{getElementProperties:function(){return{src:this.source,type:"text/javascript",charset:"koi8-r"};},attachCallback:function(callback){var Element=this.getElement();if(JooS.Browser.IE){Element.onreadystatechange=function(){var rs=this.readyState;if("loaded"===rs||"complete"===rs){callback();this.onreadstatechange=null;}};}
else{Element.onload=function(){Element.onload=null;callback();};}},__constructor:function(source,callback){this.source=source;this.__constructor.__parent("script");JooS.BodyDOM.appendChild(this);if(callback)
this.attachCallback(callback);},__destructor:function(){this.removeNode();this.__destructor.__parent();}});JooS.Extend(JooS.JSLoader,{Scripts:[],Start:function(source,id){id=id||Math.random();this.Scripts[id]=new this(source);return id;},Cleanup:function(id){if(this.Scripts[id]){this.Scripts[id].removeNode();this.Scripts[id].__destroy();delete this.Scripts[id];}}});JooS.CSSLoader=JooS.Reflect(JooS.Element,{getElementProperties:function(){return{rel:"stylesheet",type:"text/css",href:this.href};},__constructor:function(href){this.href=href;this.__constructor.__parent("link");JooS.HeadDOM.prependChild(this);}});JooS.JSEval=JooS.Reflect(JooS.Element,{useTextNode:function(){return JooS.Browser.Safari||JooS.Browser.Opera;},getElementProperties:function(){var Prop={type:"text/javascript",language:"JavaScript"};if(!this.useTextNode())
Prop.text=this.EvalCode;return Prop;},__constructor:function(EvalCode){this.EvalCode=EvalCode;this.__constructor.__parent("script");if(this.useTextNode())
this.appendChild(new JooS.TextElement(EvalCode));JooS.BodyDOM.appendChild(this);this.removeNode();}});JooS.CSSInline=JooS.Reflect(JooS.Element,{getElementProperties:function(){return{type:"text/css"};},__constructor:function(cssText){this.__constructor.__parent("style");var Self=this;JooS.Startup(function(){if(Self.getElement().styleSheet)
Self.getElement().styleSheet.cssText=cssText;else
Self.appendChild(new JooS.TextElement(cssText));JooS.HeadDOM.appendChild(Self);});}});JooS.Ajax={__common:JooS.Class.prototype.__common,Send:function(Method,Url,Query,CallbackFunction){var req=new Subsys_JsHttpRequest_Js();req.onreadystatechange=function(){if(req.readyState==4){CallbackFunction.call(req);}};req.open(Method,Url,true);req.send(Query);},Get:function(Url,Query,cb){this.Send("GET",Url,Query,cb);},Post:function(Url,Query,cb){this.Send("POST",Url,Query,cb);},Rpc:function(method,params,cb){this.Send("POST",this.__common.ajaxRpcUrl,{method:method,params:params||[]},cb);}};JooS.Extend(JooS.Class.prototype.__common,{ajaxUrl:"/common/ajax.php",ajaxRpcUrl:"/common/rpc.php",previewPath:"http://preview.ru-kazan.ru",imgPath:"http://img.ru-kazan.ru",shadowCover_waitingSrc:"http://img.ru-kazan.ru/interface/waiting.gif",shadowCover_waitingWidth:125,shadowCover_waitingHeight:38});