//hover intent
var J=jQuery.noConflict();(function(J){J.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=J.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){J(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;J(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{J(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
//dropdown
;(function(J){J.fn.superfish=function(op){var sf=J.fn.superfish,c=sf.c,Jarrow=J(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),over=function(){var JJ=J(this),menu=getMenu(JJ);clearTimeout(menu.sfTimer);JJ.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var JJ=J(this),menu=getMenu(JJ),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=(J.inArray(JJ[0],o.Jpath)>-1);JJ.hideSuperfishUl();if(o.Jpath.length&&JJ.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.Jpath);}},o.delay);},getMenu=function(Jmenu){var menu=Jmenu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function(Ja){Ja.addClass(c.anchorClass).append(Jarrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=J.extend({},sf.defaults,op);o.Jpath=J('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){J(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;J('li:has(ul)',this)[(J.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow(J('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var Ja=J('a',this);Ja.each(function(i){var Jli=Ja.eq(i).parents('li');Ja.eq(i).focus(function(){over.call(Jli);}).blur(function(){out.call(Jli);});});o.onInit.call(this);}).each(function(){menuClasses=[c.menuClass];if(sf.op.dropShadows&&!(J.browser.msie&&J.browser.version<7))menuClasses.push(c.shadowClass);J(this).addClass(menuClasses.join(' '));});};var sf=J.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if(J.browser.msie&&J.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},animationClose:{opacity:'hide'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};J.fn.extend({hideSuperfishUl:function(){var o=sf.op,Jul=J('li.'+o.hoverClass,this).add(this);Jul.find('>ul').animate(o.animationClose,o.speed,function(){J(this).css('visibility','hidden');Jul.removeClass(o.hoverClass);o.onBeforeShow.call(Jul);});return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',Jul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call(Jul);o.onBeforeShow.call(Jul);Jul.animate(o.animation,o.speed,function(){sf.IE7fix.call(Jul);o.onShow.call(Jul);});return this;}});})(jQuery);
//shaded border
var RUZEE=window.RUZEE||{};RUZEE.ShadedBorder={create:function(opts){var isie=/msie/i.test(navigator.userAgent)&&!window.opera;var isie6=isie&&!window.XMLHttpRequest;function sty(el,h){for(k in h){if(/ie_/.test(k)){if(isie)el.style[k.substr(3)]=h[k];}else el.style[k]=h[k];}}
function crdiv(h){var el=document.createElement("div");el.className="sb-gen";sty(el,h);return el;}
function op(v){v=v<0?0:v;if(v>0.99999)return"";return isie?" filter:alpha(opacity="+(v*100)+");":" opacity:"+v+';';}
var sr=opts.shadow||0;var r=opts.corner||0;var bor=0;var bow=opts.border||0;var boo=opts.borderOpacity||1;var shadow=sr!=0;var lw=r>sr?r:sr;var rw=lw;var th=lw;var bh=lw;if(bow>0){bor=r;r=r-bow;}
var cx=r!=0&&shadow?Math.round(lw/3):0;var cy=cx;var cs=Math.round(cx/2);var iclass=r>0?"sb-inner":"sb-shadow";var sclass="sb-shadow";var bclass="sb-border";var edges=opts.edges||"trlb";if(!/t/i.test(edges))th=0;if(!/b/i.test(edges))bh=0;if(!/l/i.test(edges))lw=0;if(!/r/i.test(edges))rw=0;var p={position:"absolute",left:"0",top:"0",width:lw+"px",height:th+"px",ie_fontSize:"1px",overflow:"hidden",margin:"0",padding:"0"};var tl=crdiv(p);delete p.left;p.right="0";p.width=rw+"px";var tr=crdiv(p);delete p.top;p.bottom="0";p.height=bh+"px";var br=crdiv(p);delete p.right;p.left="0";p.width=lw+"px";var bl=crdiv(p);var tw=crdiv({position:"absolute",width:"100%",height:th+"px",ie_fontSize:"1px",top:"0",left:"0",overflow:"hidden",margin:"0",padding:"0"});var t=crdiv({position:"relative",height:th+"px",ie_fontSize:"1px",margin:"0 "+rw+"px 0 "+lw+"px",overflow:"hidden",padding:"0"});tw.appendChild(t);var bw=crdiv({position:"absolute",left:"0",bottom:"0",width:"100%",height:bh+"px",ie_fontSize:"1px",overflow:"hidden",margin:"0",padding:"0"});var b=crdiv({position:"relative",height:bh+"px",ie_fontSize:"1px",margin:"0 "+rw+"px 0 "+lw+"px",overflow:"hidden",padding:"0"});bw.appendChild(b);var mw=crdiv({position:"absolute",top:(-bh)+"px",left:"0",width:"100%",height:"100%",overflow:"hidden",ie_fontSize:"1px",padding:"0",margin:"0"});function corner(el,t,l){var w=l?lw:rw;var h=t?th:bh;var s=t?cs:-cs;var dsb=[];var dsi=[];var dss=[];var xp=0;var xd=1;if(l){xp=w-1;xd=-1;}
for(var x=0;x<w;++x){var yp=h-1;var yd=-1;if(t){yp=0;yd=1;}
var finished=false;for(var y=h-1;y>=0&&!finished;--y){var div='<div style="position:absolute; top:'+yp+'px; left:'+xp+'px; '+'width:1px; height:1px; overflow:hidden; margin:0; padding:0;';var xc=x-cx;var yc=y-cy-s;var d=Math.sqrt(xc*xc+yc*yc);var doShadow=false;if(r>0){if(xc<0&&yc<bor&&yc>=r||yc<0&&xc<bor&&xc>=r){dsb.push(div+op(boo)+'" class="'+bclass+'"></div>');}else
if(d<bor&&d>=r-1&&xc>=0&&yc>=0){var dd=div;if(d>=bor-1){dd+=op((bor-d)*boo);doShadow=true;}else dd+=op(boo);dsb.push(dd+'" class="'+bclass+'"></div>');}
var dd=div+' z-index:2;'+(t?'background-position:0 -'+(r-yc-1)+'px;':'background-image:none;');var finish=function(){if(!t)dd=dd.replace(/top\:\d+px/,"top:0px");dd=dd.replace(/height\:1px/,"height:"+(y+1)+"px");dsi.push(dd+'" class="'+iclass+'"></div>');finished=true;};if(xc<0&&yc<r||yc<0&&xc<r){finish();}else
if(d<r&&xc>=0&&yc>=0){if(d>=r-1){dd+=op(r-d);doShadow=true;dsi.push(dd+'" class="'+iclass+'"></div>');}else{finish();}}else doShadow=true;}else doShadow=true;if(sr>0&&doShadow){d=Math.sqrt(x*x+y*y);if(d<sr){dss.push(div+' z-index:0; '+op(1-(d/sr))+'" class="'+sclass+'"></div>');}}
yp+=yd;}
xp+=xd;}
el.innerHTML=dss.concat(dsb.concat(dsi)).join('');}
function mid(mw){var ds=[];ds.push('<div style="position:relative; top:'+(th+bh)+'px; height:2048px; '+' margin:0 '+(rw-r-cx)+'px 0 '+(lw-r-cx)+'px; '+' padding:0; overflow:hidden;'+' background-position:0 '+(th>0?-(r+cy+cs):'0')+'px;"'+' class="'+iclass+'"></div>');var dd='<div style="position:absolute; width:1px;'+' top:'+(th+bh)+'px; height:2048px; padding:0; margin:0;';if(sr>0){for(var x=0;x<lw-r-cx;++x){ds.push(dd+' left:'+x+'px;'+op((x+1.0)/lw)+'" class="'+sclass+'"></div>');}
for(var x=0;x<rw-r-cx;++x){ds.push(dd+' right:'+x+'px;'+op((x+1.0)/rw)+'" class="'+sclass+'"></div>');}}
if(bow>0){var su=' width:'+bow+'px;'+op(boo)+'" class="'+bclass+'"></div>';ds.push(dd+' left:'+(lw-bor-cx)+'px;'+su);ds.push(dd+' right:'+(rw-bor-cx)+'px;'+su);}
mw.innerHTML=ds.join('');}
function tb(el,t){var ds=[];var h=t?th:bh;var dd='<div style="height:1px; overflow:hidden; position:absolute; margin:0; padding:0;'+' width:100%; left:0px; ';var s=t?cs:-cs;for(var y=0;y<h-s-cy-r;++y){if(sr>0)ds.push(dd+(t?'top:':'bottom:')+y+'px;'+op((y+1)*1.0/h)+'" class="'+sclass+'"></div>');}
if(y>=bow){ds.push(dd+(t?'top:':'bottom:')+(y-bow)+'px;'+op(boo)+' height:'+bow+'px;" class="'+bclass+'"></div>');}
ds.push(dd+(t?'background-position-y:0; top:':'background-image:none; bottom:')+y+'px;'+' height:'+(r+cy+s)+'px;" class="'+iclass+'"></div>');el.innerHTML=ds.join('');}
corner(tl,true,true);corner(tr,true,false);corner(bl,false,true);corner(br,false,false);mid(mw);tb(t,true);tb(b,false);return{render:function(el){if(typeof el=='string')el=document.getElementById(el);if(el.length!=undefined){for(var i=0;i<el.length;++i)this.render(el[i]);return;}
el.className+=" sb";sty(el,{position:"relative",background:"transparent"});var node=el.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==1&&node.className=='sb-gen')
el.removeChild(node);node=nextNode;}
var iel=el.firstChild;var twc=tw.cloneNode(true);var mwc=mw.cloneNode(true);var bwc=bw.cloneNode(true);el.insertBefore(tl.cloneNode(true),iel);el.insertBefore(tr.cloneNode(true),iel);el.insertBefore(bl.cloneNode(true),iel);el.insertBefore(br.cloneNode(true),iel);el.insertBefore(twc,iel);el.insertBefore(mwc,iel);el.insertBefore(bwc,iel);if(isie6){el.onmouseover=function(){this.className+=" hover";}
el.onmouseout=function(){this.className=this.className.replace(/ hover/,"");}}
if(isie){function resize(){twc.style.width=bwc.style.width=mwc.style.width=el.offsetWidth+"px";mwc.firstChild.style.height=el.offsetHeight+"px";}
el.onresize=resize;resize();}}};}}
document.write('<style type="text/css">.sb, .sbi, .sb *, .sbi * { position:relative; z-index:1; } * html .sb, * html .sbi { height:1%; } .sbi { display:inline-block; } .sb-inner { background:#fff; } .sb-shadow { background:#000; } .sb-border { background:#aeaeae; } </style>');
//tooltip 
var ie=document.all?true:false;function clearContent(el){nEl=el.cloneNode(false);el.parentNode.insertBefore(nEl,el);el.parentNode.removeChild(el);}var tooltip=function(){var id='tt';var top=3;var left=3;var maxw=300;var speed=10;var timer=1;var endalpha=95;var alpha=0;var tt,t,c,b,h;if(ie){speed=500;}return{show:function(v,w){if(tt==null){tt=document.createElement('div');tt.setAttribute('id',id);t=document.createElement('div');t.setAttribute('id',id+'top');c=document.createElement('div');c.setAttribute('id',id+'cont');b=document.createElement('div');b.setAttribute('id',id+'bot');tt.appendChild(t);tt.appendChild(c);tt.appendChild(b);document.body.appendChild(tt);tt.style.opacity=0;tt.style.filter='alpha(opacity=0)';document.onmousemove=this.pos;}tt.style.display='block';c.innerHTML=v;tt.style.width=w?w+'px':'auto';if(!w&&ie){t.style.display='none';b.style.display='none';tt.style.width=tt.offsetWidth;t.style.display='block';b.style.display='block';}if(tt.offsetWidth>maxw){tt.style.width=maxw+'px'}h=parseInt(tt.offsetHeight)+top;clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(1)},timer);},pos:function(e){var u=ie?event.clientY+document.documentElement.scrollTop:e.pageY;var l=ie?event.clientX+document.documentElement.scrollLeft:e.pageX;tt.style.top=(u-h)+'px';tt.style.left=(l+left)+'px';},fade:function(d){var a=alpha;if((a!=endalpha&&d==1)||(a!=0&&d==-1)){var i=speed;if(endalpha-a<speed&&d==1){i=endalpha-a;}else if(alpha<speed&&d==-1){i=a;}alpha=a+(i*d);tt.style.opacity=alpha*.01;tt.style.filter='alpha(opacity='+alpha+')';}else
{clearInterval(tt.timer);if(d==-1){tt.style.display='none';}}},hide:function(){clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(-1);},timer);}};}();
//Calendar
if(document.images){var loadImage=new Image(16,16);loadImage.src="/src/content/images/ajax-smallLoader.gif";}function getNextMon(){curMonth=document.getElementById('month').value;curYear=document.getElementById('year').value;document.getElementById('calendar').innerHTML="<div style='position:relative;'><p style='position:absolute;top:75px;right:142px;'><img src='"+loadImage.src+"' alt='load-image'/></p></div>";funcState='contNextMon('+curMonth+', '+curYear+')';setTimeout(funcState,500);}function contNextMon(){if(curMonth==12){nextMonth=1;nextYear=(curYear*1)+1;}else
{nextMonth=(curMonth*1)+1;nextYear=curYear;}getNewMonthCal(nextMonth,nextYear);}function getPrevMon(){curMonth=document.getElementById('month').value;curYear=document.getElementById('year').value;document.getElementById('calendar').innerHTML="<div style='position:relative;'><p style='position:absolute;top:75px;right:142px;'><img src='"+loadImage.src+"' alt='load-image'/></p></div>";funcState='contPrevMon('+curMonth+', '+curYear+')';setTimeout(funcState,500);}function contPrevMon(){if(curMonth==1){prevMonth=12;prevYear=(curYear*1)-1;}else
{prevMonth=(curMonth*1)-1;prevYear=curYear;}getNewMonthCal(prevMonth,prevYear);}function dropdownChange(){mon=document.getElementById('selectMonth').value;year=document.getElementById('selectYear').value;getNewMonthCal(mon,year);}function getNewMonthCal(month,year){new Ajax.Request("/src/include/calendar.widget.php?month="+month+"&year="+year,{method:'post',onSuccess:function(transport){var response=transport.responseText;document.getElementById('calendar').innerHTML=transport.responseText;reinitializeCal();},onFailure:function(){document.getElementById('calendar').innerHTML="<p>Failure: no response from server</p>"}});}function reinitializeCal(){kreeseBorder.render('calendar');document.getElementById('prevMon').innerHTML='<a href="javascript:getPrevMon()">&lt;&lt;</a>';document.getElementById('nextMon').innerHTML='<a href="javascript:getNextMon()">&gt;&gt;</a>';}function replaceEvent(eventId){new Ajax.Request("/src/include/event.widget.php?eventId="+eventId,{method:'post',onSuccess:function(transport){document.getElementById('eventWrap').innerHTML=transport.responseText;kreeseBorder.render('eventWrap');},onFailure:function(){document.getElementById('eventWrap').innerHTML="<p>Failure: no response from server</p>"}});}
//Content Changer
if(document.images){var contentLoad=new Image(128,15);contentLoad.src="/src/content/images/ajax-mainLoader.gif";}function changeContent(id){document.getElementById('mainContent').innerHTML="<div style='position:relative;'><p style='position:absolute;top:155px;right:234px;'><img src='"+contentLoad.src+"' alt='Changing Content'></p></div>";funcState='changeItNow('+id+')'; setTimeout(funcState, 1500);}function changeItNow(id){new Ajax.Request("/src/include/mainHomeContent.php?incId="+id,{method:'post',onSuccess:function(transport){document.getElementById('mainContent').innerHTML=transport.responseText;kreeseBorder.render('mainContent');},onFailure:function(){document.getElementById('mainContent').innerHTML="<p>Failure: no response from server</p>"}});}
