/* - jquery-integration.js - */
// https://www.york.cuny.edu/portal_javascripts/jquery-integration.js?original=1
var jq=jQuery.noConflict();if(typeof cssQuery=='undefined'){
function cssQuery(s,f){return jq.makeArray(jq(s,f))}}; 

/* - carousel.js - */
(function(jq){jq.fn.jCarouselLite=function(o){o=jq.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,hoverPause:false,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=jq(this),ul=jq("ul",div),tLi=jq("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v+1).clone()).append(tLi.slice(0,o.scroll).clone());o.start+=v-1;}
var li=jq("li",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev){jq(o.btnPrev).click(function(){return go(curr-o.scroll);});if(o.hoverPause){jq(o.btnPrev).hover(function(){stopAuto();},function(){startAuto();});}}
if(o.btnNext){jq(o.btnNext).click(function(){return go(curr+o.scroll);});if(o.hoverPause){jq(o.btnNext).hover(function(){stopAuto();},function(){startAuto();});}}
if(o.btnGo)
jq.each(o.btnGo,function(i,val){jq(val).click(function(){return go(o.circular?o.visible+i:i);});});if(o.mouseWheel&&div.mousewheel)
div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});var autoInterval;function startAuto(){stopAuto();autoInterval=setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);};function stopAuto(){clearInterval(autoInterval);};if(o.auto){if(o.hoverPause){div.hover(function(){stopAuto();},function(){startAuto();});}
startAuto();};function vis(){return li.slice(curr).slice(0,v);};function go(to){if(!running){if(o.beforeStart)
o.beforeStart.call(this,vis());if(o.circular){if(to<0){ul.css(animCss,-((curr+tl)*liSize)+"px");curr=to+tl;}else if(to>itemLength-v){ul.css(animCss,-((curr-tl)*liSize)+"px");curr=to-tl;}else curr=to;}else{if(to<0||to>itemLength-v)return;else curr=to;}
running=true;ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd)
o.afterEnd.call(this,vis());running=false;});if(!o.circular){jq(o.btnPrev+","+o.btnNext).removeClass("disabled");jq((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}
return false;};});};function css(el,prop){return parseInt(jq.css(el[0],prop))||0;};function width(el){return el[0].offsetWidth+css(el,'marginLeft')+css(el,'marginRight');};function height(el){return el[0].offsetHeight+css(el,'marginTop')+css(el,'marginBottom');};})(jq);
jq(function() {
jq(".newsticker-jcarousellite").jCarouselLite({
vertical:true,
hoverPause:true,
visible: 2,
auto:1000,
speed:1000
});
});


/* - cookie.js - */
jq.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jq.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};


/* - alert.js - */
// document.write(jq.cookie('emergencyOverlay'));

jq(document).ready(function() {

if(jq.cookie('emergencyOverlay') == null){
jq("#em-Overlay").overlay({
		//Custom top position top: 60,
		//Some mask tweaks suitable for the bg
		mask: {
				//you might also consider a "transparent" color for the mask
				color: '#000',
				//load mask a little faster
				loadSpeed: 200,
				//very transparent
				opacity: 0.8
				},
		//disable this for modal dialog-type of overlays
		closeOnClick: false,
		//load it mmediately after the construction
		load: true
		});
	var expirationTime = new Date();
	var minutes = 10;
	expirationTime.setTime(expirationTime.getTime() + 1000 * 60 * minutes )
	jq.cookie('emergencyOverlay', false, { expires: expirationTime});
}

});

/* - Events - */
jq(document).ready(function(){
	
	var first = 0;
	var speed = 700;
	var pause = 7000;
	
		function removeFirst(){
			first = jq('ul#listticker2 li:first').html();
			jq('ul#listticker2 li:first')
			.animate({opacity: 0}, speed)
			.slideUp('slow', function() {jq(this).remove();});
			addLast(first);
		}
		
		function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			jq('ul#listticker2').append(last)
			jq('ul#listticker2 li:last')
			.animate({opacity: 1}, speed)
			.fadeIn('slow')
		}
	
	interval = setInterval(removeFirst, pause);
});

