/* Minification failed. Returning unminified contents.
(476,20-21): run-time warning JS1014: Invalid character: `
 */
(function(h,v){var k=h.fn.domManip,t="_tmplitem",f=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,j={},z={},b,u={key:0,data:{}},g=0,e=0,m=[];
function i(D,E,B,A){var C={data:A||(E?E.data:{}),_wrap:E?E._wrap:null,tmpl:null,parent:E||null,nodes:[],calls:o,nest:q,wrap:s,html:p,update:r};
if(D){h.extend(C,D,{nodes:[],parent:E})
}if(B){C.tmpl=B;
C._ctnt=C._ctnt||C.tmpl(h,C);
C.key=++g;
(m.length?z:j)[g]=C
}return C
}h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(A,B){h.fn[A]=function(I){var H=[],E=h(I),C,D,F,J,G=this.length===1&&this[0].parentNode;
b=j||{};
if(G&&G.nodeType===11&&G.childNodes.length===1&&E.length===1){E[B](this[0]);
H=this
}else{for(D=0,F=E.length;
D<F;
D++){e=D;
C=(D>0?this.clone(true):this).get();
h.fn[B].apply(h(E[D]),C);
H=H.concat(C)
}e=0;
H=this.pushStack(H,A,E.selector)
}J=b;
b=null;
h.tmpl.complete(J);
return H
}
});
h.fn.extend({tmpl:function(A,B,C){return h.tmpl(this[0],A,B,C)
},tmplItem:function(){return h.tmplItem(this[0])
},template:function(A){return h.template(A,this[0])
},domManip:function(A,G,C,F){if(A[0]&&A[0].nodeType){var D=h.makeArray(arguments),B=A.length,E=0,H;
while(E<B&&!(H=h.data(A[E++],"tmplItem"))){}if(B>1){D[0]=[h.makeArray(A)]
}if(H&&e){D[2]=function(I){h.tmpl.afterManip(this,I,C)
}
}k.apply(this,D)
}else{k.apply(this,arguments)
}e=0;
if(!b){h.tmpl.complete(j)
}return this
}});
h.extend({tmpl:function(E,A,B,C){var D,F=!C;
if(F){C=u;
E=h.template[E]||h.template(null,E);
z={}
}else{if(!E){E=C.tmpl;
j[C.key]=C;
C.nodes=[];
if(C.wrapped){y(C,C.wrapped)
}return h(c(C,null,C.tmpl(h,C)))
}}if(!E){return[]
}if(typeof A==="function"){A=A.call(C||{})
}if(B&&B.wrapped){y(B,B.wrapped)
}D=h.isArray(A)?h.map(A,function(G){return G?i(B,C,E,G):null
}):[i(B,C,E,A)];
return F?h(c(C,null,D)):D
},tmplItem:function(A){var B;
if(A instanceof h){A=A[0]
}while(A&&A.nodeType===1&&!(B=h.data(A,"tmplItem"))&&(A=A.parentNode)){}return B||u
},template:function(A,B){if(B){if(typeof B==="string"){B=d(B)
}else{if(B instanceof h){B=B[0]||{}
}}if(B.nodeType){B=h.data(B,"tmpl")||h.data(B,"tmpl",d(B.innerHTML))
}return typeof A==="string"?(h.template[A]=B):B
}return A?(typeof A!=="string"?h.template(null,A):(h.template[A]||h.template(null,f.test(A)?A:h(A)))):null
},encode:function(A){return(""+A).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")
}});
h.extend(h.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(A){j={}
},afterManip:function a(C,D,A){var B=D.nodeType===11?h.makeArray(D.childNodes):D.nodeType===1?[D]:[];
A.call(C,D);
n(B);
e++
}});
function c(E,C,A){var B,D=A?h.map(A,function(F){return(typeof F==="string")?(E.key?F.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+t+'="'+E.key+'" $2'):F):c(F,E,F._ctnt)
}):E;
if(C){return D
}D=D.join("");
D.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(G,H,I,F){B=h(I).get();
n(B);
if(H){B=w(H).concat(B)
}if(F){B=B.concat(w(F))
}});
return B?B:w(D)
}function w(B){var A=document.createElement("div");
A.innerHTML=B;
return h.makeArray(A.childNodes)
}function d(A){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+h.trim(A).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(B,I,L,G,K,H,C){var J=h.tmpl.tag[L],D,E,F;
if(!J){throw"Template command not found: "+L
}D=J._default||[];
if(H&&!/\w$/.test(K)){K+=H;
H=""
}if(K){K=x(K);
C=C?(","+x(C)+")"):(H?")":"");
E=H?(K.indexOf(".")>-1?K+H:("("+K+").call($item"+C)):K;
F=H?E:"(typeof("+K+")==='function'?("+K+").call($item):("+K+"))"
}else{F=E=D.$1||"null"
}G=x(G);
return"');"+J[I?"close":"open"].split("$notnull_1").join(K?"typeof("+K+")!=='undefined' && ("+K+")!=null":"true").split("$1a").join(F).split("$1").join(E).split("$2").join(G?G.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(M,N,P,O){O=O?(","+O+")"):(P?")":"");
return O?("("+N+").call($item"+O):M
}):(D.$2||""))+"_.push('"
})+"');}return _;")
}function y(A,B){A._wrap=c(A,true,h.isArray(B)?B:[f.test(B)?B:h(B).html()]).join("")
}function x(A){return A?A.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null
}function l(B){var A=document.createElement("div");
A.appendChild(B.cloneNode(true));
return A.innerHTML
}function n(A){var E="_"+e,B,C,H={},D,F,G;
for(D=0,F=A.length;
D<F;
D++){if((B=A[D]).nodeType!==1){continue
}C=B.getElementsByTagName("*");
for(G=C.length-1;
G>=0;
G--){I(C[G])
}I(B)
}function I(K){var N,O=K,M,P,L;
if((L=K.getAttribute(t))){while(O.parentNode&&(O=O.parentNode).nodeType===1&&!(N=O.getAttribute(t))){}if(N!==L){O=O.parentNode?(O.nodeType===11?0:(O.getAttribute(t)||0)):0;
if(!(P=j[L])){P=z[L];
P=i(P,j[O]||z[O],null,true);
P.key=++g;
j[g]=P
}if(e){J(L)
}}K.removeAttribute(t)
}else{if(e&&(P=h.data(K,"tmplItem"))){J(P.key);
j[P.key]=P;
O=h.data(K.parentNode,"tmplItem");
O=O?O.key:0
}}if(P){M=P;
while(M&&M.key!=O){M.nodes.push(K);
M=M.parent
}delete P._ctnt;
delete P._wrap;
h.data(K,"tmplItem",P)
}function J(Q){Q=Q+E;
P=H[Q]=(H[Q]||i(P,j[P.parent.key+E]||P.parent,null,true))
}}}function o(A,D,B,C){if(!A){return m.pop()
}m.push({_:A,tmpl:D,item:this,data:B,options:C})
}function q(C,A,B){return h.tmpl(h.template(C),A,B,this)
}function s(A,C){var B=A.options||{};
B.wrapped=C;
return h.tmpl(h.template(A.tmpl),A.data,B,A.item)
}function p(A,B){var C=this._wrap;
return h.map(h(h.isArray(C)?C.join(""):C).filter(A||"*"),function(D){return B?D.innerText||D.textContent:D.outerHTML||l(D)
})
}function r(){var A=this.nodes;
h.tmpl(null,null,null,this).insertBefore(A[0]);
h(A).remove()
}})(jQuery);;!function($){var Datepicker=function(element,options){this.element=$(element);
this.format=DPGlobal.parseFormat(options.format||this.element.data("date-format")||"mm/dd/yyyy");
this.picker=$(DPGlobal.template).appendTo("body").on("mousedown",$.proxy(this.mousedown,this)).on("click",$.proxy(this.click,this));
this.isInput=this.element.is("input");
this.component=this.element.is(".date")?this.element.find(".add-on"):false;
if(this.isInput){this.element.on({focus:$.proxy(this.show,this),click:$.proxy(this.show,this),blur:$.proxy(this.blur,this),keyup:$.proxy(this.update,this),keydown:$.proxy(this.keydown,this)})
}else{if(this.component){this.component.on("click",$.proxy(this.show,this))
}else{this.element.on("click",$.proxy(this.show,this))
}}this.viewMode=0;
this.weekStart=options.weekStart||this.element.data("date-weekstart")||0;
this.weekEnd=this.weekStart==0?6:this.weekStart-1;
this.fillDow();
this.fillMonths();
this.update();
this.showMode()
};
Datepicker.prototype={constructor:Datepicker,show:function(e){this.update();
this.picker.show();
this.height=this.component?this.component.outerHeight():this.element.outerHeight();
this.place();
$(window).on("resize",$.proxy(this.place,this));
$("body").on("click",$.proxy(this.hide,this));
if(e){e.stopPropagation();
e.preventDefault()
}if(!this.isInput){$(document).on("mousedown",$.proxy(this.hide,this))
}this.element.trigger({type:"show",date:this.date})
},setValue:function(){var formated=DPGlobal.formatDate(this.date,this.format);
if(!this.isInput){if(this.component){this.element.find("input").prop("value",formated)
}this.element.data("date",formated)
}else{this.element.prop("value",formated)
}},place:function(){var offset=this.component?this.component.offset():this.element.offset();
this.picker.css({top:offset.top+this.height,left:offset.left})
},update:function(){this.date=DPGlobal.parseDate(this.isInput?this.element.prop("value"):this.element.data("date"),this.format);
this.viewDate=new Date(this.date);
this.fill()
},fillDow:function(){var dowCnt=this.weekStart;
var html="<tr>";
while(dowCnt<this.weekStart+7){html+='<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+"</th>"
}html+="</tr>";
this.picker.find(".datepicker-days thead").append(html)
},fillMonths:function(){var html="";
var i=0;
while(i<12){html+='<span class="month">'+DPGlobal.dates.monthsShort[i++]+"</span>"
}this.picker.find(".datepicker-months td").append(html)
},fill:function(){var d=new Date(this.viewDate),year=d.getFullYear(),month=d.getMonth(),currentDate=this.date.valueOf();
this.picker.find(".datepicker-days th:eq(1)").text(DPGlobal.dates.months[month]+" "+year);
var prevMonth=new Date(year,month-1,28,0,0,0,0),day=DPGlobal.getDaysInMonth(prevMonth.getFullYear(),prevMonth.getMonth());
prevMonth.setDate(day);
prevMonth.setDate(day-(prevMonth.getDay()-this.weekStart+7)%7);
var nextMonth=new Date(prevMonth);
nextMonth.setDate(nextMonth.getDate()+42);
nextMonth=nextMonth.valueOf();
var html=[];
var clsName;
while(prevMonth.valueOf()<nextMonth){if(prevMonth.getDay()==this.weekStart){html.push("<tr>")
}clsName="";
if(prevMonth.getMonth()<month){clsName+=" old"
}else{if(prevMonth.getMonth()>month){clsName+=" new"
}}if(prevMonth.valueOf()==currentDate){clsName+=" active"
}html.push('<td class="day'+clsName+'">'+prevMonth.getDate()+"</td>");
if(prevMonth.getDay()==this.weekEnd){html.push("</tr>")
}prevMonth.setDate(prevMonth.getDate()+1)
}this.picker.find(".datepicker-days tbody").empty().append(html.join(""));
var currentYear=this.date.getFullYear();
var months=this.picker.find(".datepicker-months").find("th:eq(1)").text(year).end().find("span").removeClass("active");
if(currentYear==year){months.eq(this.date.getMonth()).addClass("active")
}html="";
year=parseInt(year/10,10)*10;
var yearCont=this.picker.find(".datepicker-years").find("th:eq(1)").text(year+"-"+(year+9)).end().find("td");
year-=1;
for(var i=-1;
i<11;
i++){html+='<span class="year'+(i==-1||i==10?" old":"")+(currentYear==year?" active":"")+'">'+year+"</span>";
year+=1
}yearCont.html(html)
},blur:function(e){},hide:function(e){this.picker.hide();
$(window).off("resize",this.place);
this.viewMode=0;
this.showMode();
if(!this.isInput){$(document).off("mousedown",this.hide)
}$("body").off("click",$.proxy(this.click,this))
},click:function(e){e.stopPropagation();
e.preventDefault()
},mousedown:function(e){e.stopPropagation();
e.preventDefault();
var target=$(e.target).closest("span, td, th");
if(target.length==1){switch(target[0].nodeName.toLowerCase()){case"th":switch(target[0].className){case"switch":this.showMode(1);
break;
case"prev":case"next":this.viewDate["set"+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate,this.viewDate["get"+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate)+DPGlobal.modes[this.viewMode].navStep*(target[0].className=="prev"?-1:1));
this.fill();
break
}break;
case"span":if(target.is(".month")){var month=target.parent().find("span").index(target);
this.viewDate.setMonth(month)
}else{var year=parseInt(target.text(),10)||0;
this.viewDate.setFullYear(year)
}this.showMode(-1);
this.fill();
break;
case"td":if(target.is(".day")){var day=parseInt(target.text(),10)||1;
var month=this.viewDate.getMonth();
if(target.is(".old")){month-=1
}else{if(target.is(".new")){month+=1
}}var year=this.viewDate.getFullYear();
this.date=new Date(year,month,day,0,0,0,0);
this.viewDate=new Date(year,month,day,0,0,0,0);
this.fill();
this.setValue();
this.element.trigger({type:"changeDate",date:this.date});
this.hide()
}break
}}},keydown:function(e){var keyCode=e.keyCode||e.which;
if(keyCode==9){this.hide()
}},showMode:function(dir){if(dir){this.viewMode=Math.max(0,Math.min(2,this.viewMode+dir))
}this.picker.find(">div").hide().filter(".datepicker-"+DPGlobal.modes[this.viewMode].clsName).show()
}};
$.fn.datepicker=function(option){return this.each(function(){var $this=$(this),data=$this.data("datepicker"),options=typeof option=="object"&&option;
if(!data){$this.data("datepicker",(data=new Datepicker(this,$.extend({},$.fn.datepicker.defaults,options))))
}if(typeof option=="string"){data[option]()
}})
};
$.fn.datepicker.defaults={};
$.fn.datepicker.Constructor=Datepicker;
var DPGlobal={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],dates:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},isLeapYear:function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0))
},getDaysInMonth:function(year,month){return[31,(DPGlobal.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month]
},parseFormat:function(format){var separator=format.match(/[.\/-].*?/),parts=format.split(/\W+/);
if(!separator||!parts||parts.length==0){throw new Error("Invalid date format.")
}return{separator:separator,parts:parts}
},parseDate:function(date,format){var today=new Date();
var parts=date.split(format.separator),date=new Date(today.getFullYear(),today.getMonth(),today.getDate(),0,0,0),val;
if(parts.length==format.parts.length){for(var i=0,cnt=format.parts.length;
i<cnt;
i++){val=parseInt(parts[i],10)||1;
switch(format.parts[i]){case"dd":case"d":date.setDate(val);
break;
case"mm":case"m":date.setMonth(val-1);
break;
case"yy":if(val<100){date.setFullYear(2000+val)
}else{date.setFullYear(val)
}break;
case"yyyy":date.setFullYear(val);
break
}}}return date
},formatDate:function(date,format){var val={d:date.getDate(),m:date.getMonth()+1,yy:date.getFullYear().toString().substring(2),yyyy:date.getFullYear()};
val.dd=(val.d<10?"0":"")+val.d;
val.mm=(val.m<10?"0":"")+val.m;
var date=[];
for(var i=0,cnt=format.parts.length;
i<cnt;
i++){date.push(val[format.parts[i]])
}return date.join(format.separator)
},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'};
DPGlobal.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+DPGlobal.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+DPGlobal.headTemplate+DPGlobal.contTemplate+"</table></div></div>"
}(window.jQuery);;!function(a){var b=function(c,d){this.init("tooltip",c,d)
};
b.prototype={constructor:b,init:function(g,c,f){var d,e;
this.type=g;
this.$element=a(c);
this.options=this.getOptions(f);
this.enabled=true;
if(this.options.trigger!="manual"){d=this.options.trigger=="hover"?"mouseenter":"focus";
e=this.options.trigger=="hover"?"mouseleave":"blur";
this.$element.on(d,this.options.selector,a.proxy(this.enter,this));
this.$element.on(e,this.options.selector,a.proxy(this.leave,this))
}this.options.selector?(this._options=a.extend({},this.options,{trigger:"manual",selector:""})):this.fixTitle()
},getOptions:function(c){c=a.extend({},a.fn[this.type].defaults,c,this.$element.data());
if(c.delay&&typeof c.delay=="number"){c.delay={show:c.delay,hide:c.delay}
}return c
},enter:function(c){var d=a(c.currentTarget)[this.type](this._options).data(this.type);
if(!d.options.delay||!d.options.delay.show){d.show()
}else{d.hoverState="in";
setTimeout(function(){if(d.hoverState=="in"){d.show()
}},d.options.delay.show)
}},leave:function(c){var d=a(c.currentTarget)[this.type](this._options).data(this.type);
if(!d.options.delay||!d.options.delay.hide){d.hide()
}else{d.hoverState="out";
setTimeout(function(){if(d.hoverState=="out"){d.hide()
}},d.options.delay.hide)
}},show:function(){var c,f,h,e,d,g,i;
if(this.hasContent()&&this.enabled){c=this.tip();
this.setContent();
if(this.options.animation){c.addClass("fade")
}g=typeof this.options.placement=="function"?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement;
f=/in/.test(g);
c.remove().css({top:0,left:0,display:"block"}).appendTo(f?this.$element:document.body);
h=this.getPosition(f);
e=c[0].offsetWidth;
d=c[0].offsetHeight;
switch(f?g.split(" ")[1]:g){case"bottom":i={top:h.top+h.height,left:h.left+h.width/2-e/2};
break;
case"top":i={top:h.top-d,left:h.left+h.width/2-e/2};
break;
case"left":i={top:h.top+h.height/2-d/2,left:h.left-e};
break;
case"right":i={top:h.top+h.height/2-d/2,left:h.left+h.width};
break
}c.css(i).addClass(g).addClass("in")
}},setContent:function(){var c=this.tip();
c.find(".tooltip-inner").html(this.getTitle());
c.removeClass("fade in top bottom left right")
},hide:function(){var e=this,c=this.tip();
c.removeClass("in");
function d(){var f=setTimeout(function(){c.off(a.support.transition.end).remove()
},500);
c.one(a.support.transition.end,function(){clearTimeout(f);
c.remove()
})
}a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()
},fixTitle:function(){var c=this.$element;
if(c.attr("title")||typeof(c.attr("data-original-title"))!="string"){c.attr("data-original-title",c.attr("title")||"").removeAttr("title")
}},hasContent:function(){return this.getTitle()
},getPosition:function(c){return a.extend({},(c?{top:0,left:0}:this.$element.offset()),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})
},getTitle:function(){var e,c=this.$element,d=this.options;
e=c.attr("data-original-title")||(typeof d.title=="function"?d.title.call(c[0]):d.title);
e=e.toString().replace(/(^\s*|\s*$)/,"");
return e
},tip:function(){return this.$tip=this.$tip||a(this.options.template)
},validate:function(){if(!this.$element[0].parentNode){this.hide();
this.$element=null;
this.options=null
}},enable:function(){this.enabled=true
},disable:function(){this.enabled=false
},toggleEnabled:function(){this.enabled=!this.enabled
},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()
}};
a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;
if(!e){d.data("tooltip",(e=new b(this,f)))
}if(typeof c=="string"){e[c]()
}})
};
a.fn.tooltip.Constructor=b;
a.fn.tooltip.defaults={animation:true,delay:0,selector:false,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}
}(window.jQuery);;!function(a){var b=function(c,d){this.init("popover",c,d)
};
b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var c=this.tip(),e=this.getTitle(),d=this.getContent();
c.find(".popover-title")[a.type(e)=="object"?"append":"html"](e);
c.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d);
c.removeClass("fade top bottom left right in")
},hasContent:function(){return this.getTitle()||this.getContent()
},getContent:function(){var d,c=this.$element,e=this.options;
d=c.attr("data-content")||(typeof e.content=="function"?e.content.call(c[0]):e.content);
d=d.toString().replace(/(^\s*|\s*$)/,"");
return d
},tip:function(){if(!this.$tip){this.$tip=a(this.options.template)
}return this.$tip
}});
a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;
if(!e){d.data("popover",(e=new b(this,f)))
}if(typeof c=="string"){e[c]()
}})
};
a.fn.popover.Constructor=b;
a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})
}(window.jQuery);;!function(a){var e=function(h,j){var k=this;
this.options=j;
this.$element=a(h).addClass("pagination").empty();
var i=a("<ul/>").appendTo(this.$element);
var g=this.btnPrev=a('<li class="prev"><a href="#">'+this.options.prev+"</a></li>");
var f=this.btnNext=a('<li class="next"><a href="#">'+this.options.next+"</a></li>");
i.append(g).append(f);
this.$element.delegate("li:enabled, li","click.pagination",function(m){m.preventDefault();
var l=a(this);
var n=k.$element.find("ul");
if(l.hasClass("prev")){k.currentPage=parseInt(n.find("li.active a").text())-1
}else{if(l.hasClass("next")){k.currentPage=parseInt(n.find("li.active a").text())+1
}else{k.currentPage=parseInt(l.text())
}}k.load(--k.currentPage)
})
};
e.prototype={constructor:e,show:function(g,f){this.options.start=f||this.options.start;
this.options.total=g||this.options.total;
this.currentPage=this.options.start-1;
this.totalPages=parseInt(this.options.total/this.options.pageRows);
if(this.options.total%this.options.pageRows>0){this.totalPages++
}d.call(this,this.currentPage);
if(this.options.initLoad){this.load(this.currentPage)
}},load:function(f){d.call(this,f);
if(this.options.onChange){this.options.onChange((this.currentPage+1))
}}};
function b(l){var j=this.options;
var k=this;
var h=this.$element.find("ul");
if(j.total<=j.pageRows){return
}var m=h.find("li:last");
for(var f=l;
f<l+j.length;
f++){if(f==this.totalPages){break
}var g=a("<li/>").insertBefore(m).append(a("<a>").attr("rel",(f+1)).attr("href","#").text(f+1))
}}function d(m){var k=this.options;
var h=this.$element.find("ul");
for(var f=h.find("li").size()-2;
f>0;
f--){h.find("li").eq(f).remove()
}var g=m;
var j=k.length/2;
if(k.length%2>0){j=(k.length+1)/2
}var l=0;
if(m>=0&&m<this.totalPages){if(m>=j){if(this.totalPages-m>j){l=m-(j-1)
}else{if(this.totalPages>k.length){l=this.totalPages-k.length
}}}b.call(this,l);
h.find("li").removeClass("active");
h.find("li a[rel="+(g+1)+"]").parent().addClass("active")
}c.call(this)
}function c(){var f=this.options;
if(this.totalPages>1){if(this.currentPage>0){this.btnPrev.removeClass("disabled")
}else{this.btnPrev.addClass("disabled")
}if(this.currentPage==this.totalPages-1){this.btnNext.addClass("disabled")
}else{this.btnNext.removeClass("disabled")
}}else{this.btnPrev.addClass("disabled");
this.btnNext.addClass("disabled")
}}a.fn.pagination=function(g){var f=Array.prototype.slice.call(arguments);
f.shift();
return this.each(function(){var h=a(this),i=h.data("pagination"),j=a.extend({},a.fn.pagination.defaults,typeof g=="object"&&g);
if(!i){h.data("pagination",(i=new e(this,j)))
}if(typeof g=="string"){i[g].apply(i,f)
}})
};
a.fn.pagination.defaults={total:0,pageRows:0,length:10,next:"Next",prev:"Prev",first:"First",last:"Last",start:1,initLoad:false,onChange:null};
a.fn.pagination.Constructor=e
}(window.jQuery);;
// doc ready function
$(function () {

   // update navigation buttons
   updateNav("Teams");

   // redirect to team schedule if team row is clicked
    $("#TeamListPartial").on('click', '.table.teams-list tr td.text', function () {
        var teamId = $(this).data("teamid");
		var activeEntityId = $(this).data("activeentityid");

        location = `/Teams/Schedule/${teamId}?activeEntityId=${activeEntityId}`; 
    });
});


