(function(document,window){var selector=function(query)
{if(query.nodeType)
{query=[query];}else if(typeof query=='string')
{query=document.querySelectorAll(query);}else if($.toString.call(query)=='[object global]')
{query=[window];}else if(!(query instanceof Array))
{return null;}
this.length=query.length;for(var i=0;i<this.length;i++)
{this[i]=query[i];}
return this;},$=function(query)
{return new selector(query);},readyFn=[],DOMReady=function(){for(var i=0,l=readyFn.length;i<l;i++)
{readyFn[i]();}
readyFn=null;if(document.removeEventListener)
{document.removeEventListener('DOMContentLoaded',DOMReady,false);}};$.extend=function(obj,target){target=target||selector.prototype;for(var prop in obj)
{target[prop]=obj[prop];}};$.extend({isIpad:(/ipad/gi).test(navigator.appVersion),isIphone:(/iphone/gi).test(navigator.appVersion),isAndroid:(/android/gi).test(navigator.appVersion),isOrientationAware:('onorientationchange'in window),isHashChangeAware:('onhashchange'in window),isStandalone:window.navigator.standalone,has3d:('WebKitCSSMatrix'in window&&'m11'in new WebKitCSSMatrix()),insertAfter:function(theNode,newNode)
{if(navigator.appName=='Microsoft Internet Explorer')
{theNode.parentNode.appendChild(newNode);}
else
{theNode.parentNode.insertBefore(newNode,theNode.nextSibling);}},ready:function(fn)
{if(readyFn.length==0)
{if(document.addEventListener)
{document.addEventListener('DOMContentLoaded',DOMReady,false);}else if(document.all&&!window.opera)
{var newScript=document.createElement('script');newScript.src='javascript:void(0)';newScript.type='text/javascript';newScript.language='javascript';newScript.defer='defer';var docHeader=document.getElementsByTagName('head'),currentScripts=docHeader[0].getElementsByTagName('script');if(currentScripts.length>0)
{this.insertAfter(currentScripts[currentScripts.length- 1],newScript);}
var contentloadtag=document.getElementById("contentloadtag");contentloadtag.onreadystatechange=function()
{if(this.readyState=="complete")
{DOMReady();}}}}
readyFn.push(fn);},hasClass:function(el,classyName)
{return new RegExp('(^|\\s)'+ classyName+'(\\s|$)').test(el.className);},data:{},getEvent:function(ev)
{return ev||event.window;},eventSrc:function(ev)
{ev=this.getEvent(ev);if(ev.target)
{return ev.target.nodeType==3?ev.target.parentNode:ev.target;}else if(ev.srcElement)
{return ev.srcElement.nodeType==3?ev.srcElement.parentNode:ev.srcElement;}},eventKey:function(ev)
{ev=this.getEvent(ev);return ev.keyCode||ev.which;},cancelEvent:function(event)
{event=this.getEvent(event);if(event.preventDefault)
{event.preventDefault();event.stopPropagation();}
else
{event.returnValue=false;event.cancelBubble=true;}},read:function(key)
{if(typeof this.data[key]!='undefined')
{return this.data[key];}},write:function(key,data,overwrite)
{overwrite=overwrite||true;if(typeof this.data[key]=='undefined'||overwrite===true)
{return this.data[key]=data;}},toString:Object.prototype.toString,isFunction:function(object)
{return this.toString.call(object)==='[object Function]';},isArray:function(arr)
{return this.toString.call(arr)==='[object Array]';},isObject:function(object)
{return this.toString.call(arr)==='[object Object]';},in_array:function(needle,haystack,isStrict)
{if(needle=='')return false;if(typeof(haystack)!='object')return false;isStrict=typeof(isStrict)=='bool'?isStrict:false;var key=null;if(isStrict)
{for(key in haystack)
{if(haystack[key]===needle)
{return true;}}}else
{for(key in haystack)
{if(haystack[key]==needle)
{return true;}}}
return false;},query:function(variable,from)
{if(!variable)
{return false;}
if(typeof(from)=='undefined')
{var queryString=window.location.search.substring(1);var splitString=queryString.split("&");for(var i=0;i<splitString.length;i++)
{var value=splitString[i].split("=");if(unescape(value[0])==variable)
{return unescape(value[1]);}}}else
{var splitString=from.split("?");if(!splitString[1])
{return false;}
splitString=splitString[1].split('&');if(!variable)
{return false;}
for(var i=0;i<splitString.length;i++)
{var pair=splitString[i].split("=");var key=unescape(pair[0]);var value=unescape(pair[1]);if(key==variable)
{return value;}}}
return false;},get_nextsibling:function(n)
{var x=n.nextSibling;while(x&&x.nodeType!=1)
{x=x.nextSibling;}
return x;},log:function(str)
{if(window.console)
{console.log(str);}},client_wh:function()
{var w=0;var h=0;if(!window.innerWidth)
{if(!(document.documentElement.clientWidth==0))
{w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;}else
{w=document.body.clientWidth;h=document.body.clientHeight;}}else
{w=window.innerWidth;h=window.innerHeight;}
return new Array(h,w);},scroll_xy:function()
{var ScrollYPos=0;var ScrollXPos=0;if(window.pageYOffset)
{ScrollYPos=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop)
{ScrollYPos=document.documentElement.scrollTop;}else if(document.body)
{ScrollYPos=document.body.scrollTop;}
return new Array(0,ScrollYPos);},xhr:function()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
if(!xmlHttp)xmlHttp=false;return xmlHttp;},typewatch:function()
{var timer=0;return function(callback,seconds)
{clearTimeout(timer);timer=setTimeout(callback,seconds*1000);}}(),clear_default:function(self)
{if(self.value==self.defaultValue)
{self.value='';}},restore_default:function(self)
{if(self.value=='')
{self.value=self.defaultValue;}}},$);$.extend({ajax:function(url,o)
{if(typeof o=='undefined'||$.isArray(o))
{o=new Object;}
if(o.method)
{o.method=o.method.toLowerCase();}
var empty=function(){},options={method:'get',async:true,onLoading:empty,onComplete:empty,onSuccess:null,onFailure:null,onAbort:null,headers:{'X-Requested-With':'XMLHttpRequest'}},version='1.1.0',allowed_http=['get','post','put','delete'];$.extend(o,options);if(!$.in_array(options.method,allowed_http))
{options.method='get';}
if(typeof options.async!='boolean')
{options.async=true;}
var xhr=null,run=function(options,xhr)
{xhr=$.xhr();xhr.get_head=function(header)
{return xhr.getResponseHeader(header);}
xhr.set_head=function(header,content)
{xhr.setRequestHeader(header,content);}
xhr.open(options.method,url+(url.indexOf('?')==-1?'?':'&')+'cache_breaker='+ Math.random(),options.async);if(options.method=='post')
{xhr.set_head("Content-type","application/x-www-form-urlencoded");}
if(typeof(options.headers)=='object'&&options.headers!=false)
{for(key in options.headers)
{xhr.set_head(key,options.headers[key]);}}
if(typeof options.onLoading!='undefined'&&$.isFunction(options.onLoading))
{options.onLoading.apply(arguments.callee,[xhr]);}
var statechange=function()
{switch(xhr.readyState)
{case 4:if(typeof options['on'+ xhr.status]!='undefined')
{if($.isFunction(options['on'+ xhr.status]))
{options['on'+ xhr.status].apply(arguments.callee,[xhr]);}}
if(options.onAbort!=null&&xhr.status==0)
{if($.isFunction(options.onAbort))
{options.onAbort.apply(arguments.callee,[xhr]);}}
if(xhr.status>199&&xhr.status<300&&options.onSuccess!=null)
{if($.isFunction(options.onSuccess))
{options.onSuccess.apply(arguments.callee,[xhr]);}}else if((xhr.status<200||xhr.status>299)&&onFailure!=null)
{if($.isFunction(options.onFailure))
{options.onFailure.apply(arguments.callee,[xhr]);}}else
{if($.isFunction(options.onComplete))
{options.onComplete.apply(arguments.callee,[xhr]);}}
break;}}
xhr.onreadystatechange=statechange;xhr.send((options.method=='post'?options.parameters:null));return xhr;}
return run(options,xhr);}},$);$.extend({set_opacity:function(eid,opacity)
{if($('#'+ eid).item(0)[0].style.opacity)
{$('#'+ eid).style({opacity:opacity});}else
{$('#'+ eid).style({filter:'alpha(opacity='+ opacity*100+')'});}}},$);$.extend({fade_in:function(eid,timer,opacity)
{timer=timer||0;opacity=opacity||0;if(opacity<1)
{setTimeout('itrosis.set_opacity(\''+ eid+'\', '+(opacity+ 0.1)+');',timer*5);setTimeout('itrosis.fade_in(\''+ eid+'\', '+(timer+ 1)+', '+(opacity+ 0.1)+');',timer*5);}else
{$.set_opacity(eid,1);$.write('fade_'+ eid,false);}}},$);$.extend({fade_out:function(eid,timer,opacity)
{timer=timer||0;opacity=opacity||1;if(opacity>0)
{setTimeout('itrosis.set_opacity(\''+ eid+'\', '+(opacity- 0.1)+');',timer*3);setTimeout('itrosis.fade_out(\''+ eid+'\', '+(timer+ 1)+', '+(opacity- 0.1)+');',timer*3);return;}
$('#'+ eid).hide();$.set_opacity(eid,0);$.write('fade_'+ eid,true);}},$);$.extend({fade:function(eid)
{var type=$.read('fade_'+ eid);if(type==true)
{$('#'+ eid).show();set_opacity(eid,0);fade_in(eid);}else
{set_opacity(eid,1);fade_out(eid);}}},$);selector.prototype={each:function(callback)
{for(var i=0;i<this.length;i++)
{callback.call(this[i]);}
return this;},style:function(attrib,value)
{if(typeof attrib=='string'&&value===undefined)
{return window.getComputedStyle(this[0],null).getPropertyValue(attrib);}
if(typeof attrib!='object')
{attrib[attrib]=value;}
return this.each(function()
{for(var i in attrib)
{this.style[i]=attrib[i];}});},item:function(num)
{return $(this[num]);},bind:function(type,fn,capture)
{return this.each(function()
{if(this.addEventListener)
{this.addEventListener(type,fn,false);}else if(this.attachEvent)
{this.attachEvent('on'+ type,fn)}else
{this['on'+ type]=fn;}});},submit:function(fn,capture)
{return this.each(function()
{if(this.addEventListener)
{this.addEventListener('submit',fn,!!capture);}else if(this.attachEvent)
{this.attachEvent('submit',fn)}else
{this['onsubmit']=fn;}});},click:function(fn,capture)
{return this.each(function()
{if(this.addEventListener)
{this.addEventListener('click',fn,!!capture);}else if(this.attachEvent)
{this.attachEvent('onclick',fn)}else
{this['onclick']=fn;}});},load:function(fn,capture)
{return this.each(function()
{if(this.addEventListener)
{this.addEventListener('load',fn,!!capture);}else if(this.attachEvent)
{this.attachEvent('onload',fn)}else
{this['onload']=fn;}});},unbind:function(type,fn,capture)
{return this.each(function()
{if(this.addEventListener)
{this.removeEventListener(type,fn,!!capture);}else if(this.detachEvent)
{this.detachEvent('on'+ type,fn)}else
{this['on'+ type]=null;}});},parent:function()
{var result=[],parent,i,l;this.each(function()
{parent=this.parentNode;if(!parent._counted)
{result[result.length]=parent;parent._counted=true;}});return $(result).each(function()
{delete this._counted;});},hasClass:function(className)
{return $.hasClass(this[0],className);},addClass:function()
{var className=arguments;for(var i=0,l=className.length;i<l;i++)
{this.each(function()
{if(!$.hasClass(this,className[i]))
{this.className=this.className?this.className+' '+ className[i]:className[i];}});}
return this;},removeClass:function()
{var className=arguments;for(var i=0,l=className.length;i<l;i++)
{this.each(function()
{this.className=this.className.replace(new RegExp('(^|\\s+)'+ className[i]+'(\\s+|$)'),' ');});}
return this;},html:function(value)
{if(value===undefined)
{return this[0].innerHTML;}
return this.each(function()
{this.innerHTML=value;});},value:function(value)
{if(value===undefined)
{return this[0].value;}
return this.each(function()
{this.value=value;});},width:function(value)
{if(value===undefined)
{return this[0].clientWidth;}
return this.each(function()
{this.style.width=value+'px';});},height:function(value)
{if(value===undefined)
{return this[0].clientHeight;}
return this.each(function()
{this.style.height=value===''?'':value+'px';});},hide:function(arr)
{return this.each(function()
{if(this.id)
{$.write(this.id+'_oldview',this.style.display);}
this.style.display='none';});},show:function(arr)
{return this.each(function()
{this.style.display=this.id&&$.read(this.id+'_oldview')&&$.in_array($.read(this.id+'_oldview'),['block','inline-block','inline'])?$.read(this.id+'_oldview'):'block';});},fade:function(eid)
{if(eid==null)
{return this.each(function()
{var type=$.read('fade_'+ this.id),eid=this.id;if(type==true)
{$('#'+ eid).show();$.set_opacity(eid,0);$.fade_in(eid);}else
{$.set_opacity(eid,1);$.fade_out(eid);}});}else
{var type=$.read('fade_'+ eid);if(type==true)
{$('#'+ eid).show();$.set_opacity(eid,0);$.fade_in(eid);}else
{$.set_opacity(eid,1);$.fade_out(eid);}}}}
window.itrosis=$;})(document,window);
