(function(){function $(id){return document.getElementById(id);}function setStyleDisplay(id,status){$(id).style.display=status;}function goTop(acceleration,time){acceleration=acceleration||0.1;time=time||16;var dx=0,dy=0,bx=0,by=0,wx=0,wy=0;if(document.documentElement){dx=document.documentElement.scrollLeft||0;dy=document.documentElement.scrollTop||0;}if(document.body){bx=document.body.scrollLeft||0;by=document.body.scrollTop||0;}var wx=window.scrollX||0,wy=window.scrollY||0,x=Math.max(wx,Math.max(bx,dx)),y=Math.max(wy,Math.max(by,dy)),speed=1+acceleration;window.scrollTo(Math.floor(x/speed),Math.floor(y/speed));if(x>0||y>0){var invokeFunction="istoJS.goTop("+acceleration+","+time+")";window.setTimeout(invokeFunction,time);}}function switchTab(showPanels,hidePanels,activeTab,activeClass,fadeTab,fadeClass){$(activeTab).className=activeClass;$(fadeTab).className=fadeClass;var panel,panelList;panelList=showPanels.split(',');for(var i=0;i<panelList.length;i++){var panel=panelList[i];if($(panel)){setStyleDisplay(panel,'block');}}panelList=hidePanels.split(',');for(var i=0;i<panelList.length;i++){panel=panelList[i];if($(panel)){setStyleDisplay(panel,'none');}}}function loadCommentShortcut(){$('comment').onkeydown=function(moz_ev){var ev=null;if(window.event){ev=window.event;}else{ev=moz_ev;}if(ev!=null&&ev.ctrlKey&&ev.keyCode==13){$('submit').click();}}}function getElementsByClassName(className,tag,parent){parent=parent||document;var allTags=(tag=='*'&&parent.all)?parent.all:parent.getElementsByTagName(tag),matchingElements=new Array();className=className.replace(/\-/g,'\\-');var regex=new RegExp('(^|\\s)'+className+'(\\s|$)'),element;for(var i=0;i<allTags.length;i++){element=allTags[i];if(regex.test(element.className)){matchingElements.push(element);}}return matchingElements;}function goReply(commentID,author){var nauthor='@'+author+': ',authorcommt;if(document.getElementById('comment')&&document.getElementById('comment').type=='textarea'){authorcommt=document.getElementById('comment');}else{return false;}if(document.selection){authorcommt.focus();sel=document.selection.createRange();sel.text=nauthor;authorcommt.focus();}else if(authorcommt.selectionStart||authorcommt.selectionStart=='0'){var startPos=authorcommt.selectionStart,endPos=authorcommt.selectionEnd,cursorPos=endPos;authorcommt.value=authorcommt.value.substring(0,startPos)+nauthor+authorcommt.value.substring(endPos,authorcommt.value.length);cursorPos+=nauthor.length;authorcommt.focus();authorcommt.selectionStart=cursorPos;authorcommt.selectionEnd=cursorPos;}else{authorcommt.value+=nauthor;authorcommt.focus();}}window['istoJS']={};window['istoJS']['$']=$;window['istoJS']['setStyleDisplay']=setStyleDisplay;window['istoJS']['goTop']=goTop;window['istoJS']['goReply']=goReply;window['istoJS']['switchTab']=switchTab;window['istoJS']['loadCommentShortcut']=loadCommentShortcut;window['istoJS']['getElementsByClassName']=getElementsByClassName;})();
(function(jQuery){istojQ=jQuery.noConflict();var mouseover_tid=[],mouseout_tid=[];istojQ(document).ready(function(){istojQ('#navmenus > li').find('ul:eq(0)').slideUp(50);istojQ('#navmenus > li').each(function(index){istojQ(this).hover(function(){var _self=this;clearTimeout(mouseout_tid[index]);mouseover_tid[index] = setTimeout(function(){istojQ(_self).find('ul:eq(0)').slideDown(200);istojQ(_self).find('ul:eq(0)').addClass('sub-menu');},200);},function(){var _self=this;clearTimeout(mouseover_tid[index]);mouseout_tid[index]=setTimeout(function(){istojQ(_self).find('ul:eq(0)').slideUp(200);istojQ(_self).find('ul:eq(0)').removeClass('sub-menu');},200);});});});})(jQuery);
