if(typeof console==="undefined"){console={}
}if(!console.log){console.log=function(){}
}YUI().use("widget","cookie","ksu-input-hint","anim","overlay",function(d){var s="ksu-mobile",n=".",a,e=d.one,r,g="250px",j=false,m=e("#ksu-signin-form"),h,f,i;
var o=function(x){var w,v,u;
x.preventDefault();
w=x.target;
if(w.hasClass("ksu-mobile-enable")){v="Y"
}else{v="N"
}u=new Date(new Date().getTime()+10*365*24*3600*1000);
d.Cookie.set(s,v,{path:"/",domain:"k-state.edu",expires:u});
d.Cookie.set(s,v,{path:"/",domain:"ksu.edu",expires:u});
window.location.reload(true)
};
var t=function(u){if(!r){r=new d.Anim({node:"#ksu-header-submenu",to:{height:"100%"},easing:d.Easing.easeOutStrong,duration:0.5})
}if(u!==true&&u!==false){u=!j
}r.set("to",{height:(u?g:"0")});
j=u;
r.run()
};
var p=function(u){u.halt();
t()
};
var l=function(){if(!h){h=new d.Overlay({srcNode:"#ksu-signin-form",visible:false,align:{node:"#ksu-signin-position",points:["tl","tl"]},zIndex:50});
h.render();
f=false
}if(f){h.hide()
}else{h.show();
e("#ksu-signin-form").setStyle("display","block");
e("#eid").focus()
}f=!f
};
var q=function(u){u.halt();
l()
};
var c=function(u){var v=u.target;
if(f&&!m.contains(v)){l()
}if(!i){i=d.all("#ksu-header-top, #ksu-header-menu, #ksu-wrapper, #ksu-footer")
}if(j&&!i.some(function(w){return w.contains(v)
})){t(false)
}};
var k=function(x,z,u){var w=0,B=/^((?:https?|file|ftp):)\/\/((?:(?:[a-z\d](?:[a-z\d-]*[a-z\d])*)\.)+[a-z]{2,})(?::(\d*))?(\/[^\?#]*)/,v,D,y,A,C;
v=x.get("href");
if(!v){return 0
}v=v.replace(/\/index\.html$/,"/");
y=B.exec(v);
if(y){if(typeof y[3]==="undefined"){y[3]=""
}if(y[1]!==z.protocol||y[2]!==z.hostname||y[3]!==z.port){return 0
}D=y[4]
}else{D=v
}A=D.split("/");
A.shift();
C=A.length;
if(C>u.length){C=u.length
}w=0;
while(w<C&&A[w]===u[w]){w++
}w++;
return w
};
var b=function(){var v,x,E,y,w,A,B,D,u="ksu-unit-menu",z="ksu-active",C="parentNode";
if(window.location.hostname==="www.omniupdate.com"){return
}v=e(".ksu-sidebar ul.ksu-unit-menu,#ksu-sidebar ul.ksu-unit-menu");
if(v){x=v.one(n+z);
if(!x){y=null;
w=0;
E=v.all("li>a");
A=window.location;
B=location.pathname.toString().replace(/\/index\.html$/,"/").split("/");
B.shift();
E.each(function(F){var G=k(F,A,B);
if(G>=w){y=F;
w=G
}});
if(w&&y){y.addClass(z);
D=y.get(C);
while(D&&!D.hasClass(u)){D.addClass(z);
D=D.get(C)
}}}}};
b();
d.on("click",p,"#ksu-header-menu>ul");
d.on("click",function(){t(false)
},"#ksu-header-submenu-close");
d.on("click",q,"#ksu-signin");
d.on("click",o,".ksu-mobile-enable");
d.on("click",c,"body");
a=e("#ksu-search input");
a.plug(d.Plugin.InputHint)
});