function teamSchedule(teamId, schoolYear) {
    $("#pageContent").empty();

    // load the schedule into the partial.  
    var ajaxUrl = "/Teams/Schedule";
    var ajaxData = {
        "teamId": teamId,
        "schoolYearId": schoolYear
    };
    $.ajax({
        type: "GET"
		, async: true
		, cache: false
		, dataType: "html"
		, url: ajaxUrl
		, data: ajaxData
		 , beforeSend: function () {
            $("#pageContent").empty();
		 }
		, error: function (jsonData, textStatus, errorThrown) {
		    alert('There was a problem getting the data. (' + errorThrown + ')');
		}
		, complete: function (jsonData, textStatus) {
		}
		, success: function (data, textStatus) {
            $("#pageContent").html(data);
		}
    });

    // switch tab text
    $("#subNavLinkTeamList").text("Back to all teams");
};$(function () {
    updateNav("Teams");

    $("#listTable tr").hover(
        function () {
            //$("#" + this.id + " .rowLogo").css("filter", "alpha(opacity=100)").css("-moz-opacity", 1).css("-khtml-opacity", 1).css("opacity", "1");
            $("#" + this.id).css("background-color", "#F7F7F7");
        },
        function () {
            //$("#" + this.id + " .rowLogo").css("filter", "alpha(opacity=30)").css("-moz-opacity", "0.30").css("-khtml-opacity", "0.30").css("opacity", "0.30");
            $("#" + this.id).css("background-color", "#FFFFFF");
        }
    );
});


function showGame(gameId){
    window.location = "/Schedule?gameId=" + gameId;
};