/* Minification failed. Returning unminified contents.
(9,8757-8776): run-time error JS5017: Syntax error in regular expression: /\<p>(.*?)\<\/p>/ig
(9,8617-8631): run-time error JS5017: Syntax error in regular expression: /\<br>(.*?)/ig
 */
/*!
 *
 * jQuery TE 1.4.0 , http://jqueryte.com/
 * Copyright (C) 2013, Fatih Koca (fattih@fattih.com), (http://jqueryte.com/about)

 * jQuery TE is provided under the MIT LICENSE.
 *
*/
(function(e){e.fn.jqte=function(t){function l(e,t,n,r,i){var s=f.length+1;return f.push({name:e,cls:s,command:t,key:n,tag:r,emphasis:i})}var n=[{title:"Text Format"},{title:"Font Size"},{title:"Color"},{title:"Bold",hotkey:"B"},{title:"Italic",hotkey:"I"},{title:"Underline",hotkey:"U"},{title:"Ordered List",hotkey:"."},{title:"Unordered List",hotkey:","},{title:"Subscript",hotkey:"down arrow"},{title:"Superscript",hotkey:"up arrow"},{title:"Outdent",hotkey:"left arrow"},{title:"Indent",hotkey:"right arrow"},{title:"Justify Left"},{title:"Justify Center"},{title:"Justify Right"},{title:"Strike Through",hotkey:"K"},{title:"Add Link",hotkey:"L"},{title:"Remove Link"},{title:"Cleaner Style",hotkey:"Delete"},{title:"Horizontal Rule",hotkey:"H"},{title:"Source"}];var r=[["p","Normal"],["h1","Header 1"],["h2","Header 2"],["h3","Header 3"],["h4","Header 4"],["h5","Header 5"],["h6","Header 6"],["pre","Preformatted"]];var i=["10","12","16","18","20","24","28"];var s=["0,0,0","68,68,68","102,102,102","153,153,153","204,204,204","238,238,238","243,243,243","255,255,255",null,"255,0,0","255,153,0","255,255,0","0,255,0","0,255,255","0,0,255","153,0,255","255,0,255",null,"244,204,204","252,229,205","255,242,204","217,234,211","208,224,227","207,226,243","217,210,233","234,209,220","234,153,153","249,203,156","255,229,153","182,215,168","162,196,201","159,197,232","180,167,214","213,166,189","224,102,102","246,178,107","255,217,102","147,196,125","118,165,175","111,168,220","142,124,195","194,123,160","204,0,0","230,145,56","241,194,50","106,168,79","69,129,142","61,133,198","103,78,167","166,77,121","153,0,0","180,95,6","191,144,0","56,118,29","19,79,92","11,83,148","53,28,117","116,27,71","102,0,0","120,63,4","127,96,0","39,78,19","12,52,61","7,55,99","32,18,77","76,17,48"];var o=["Web Address","E-mail Address","Picture URL"];var u=e.extend({status:true,css:"jqte",title:true,titletext:n,button:"OK",format:true,formats:r,fsize:true,fsizes:i,funit:"px",color:true,linktypes:o,b:true,i:true,u:true,ol:true,ul:true,sub:true,sup:true,outdent:true,indent:true,left:true,center:true,right:true,strike:true,link:true,unlink:true,remove:true,rule:true,source:true,placeholder:false,br:true,p:true,change:"",focus:"",blur:""},t);e.fn.jqteVal=function(t){e(this).closest("."+u.css).find("."+u.css+"_editor").html(t)};var a=navigator.userAgent.toLowerCase();if(/msie [1-7]./.test(a))u.title=false;var f=[];l("format","formats","","",false);l("fsize","fSize","","",false);l("color","colors","","",false);l("b","Bold","B",["b","strong"],true);l("i","Italic","I",["i","em"],true);l("u","Underline","U",["u"],true);l("ol","insertorderedlist","¾",["ol"],true);l("ul","insertunorderedlist","¼",["ul"],true);l("sub","subscript","(",["sub"],true);l("sup","superscript","&",["sup"],true);l("outdent","outdent","%",["blockquote"],false);l("indent","indent","'",["blockquote"],true);l("left","justifyLeft","","",false);l("center","justifyCenter","","",false);l("right","justifyRight","","",false);l("strike","strikeThrough","K",["strike"],true);l("link","linkcreator","L",["a"],true);l("unlink","unlink","",["a"],false);l("remove","removeformat",".","",false);l("rule","inserthorizontalrule","H",["hr"],false);l("source","displaysource","","",false);return this.each(function(){function B(){if(window.getSelection)return window.getSelection();else if(document.selection&&document.selection.createRange&&document.selection.type!="None")return document.selection.createRange()}function j(e,t){var n,r=B();if(window.getSelection){if(r.anchorNode&&r.getRangeAt)n=r.getRangeAt(0);if(n){r.removeAllRanges();r.addRange(n)}if(!a.match(/msie/))document.execCommand("StyleWithCSS",false,false);document.execCommand(e,false,t)}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection.createRange();n.execCommand(e,false,t)}q(false,false)}function F(t,n,r){if(v.not(":focus"))v.focus();if(window.getSelection){var i=B(),s,o,u;if(i.anchorNode&&i.getRangeAt){s=i.getRangeAt(0);o=document.createElement(t);e(o).attr(n,r);u=s.extractContents();o.appendChild(u);s.insertNode(o);i.removeAllRanges();if(n=="style")q(e(o),r);else q(e(o),false)}}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){var a=document.selection.createRange();var f=a.htmlText;var l="<"+t+" "+n+'="'+r+'">'+f+"</"+t+">";document.selection.createRange().pasteHTML(l)}}function q(e,t){var n=I();n=n?n:e;if(n&&t==false){if(n.parent().is("[style]"))n.attr("style",n.parent().attr("style"));if(n.is("[style]"))n.find("*").attr("style",n.attr("style"))}else if(e&&t&&e.is("[style]")){var r=t.split(";");r=r[0].split(":");if(e.is("[style*="+r[0]+"]"))e.find("*").css(r[0],r[1]);R(e)}}function R(t){if(t){var t=t[0];if(document.body.createTextRange){var n=document.body.createTextRange();n.moveToElementText(t);n.select()}else if(window.getSelection){var r=window.getSelection();var n=document.createRange();if(t!="undefined"&&t!=null){n.selectNodeContents(t);r.removeAllRanges();r.addRange(n);if(e(t).is(":empty")){e(t).append(" ");R(e(t))}}}}}function U(){if(!p.data("sourceOpened")){var t=I();var n="http://";W(true);if(t){var r=t.prop("tagName").toLowerCase();if(r=="a"&&t.is("[href]")){n=t.attr("href");t.attr(S,"")}else F("a",S,"")}else y.val(n).focus();g.click(function(t){if(e(t.target).hasClass(u.css+"_linktypetext")||e(t.target).hasClass(u.css+"_linktypearrow"))X(true)});w.find("a").click(function(){var t=e(this).attr(u.css+"-linktype");w.data("linktype",t);E.find("."+u.css+"_linktypetext").html(w.find("a:eq("+w.data("linktype")+")").text());V(n);X()});V(n);y.focus().val(n).bind("keypress keyup",function(e){if(e.keyCode==13){z(h.find("["+S+"]"));return false}});b.click(function(){z(h.find("["+S+"]"))})}else W(false)}function z(t){y.focus();R(t);t.removeAttr(S);if(w.data("linktype")!="2")j("createlink",y.val());else{j("insertImage",y.val());v.find("img").each(function(){var t=e(this).prev("a");var n=e(this).next("a");if(t.length>0&&t.html()=="")t.remove();else if(n.length>0&&n.html()=="")n.remove()})}W();v.trigger("change")}function W(e){Q("["+S+"]:not([href])");h.find("["+S+"][href]").removeAttr(S);if(e){p.data("linkOpened",true);d.show()}else{p.data("linkOpened",false);d.hide()}X()}function X(e){if(e)w.show();else w.hide()}function V(e){var t=w.data("linktype");if(t=="1"&&(y.val()=="http://"||y.is("[value^=http://]")||!y.is("[value^=mailto]")))y.val("mailto:");else if(t!="1"&&!y.is("[value^=http://]"))y.val("http://");else y.val(e)}function J(t){if(!p.data("sourceOpened")){if(t=="fSize")styleField=P;else if(t=="colors")styleField=H;K(styleField,true);styleField.find("a").unbind("click").click(function(){var n=e(this).attr(u.css+"-styleval");if(t=="fSize"){styleType="font-size";n=n+u.funit}else if(t=="colors"){styleType="color";n="rgb("+n+")"}var r=G(styleType);F("span","style",styleType+":"+n+";"+r);K("",false);e("."+u.css+"_title").remove();v.trigger("change")})}else K(styleField,false);W(false)}function K(e,t){var n="",r=[{d:"fsizeOpened",f:P},{d:"cpallOpened",f:H}];if(e!=""){for(var i=0;i<r.length;i++){if(e==r[i]["f"])n=r[i]}}if(t){p.data(n["d"],true);n["f"].slideDown(100);for(var i=0;i<r.length;i++){if(n["d"]!=r[i]["d"]){p.data(r[i]["d"],false);r[i]["f"].slideUp(100)}}}else{for(var i=0;i<r.length;i++){p.data(r[i]["d"],false);r[i]["f"].slideUp(100)}}}function Q(t){h.find(t).each(function(){e(this).before(e(this).html()).remove()})}function G(e){var t=I();if(t&&t.is("[style]")&&t.css(e)!=""){var n=t.css(e);t.css(e,"");var r=t.attr("style");t.css(e,n);return r}else return""}function Y(){Z(true);D.find("a").click(function(){e("*",this).click(function(e){e.preventDefault();return false});et(e(this).text());var t=e(this).attr(u.css+"-formatval");j("formatBlock","<"+t+">");Z(false)})}function Z(e){var t=e?true:false;t=e&&D.data("status")?true:false;if(t||!e)D.data("status",false).slideUp(200);else D.data("status",true).slideDown(200)}function et(e){var t=D.closest("."+u.css+"_tool").find("."+u.css+"_tool_label").find("."+u.css+"_tool_text");if(e.length>10)e=e.substr(0,7)+"...";t.html(e)}function tt(e){var t,n,r;t=e.replace(/\n/gim,"").replace(/\r/gim,"").replace(/\t/gim,"").replace(/ /gim," ");n=[/\<span(|\s+.*?)><span(|\s+.*?)>(.*?)<\/span><\/span>/gim,/<(\w*[^p])\s*[^\/>]*>\s*<\/\1>/gim,/\<div(|\s+.*?)>(.*?)\<\/div>/gim,/\<strong(|\s+.*?)>(.*?)\<\/strong>/gim,/\<em(|\s+.*?)>(.*?)\<\/em>/gim];r=["<span$2>$3</span>","","<p$1>$2</p>","<b$1>$2</b>","<i$1>$2</i>"];for(A=0;A<5;A++){for(var i=0;i<n.length;i++){t=t.replace(n[i],r[i])}}if(!u.p)t=t.replace(/\<p(|\s+.*?)>(.*?)\<\/p>/ig,"<br/>$2");if(!u.br){n=[/\<br>(.*?)/ig,/\<br\/>(.*?)/ig];r=["<p>$1</p>","<p>$1</p>"];for(var i=0;i<n.length;i++){t=t.replace(n[i],r[i])}}if(!u.p&&!u.br)t=t.replace(/\<p>(.*?)\<\/p>/ig,"<div>$1</div>");return t}function nt(){var e=v.text()==""&&v.html().length<12?"":v.html();l.val(tt(e))}function rt(){v.html(tt(l.val()))}function it(t){var n=false,r=I(),i;if(r){e.each(t,function(t,s){i=r.prop("tagName").toLowerCase();if(i==s)n=true;else{r.parents().each(function(){i=e(this).prop("tagName").toLowerCase();if(i==s)n=true})}});return n}else return false}function st(t){for(var n=0;n<f.length;n++){if(u[f[n].name]&&f[n].emphasis&&f[n].tag!="")it(f[n].tag)?p.find("."+u.css+"_tool_"+f[n].cls).addClass(m):e("."+u.css+"_tool_"+f[n].cls).removeClass(m)}if(u.format&&e.isArray(u.formats)){var r=false;for(var i=0;i<u.formats.length;i++){var s=[];s[0]=u.formats[i][0];if(u.formats[i][0].length>0&&it(s)){et(u.formats[i][1]);r=true;break}}if(!r)et(u.formats[0][1])}K("",false);Z(false)}if(!e(this).data("jqte")||e(this).data("jqte")==null||e(this).data("jqte")=="undefined")e(this).data("jqte",true);else e(this).data("jqte",false);if(!u.status||!e(this).data("jqte")){if(e(this).closest("."+u.css).length>0){var t=e(this).closest("."+u.css).find("."+u.css+"_editor").html();var n="";e(e(this)[0].attributes).each(function(){if(this.nodeName!="style")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});var r=e(this).is("[data-origin]")&&e(this).attr("data-origin")!=""?e(this).attr("data-origin"):"textarea";var i=">"+t;if(r=="input"||r=="option"){t=t.replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"<").replace(/>/g,">");i='value="'+t+'">'}var o=e(this).clone();e(this).data("jqte",false).closest("."+u.css).before(o).remove();o.replaceWith("<"+r+n+i+"</"+r+">")}return}var l=e(this);var r=e(this).prop("tagName").toLowerCase();e(this).attr("data-origin",r);var c=e(this).is("[value]")||r=="textarea"?e(this).val():e(this).html();c=c.replace(/&#34;/g,'"').replace(/&#39;/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");e(this).after('<div class="'+u.css+'"></div>');var h=e(this).next("."+u.css);h.html('<div class="'+u.css+"_toolbar"+'" role="toolbar" unselectable></div><div class="'+u.css+'_linkform" style="display:none" role="dialog"></div><div class="'+u.css+"_editor"+'"></div>');var p=h.find("."+u.css+"_toolbar");var d=h.find("."+u.css+"_linkform");var v=h.find("."+u.css+"_editor");var m=u.css+"_tool_depressed";d.append('<div class="'+u.css+'_linktypeselect" unselectable></div><input class="'+u.css+'_linkinput" type="text/css" value=""><div class="'+u.css+'_linkbutton" unselectable>'+u.button+'</div> <div style="height:1px;float:none;clear:both"></div>');var g=d.find("."+u.css+"_linktypeselect");var y=d.find("."+u.css+"_linkinput");var b=d.find("."+u.css+"_linkbutton");g.append('<div class="'+u.css+'_linktypeview" unselectable></div><div class="'+u.css+'_linktypes" role="menu" unselectable></div>');var w=g.find("."+u.css+"_linktypes");var E=g.find("."+u.css+"_linktypeview");var S=u.css+"-setlink";v.after('<div class="'+u.css+"_source "+u.css+'_hiddenField"></div>');var x=h.find("."+u.css+"_source");l.appendTo(x);if(r!="textarea"){var n="";e(l[0].attributes).each(function(){if(this.nodeName!="type"&&this.nodeName!="value")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});l.replaceWith("<textarea "+n+">"+c+"</textarea>");l=x.find("textarea")}v.attr("contenteditable","true").html(c);for(var T=0;T<f.length;T++){if(u[f[T].name]){var N=f[T].key.length>0?u.titletext[T].hotkey!=null&&u.titletext[T].hotkey!="undefined"&&u.titletext[T].hotkey!=""?" (Ctrl+"+u.titletext[T].hotkey+")":"":"";var C=u.titletext[T].title!=null&&u.titletext[T].title!="undefined"&&u.titletext[T].title!=""?u.titletext[T].title+N:"";p.append('<div class="'+u.css+"_tool "+u.css+"_tool_"+f[T].cls+'" role="button" data-tool="'+T+'" unselectable><a class="'+u.css+'_tool_icon" unselectable></a></div>');p.find("."+u.css+"_tool[data-tool="+T+"]").data({tag:f[T].tag,command:f[T].command,emphasis:f[T].emphasis,title:C});if(f[T].name=="format"&&e.isArray(u.formats)){var k=u.formats[0][1].length>0&&u.formats[0][1]!="undefined"?u.formats[0][1]:"";p.find("."+u.css+"_tool_"+f[T].cls).find("."+u.css+"_tool_icon").replaceWith('<a class="'+u.css+'_tool_label" unselectable><span class="'+u.css+'_tool_text" unselectable>'+k+'</span><span class="'+u.css+'_tool_icon" unselectable></span></a>');p.find("."+u.css+"_tool_"+f[T].cls).append('<div class="'+u.css+'_formats" unselectable></div>');for(var L=0;L<u.formats.length;L++){p.find("."+u.css+"_formats").append("<a "+u.css+'-formatval="'+u.formats[L][0]+'" class="'+u.css+"_format"+" "+u.css+"_format_"+L+'" role="menuitem" unselectable>'+u.formats[L][1]+"</a>")}p.find("."+u.css+"_formats").data("status",false)}else if(f[T].name=="fsize"&&e.isArray(u.fsizes)){p.find("."+u.css+"_tool_"+f[T].cls).append('<div class="'+u.css+'_fontsizes" unselectable></div>');for(var L=0;L<u.fsizes.length;L++){p.find("."+u.css+"_fontsizes").append("<a "+u.css+'-styleval="'+u.fsizes[L]+'" class="'+u.css+"_fontsize"+'" style="font-size:'+u.fsizes[L]+u.funit+'" role="menuitem" unselectable>Abcdefgh...</a>')}}else if(f[T].name=="color"&&e.isArray(s)){p.find("."+u.css+"_tool_"+f[T].cls).append('<div class="'+u.css+'_cpalette" unselectable></div>');for(var A=0;A<s.length;A++){if(s[A]!=null)p.find("."+u.css+"_cpalette").append("<a "+u.css+'-styleval="'+s[A]+'" class="'+u.css+"_color"+'" style="background-color: rgb('+s[A]+')" role="gridcell" unselectable></a>');else p.find("."+u.css+"_cpalette").append('<div class="'+u.css+"_colorSeperator"+'"></div>')}}}}w.data("linktype","0");for(var T=0;T<3;T++){w.append("<a "+u.css+'-linktype="'+T+'" unselectable>'+u.linktypes[T]+"</a>");E.html('<div class="'+u.css+'_linktypearrow" unselectable></div><div class="'+u.css+'_linktypetext">'+w.find("a:eq("+w.data("linktype")+")").text()+"</div>")}var O="";if(/msie/.test(a))O="-ms-";else if(/chrome/.test(a)||/safari/.test(a)||/yandex/.test(a))O="-webkit-";else if(/mozilla/.test(a))O="-moz-";else if(/opera/.test(a))O="-o-";else if(/konqueror/.test(a))O="-khtml-";else O="";if(u.placeholder&&u.placeholder!=""){h.prepend('<div class="'+u.css+'_placeholder" unselectable><div class="'+u.css+'_placeholder_text">'+u.placeholder+"</div></div>");var M=h.find("."+u.css+"_placeholder");M.click(function(){v.focus()})}h.find("[unselectable]").css(O+"user-select","none").addClass("unselectable").attr("unselectable","on").on("selectstart mousedown",false);var _=p.find("."+u.css+"_tool");var D=p.find("."+u.css+"_formats");var P=p.find("."+u.css+"_fontsizes");var H=p.find("."+u.css+"_cpalette");var I=function(){var t,n;if(window.getSelection){n=getSelection();t=n.anchorNode}if(!t&&document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection;var r=n.getRangeAt?n.getRangeAt(0):n.createRange();t=r.commonAncestorContainer?r.commonAncestorContainer:r.parentElement?r.parentElement():r.item(0)}if(t){return t.nodeName=="#text"?e(t.parentNode):e(t)}else return false};_.unbind("click").click(function(t){if(e(this).data("command")=="displaysource"&&!p.data("sourceOpened")){p.find("."+u.css+"_tool").addClass(u.css+"_hiddenField");e(this).removeClass(u.css+"_hiddenField");p.data("sourceOpened",true);l.css("height",v.outerHeight());x.removeClass(u.css+"_hiddenField");v.addClass(u.css+"_hiddenField");l.focus();W(false);K("",false);Z();if(u.placeholder&&u.placeholder!="")M.hide()}else{if(!p.data("sourceOpened")){if(e(this).data("command")=="linkcreator"){if(!p.data("linkOpened"))U();else{W(false);Z(false)}}else if(e(this).data("command")=="formats"){if(e(this).data("command")=="formats"&&!e(t.target).hasClass(u.css+"_format"))Y();K("",false);if(v.not(":focus"))v.focus()}else if(e(this).data("command")=="fSize"||e(this).data("command")=="colors"){if(e(this).data("command")=="fSize"&&!e(t.target).hasClass(u.css+"_fontsize")||e(this).data("command")=="colors"&&!e(t.target).hasClass(u.css+"_color"))J(e(this).data("command"));Z(false);if(v.not(":focus"))v.focus()}else{if(v.not(":focus"))v.focus();j(e(this).data("command"),null);K("",false);Z(false);X();e(this).data("emphasis")==true&&!e(this).hasClass(m)?e(this).addClass(m):e(this).removeClass(m);x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}}else{p.data("sourceOpened",false);p.find("."+u.css+"_tool").removeClass(u.css+"_hiddenField");x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}if(u.placeholder&&u.placeholder!="")v.html()!=""?M.hide():M.show()}v.trigger("change")}).hover(function(t){if(u.title&&e(this).data("title")!=""&&(e(t.target).hasClass(u.css+"_tool")||e(t.target).hasClass(u.css+"_tool_icon"))){e("."+u.css+"_title").remove();h.append('<div class="'+u.css+'_title"><div class="'+u.css+'_titleArrow"><div class="'+u.css+'_titleArrowIcon"></div></div><div class="'+u.css+'_titleText">'+e(this).data("title")+"</div></div>");var n=e("."+u.css+"_title:first");var r=n.find("."+u.css+"_titleArrowIcon");var i=e(this).position();var s=i.left+e(this).outerWidth()-n.outerWidth()/2-e(this).outerWidth()/2;var o=i.top+e(this).outerHeight()+5;n.delay(400).css({top:o,left:s}).fadeIn(200)}},function(){e("."+u.css+"_title").remove()});var ot=null;v.bind("keypress keyup keydown drop cut copy paste DOMCharacterDataModified DOMSubtreeModified",function(){if(!p.data("sourceOpened"))e(this).trigger("change");X();if(e.isFunction(u.change))u.change();if(u.placeholder&&u.placeholder!="")e(this).text()!=""?M.hide():M.show()}).bind("change",function(){if(!p.data("sourceOpened")){clearTimeout(ot);ot=setTimeout(nt,10)}}).keydown(function(e){if(e.ctrlKey){for(var t=0;t<f.length;t++){if(u[f[t].name]&&e.keyCode==f[t].key.charCodeAt(0)){if(f[t].command!=""&&f[t].command!="linkcreator")j(f[t].command,null);else if(f[t].command=="linkcreator")U();return false}}}}).bind("mouseup keyup",st).focus(function(){if(e.isFunction(u.focus))u.focus();h.addClass(u.css+"_focused");if(/opera/.test(a)){var t=document.createRange();t.selectNodeContents(v[0]);t.collapse(false);var n=window.getSelection();n.removeAllRanges();n.addRange(t)}}).focusout(function(){_.removeClass(m);K("",false);Z(false);X();if(e.isFunction(u.blur))u.blur();h.removeClass(u.css+"_focused");if(e.isArray(u.formats))et(u.formats[0][1])});l.bind("keydown keyup",function(){setTimeout(rt,0);e(this).height(e(this)[0].scrollHeight);if(e(this).val()=="")e(this).height(0)}).focus(function(){h.addClass(u.css+"_focused")}).focusout(function(){h.removeClass(u.css+"_focused")})})}})(jQuery);
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */

/**
* bootstrap.js v3.0.0 by @fat and @mdo
* Copyright 2013 Twitter Inc.
* http://www.apache.org/licenses/LICENSE-2.0
*/
if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;if("top"==b&&j!=f&&(c=!0,a.top=a.top+f-j),/bottom|top/.test(b)){var k=0;a.left<0&&(k=-2*a.left,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach()}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.$element.trigger("hidden.bs."+this.type),this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery);;
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='&shy;<style media="'+h+'"> #mq-test-1 { width: 42px; }</style>';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document);

/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
(function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B<y;B++){A=D[B],z=A.href,C=A.media,x=A.rel&&A.rel.toLowerCase()==="stylesheet";if(!!z&&x&&!o[z]){if(A.styleSheet&&A.styleSheet.rawCssText){m(A.styleSheet.rawCssText,z,C);o[z]=true}else{if((!/^([a-zA-Z:]*\/\/)/.test(z)&&!g)||z.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:z,media:C})}}}}u()},u=function(){if(d.length){var x=d.shift();n(x.href,function(y){m(y,x.href,x.media);o[x.href]=true;u()})}},m=function(I,x,z){var G=I.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),J=G&&G.length||0,x=x.substring(0,x.lastIndexOf("/")),y=function(K){return K.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+x+"$2$3")},A=!J&&z,D=0,C,E,F,B,H;if(x.length){x+="/"}if(A){J=1}for(;D<J;D++){C=0;if(A){E=z;k.push(y(I))}else{E=G[D].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&y(RegExp.$2))}B=E.split(",");H=B.length;for(;C<H;C++){F=B[C];i.push({media:F.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:k.length-1,hasquery:F.indexOf("(")>-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l<h){clearTimeout(r);r=setTimeout(j,h);return}else{l=z}for(var E in i){var K=i[E],C=K.minw,J=K.maxw,A=C===null,L=J===null,y="em";if(!!C){C=parseFloat(C)*(C.indexOf(y)>-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this);;
/*
 * QueryLoader v2 - A simple script to create a preloader for images
 *
 * For instructions read the original post:
 * http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/
 *
 * Copyright (c) 2011 - Gaya Kessler
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Version:  2.2
 * Last update: 03-04-2012
 *
 */
(function ($) {
    /*Browser detection patch*/
    jQuery.browser = {};
    jQuery.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase());
    jQuery.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
    jQuery.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
    jQuery.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());

    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function (elt /*, from*/) {
            var len = this.length >>> 0;
            var from = Number(arguments[1]) || 0;
            from = (from < 0)
                ? Math.ceil(from)
                : Math.floor(from);
            if (from < 0)
                from += len;

            for (; from < len; from++) {
                if (from in this &&
                    this[from] === elt)
                    return from;
            }
            return -1;
        };
    }

    var qLimages = [];
    var qLdone = 0;
    var qLdestroyed = false;

    var qLimageContainer = "";
    var qLoverlay = "";
    var qLbar = "";
    var qLpercentage = "";
    var qLimageCounter = 0;
    var qLstart = 0;

    var qLoptions = {
        onComplete: function () { },
        backgroundColor: "#000",
        barColor: "#fff",
        overlayId: 'qLoverlay',
        barHeight: 1,
        percentage: false,
        deepSearch: true,
        completeAnimation: "fade",
        minimumTime: 500,
        onLoadComplete: function () {
            if (qLoptions.completeAnimation == "grow") {
                var animationTime = 500;
                var currentTime = new Date();
                if ((currentTime.getTime() - qLstart) < qLoptions.minimumTime) {
                    animationTime = (qLoptions.minimumTime - (currentTime.getTime() - qLstart));
                }

                $(qLbar).stop().animate({
                    "width": "100%"
                }, animationTime, function () {
                    $(this).animate({
                        top: "0%",
                        width: "100%",
                        height: "100%"
                    }, 500, function () {
                        $('#' + qLoptions.overlayId).fadeOut(500, function () {
                            $(this).remove();
                            qLoptions.onComplete();
                        })
                    });
                });
            } else {
                $('#' + qLoptions.overlayId).fadeOut(500, function () {
                    $('#' + qLoptions.overlayId).remove();
                    qLoptions.onComplete();
                });
            }
        }
    };

    var afterEach = function () {
        //start timer
        //qLdestroyed = false;
        var currentTime = new Date();
        qLstart = currentTime.getTime();

        if (qLimages.length > 0) {
            createPreloadContainer();
            createOverlayLoader();
        } else {
            //no images == instant exit
            destroyQueryLoader();
        }
    };

    var createPreloadContainer = function () {
        qLimageContainer = $("<div></div>").appendTo("body").css({
            display: "none",
            width: 0,
            height: 0,
            overflow: "hidden"
        });

        for (var i = 0; qLimages.length > i; i++) {
            $.ajax({
                url: qLimages[i],
                type: 'HEAD',
                complete: function (data) {
                    if (!qLdestroyed) {
                        qLimageCounter++;
                        addImageForPreload(this['url']);
                    }
                }
            });
        }

    };

    var addImageForPreload = function (url) {
        var image = $("<img />").attr("src", url).bind("load error", function () {
            completeImageLoading();
        }).appendTo(qLimageContainer);
    };

    var completeImageLoading = function () {
        qLdone++;

        var percentage = (qLdone / qLimageCounter) * 100;
        $(qLbar).stop().animate({
            width: percentage + "%",
            minWidth: percentage + "%"
        }, 200);

        if (qLoptions.percentage == true) {
            $(qLpercentage).text(Math.ceil(percentage) + "%");
        }

        if (qLdone == qLimageCounter) {
            destroyQueryLoader();
        }
    };

    var destroyQueryLoader = function () {
        $(qLimageContainer).remove();
        qLoptions.onLoadComplete();
        qLdestroyed = true;
    };

    var createOverlayLoader = function () {
        qLoverlay = $("<div id='" + qLoptions.overlayId + "'></div>").css({
            width: "100%",
            height: "100%",
            backgroundColor: qLoptions.backgroundColor,
            backgroundPosition: "fixed",
            position: "fixed",
            zIndex: 666999,
            top: 0,
            left: 0
        }).appendTo("body");
        qLbar = $("<div id='qLbar'></div>").css({
            height: qLoptions.barHeight + "px",
            marginTop: "-" + (qLoptions.barHeight / 2) + "px",
            backgroundColor: qLoptions.barColor,
            width: "0%",
            position: "absolute",
            top: "50%"
        }).appendTo(qLoverlay);
        if (qLoptions.percentage == true) {
            qLpercentage = $("<div id='qLpercentage'></div>").text("0%").css({
                height: "40px",
                width: "100px",
                position: "absolute",
                fontSize: "4em",
                top: "50%",
                left: "50%",
                marginTop: "-" + (59 + qLoptions.barHeight) + "px",
                textAlign: "center",
                marginLeft: "-50px",
                color: qLoptions.barColor
            }).appendTo(qLoverlay);
        }
        if (!qLimages.length) {
            destroyQueryLoader()
        }
    };

    var findImageInElement = function (element) {
        var url = "";

        if ($(element).css("background-image") != "none") {
            var url = $(element).css("background-image");
        } else if (typeof ($(element).attr("src")) != "undefined" && element.nodeName.toLowerCase() == "img") {
            var url = $(element).attr("src");
        }

        if (url.indexOf("gradient") == -1) {
            url = url.replace(/url\(\"/g, "");
            url = url.replace(/url\(/g, "");
            url = url.replace(/\"\)/g, "");
            url = url.replace(/\)/g, "");

            var urls = url.split(", ");

            for (var i = 0; i < urls.length; i++) {
                if (urls[i].length > 0 && qLimages.indexOf(urls[i]) == -1 && !urls[i].match(/^(data:)/i)) {
                    var extra = "";
                    if ($.browser.msie && $.browser.version < 9) {
                        extra = "?" + Math.floor(Math.random() * 3000);
                    }
                    qLimages.push(urls[i] + extra);
                }
            }
        }
    }

    $.fn.queryLoader2 = function (options) {
        if (options) {
            $.extend(qLoptions, options);
        }

        this.each(function () {
            findImageInElement(this);
            if (qLoptions.deepSearch == true) {
                $(this).find("*:not(script)").each(function () {
                    findImageInElement(this);
                });
            }
        });

        afterEach();

        return this;
    };

    //browser detect
    var BrowserDetect = {
        init: function () {
            this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
            this.version = this.searchVersion(navigator.userAgent)
                || this.searchVersion(navigator.appVersion)
                || "an unknown version";
            this.OS = this.searchString(this.dataOS) || "an unknown OS";
        },
        searchString: function (data) {
            for (var i = 0; i < data.length; i++) {
                var dataString = data[i].string;
                var dataProp = data[i].prop;
                this.versionSearchString = data[i].versionSearch || data[i].identity;
                if (dataString) {
                    if (dataString.indexOf(data[i].subString) != -1)
                        return data[i].identity;
                }
                else if (dataProp)
                    return data[i].identity;
            }
        },
        searchVersion: function (dataString) {
            var index = dataString.indexOf(this.versionSearchString);
            if (index == -1) return;
            return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
        },
        dataBrowser: [
            {
                string: navigator.userAgent,
                subString: "Chrome",
                identity: "Chrome"
            },
            {
                string: navigator.userAgent,
                subString: "OmniWeb",
                versionSearch: "OmniWeb/",
                identity: "OmniWeb"
            },
            {
                string: navigator.vendor,
                subString: "Apple",
                identity: "Safari",
                versionSearch: "Version"
            },
            {
                prop: window.opera,
                identity: "Opera",
                versionSearch: "Version"
            },
            {
                string: navigator.vendor,
                subString: "iCab",
                identity: "iCab"
            },
            {
                string: navigator.vendor,
                subString: "KDE",
                identity: "Konqueror"
            },
            {
                string: navigator.userAgent,
                subString: "Firefox",
                identity: "Firefox"
            },
            {
                string: navigator.vendor,
                subString: "Camino",
                identity: "Camino"
            },
            {		// for newer Netscapes (6+)
                string: navigator.userAgent,
                subString: "Netscape",
                identity: "Netscape"
            },
            {
                string: navigator.userAgent,
                subString: "MSIE",
                identity: "Explorer",
                versionSearch: "MSIE"
            },
            {
                string: navigator.userAgent,
                subString: "Gecko",
                identity: "Mozilla",
                versionSearch: "rv"
            },
            { 		// for older Netscapes (4-)
                string: navigator.userAgent,
                subString: "Mozilla",
                identity: "Netscape",
                versionSearch: "Mozilla"
            }
        ],
        dataOS: [
            {
                string: navigator.platform,
                subString: "Win",
                identity: "Windows"
            },
            {
                string: navigator.platform,
                subString: "Mac",
                identity: "Mac"
            },
            {
                string: navigator.userAgent,
                subString: "iPhone",
                identity: "iPhone/iPod"
            },
            {
                string: navigator.platform,
                subString: "Linux",
                identity: "Linux"
            }
        ]

    };
    BrowserDetect.init();
    jQuery.browser.version = BrowserDetect.version;
})(jQuery);;
/* 
SmoothScroll v0.9.9
Licensed under the terms of the MIT license.

People involved
- Balazs Galambosi: maintainer (CHANGELOG.txt)
- Patrick Brunner (patrickb1991@gmail.com)
- Michael Herf: ssc_pulse Algorithm
*/

jQuery(document).ready(function ($) {

    // Scroll Variables (tweakable)
    var ssc_framerate = 150; // [Hz]
    var ssc_animtime = 700; // [px]
    var ssc_stepsize = 170; // [px]

    // ssc_pulse (less tweakable)
    // ratio of "tail" to "acceleration"
    var ssc_pulseAlgorithm = true;
    var ssc_pulseScale = 6;
    var ssc_pulseNormalize = 1;

    // Keyboard Settings
    var ssc_keyboardsupport = true;
    var ssc_arrowscroll = 60; // [px]

    // Other Variables
    var ssc_frame = false;
    var ssc_direction = { x: 0, y: 0 };
    var ssc_initdone = false;
    var ssc_fixedback = true;
    var ssc_root = document.documentElement;
    var ssc_activeElement;

    var ssc_key = { left: 37, up: 38, right: 39, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 };

    /***********************************************
     * INITIALIZE
     ***********************************************/

    /**
     * Sets up scrolls array, determines if ssc_frames are involved.
     */
    function ssc_init() {

        if (!document.body) return;

        var body = document.body;
        var html = document.documentElement;
        var windowHeight = window.innerHeight;
        var scrollHeight = body.scrollHeight;

        // check compat mode for ssc_root element
        ssc_root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;
        ssc_activeElement = body;

        ssc_initdone = true;

        // Checks if this script is running in a ssc_frame
        if (top != self) {
            ssc_frame = true;
        }

            /**
             * This fixes a bug where the areas left and right to 
             * the content does not trigger the onmousewheel event
             * on some pages. e.g.: html, body { height: 100% }
             */
        else if (scrollHeight > windowHeight &&
                (body.offsetHeight <= windowHeight ||
                 html.offsetHeight <= windowHeight)) {
            ssc_root.style.height = "auto";
            if (ssc_root.offsetHeight <= windowHeight) {
                var underlay = document.createElement("div");
                underlay.style.clear = "both";
                body.appendChild(underlay);
            }
        }

        if (!ssc_fixedback) {
            body.style.backgroundAttachment = "scroll";
            html.style.backgroundAttachment = "scroll";
        }

        if (ssc_keyboardsupport) {
            ssc_addEvent("keydown", ssc_keydown);
        }
    }


    /************************************************
     * SCROLLING 
     ************************************************/

    var ssc_que = [];
    var ssc_pending = false;

    /**
     * Pushes scroll actions to the scrolling queue.
     */
    function ssc_scrollArray(elem, left, top, delay) {

        delay || (delay = 1000);
        ssc_directionCheck(left, top);

        // push a scroll command
        ssc_que.push({
            x: left,
            y: top,
            lastX: (left < 0) ? 0.99 : -0.99,
            lastY: (top < 0) ? 0.99 : -0.99,
            start: +new Date
        });

        // don't act if there's a ssc_pending queue
        if (ssc_pending) {
            return;
        }

        var step = function () {

            var now = +new Date;
            var scrollX = 0;
            var scrollY = 0;

            for (var i = 0; i < ssc_que.length; i++) {

                var item = ssc_que[i];
                var elapsed = now - item.start;
                var finished = (elapsed >= ssc_animtime);

                // scroll position: [0, 1]
                var position = (finished) ? 1 : elapsed / ssc_animtime;

                // easing [optional]
                if (ssc_pulseAlgorithm) {
                    position = ssc_pulse(position);
                }

                // only need the difference
                var x = (item.x * position - item.lastX) >> 0;
                var y = (item.y * position - item.lastY) >> 0;

                // add this to the total scrolling
                scrollX += x;
                scrollY += y;

                // update last values
                item.lastX += x;
                item.lastY += y;

                // delete and step back if it's over
                if (finished) {
                    ssc_que.splice(i, 1); i--;
                }
            }

            // scroll left
            if (left) {
                var lastLeft = elem.scrollLeft;
                elem.scrollLeft += scrollX;

                // scroll left failed (edge)
                if (scrollX && elem.scrollLeft === lastLeft) {
                    left = 0;
                }
            }

            // scroll top
            if (top) {
                var lastTop = elem.scrollTop;
                elem.scrollTop += scrollY;

                // scroll top failed (edge)
                if (scrollY && elem.scrollTop === lastTop) {
                    top = 0;
                }
            }

            // clean up if there's nothing left to do
            if (!left && !top) {
                ssc_que = [];
            }

            if (ssc_que.length) {
                setTimeout(step, delay / ssc_framerate + 1);
            } else {
                ssc_pending = false;
            }
        }

        // start a new queue of actions
        setTimeout(step, 0);
        ssc_pending = true;
    }


    /***********************************************
     * EVENTS
     ***********************************************/

    /**
     * Mouse ssc_wheel handler.
     * @param {Object} event
     */
    function ssc_wheel(event) {

        if (!ssc_initdone) {
            init();

        }

        var target = event.target;
        var overflowing = ssc_overflowingAncestor(target);

        // use default if there's no overflowing
        // element or default action is prevented    
        if (!overflowing || event.defaultPrevented ||
            ssc_isNodeName(ssc_activeElement, "embed") ||
           (ssc_isNodeName(target, "embed") && /\.pdf/i.test(target.src))) {
            return true;
        }

        var deltaX = event.wheelDeltaX || 0;
        var deltaY = event.wheelDeltaY || 0;

        // use wheelDelta if deltaX/Y is not available
        if (!deltaX && !deltaY) {
            deltaY = event.wheelDelta || 0;
        }

        // scale by step size
        // delta is 120 most of the time
        // synaptics seems to send 1 sometimes
        if (Math.abs(deltaX) > 1.2) {
            deltaX *= ssc_stepsize / 120;
        }
        if (Math.abs(deltaY) > 1.2) {
            deltaY *= ssc_stepsize / 120;
        }

        ssc_scrollArray(overflowing, -deltaX, -deltaY);
        event.preventDefault();
    }

    /**
     * ssc_keydown event handler.
     * @param {Object} event
     */
    function ssc_keydown(event) {

        var target = event.target;
        var modifier = event.ctrlKey || event.altKey || event.metaKey;

        // do nothing if user is editing text
        // or using a modifier ssc_key (except shift)
        if (/input|textarea|embed/i.test(target.nodeName) ||
             target.isContentEditable ||
             event.defaultPrevented ||
             modifier) {
            return true;
        }
        // spacebar should trigger button press
        if (ssc_isNodeName(target, "button") &&
            event.keyCode === ssc_key.spacebar) {
            return true;
        }

        var shift, x = 0, y = 0;
        var elem = ssc_overflowingAncestor(ssc_activeElement);
        var clientHeight = elem.clientHeight;

        if (elem == document.body) {
            clientHeight = window.innerHeight;
        }

        switch (event.keyCode) {
            case ssc_key.up:
                y = -ssc_arrowscroll;
                break;
            case ssc_key.down:
                y = ssc_arrowscroll;
                break;
            case ssc_key.spacebar: // (+ shift)
                shift = event.shiftKey ? 1 : -1;
                y = -shift * clientHeight * 0.9;
                break;
            case ssc_key.pageup:
                y = -clientHeight * 0.9;
                break;
            case ssc_key.pagedown:
                y = clientHeight * 0.9;
                break;
            case ssc_key.home:
                y = -elem.scrollTop;
                break;
            case ssc_key.end:
                var damt = elem.scrollHeight - elem.scrollTop - clientHeight;
                y = (damt > 0) ? damt + 10 : 0;
                break;
            case ssc_key.left:
                x = -ssc_arrowscroll;
                break;
            case ssc_key.right:
                x = ssc_arrowscroll;
                break;
            default:
                return true; // a ssc_key we don't care about
        }

        ssc_scrollArray(elem, x, y);
        event.preventDefault();
    }

    /**
     * ssc_mousedown event only for updating ssc_activeElement
     */
    function ssc_mousedown(event) {
        ssc_activeElement = event.target;
    }


    /***********************************************
     * OVERFLOW
     ***********************************************/

    var ssc_cache = {}; // cleared out every once in while
    setInterval(function () { ssc_cache = {}; }, 10 * 1000);

    var ssc_uniqueID = (function () {
        var i = 0;
        return function (el) {
            return el.ssc_uniqueID || (el.ssc_uniqueID = i++);
        };
    })();

    function ssc_setCache(elems, overflowing) {
        for (var i = elems.length; i--;)
            ssc_cache[ssc_uniqueID(elems[i])] = overflowing;
        return overflowing;
    }

    function ssc_overflowingAncestor(el) {
        var elems = [];
        var ssc_rootScrollHeight = ssc_root.scrollHeight;
        do {
            var cached = ssc_cache[ssc_uniqueID(el)];
            if (cached) {
                return ssc_setCache(elems, cached);
            }
            elems.push(el);
            if (ssc_rootScrollHeight === el.scrollHeight) {
                if (!ssc_frame || ssc_root.clientHeight + 10 < ssc_rootScrollHeight) {
                    return ssc_setCache(elems, document.body); // scrolling ssc_root in WebKit
                }
            } else if (el.clientHeight + 10 < el.scrollHeight) {
                overflow = getComputedStyle(el, "").getPropertyValue("overflow");
                if (overflow === "scroll" || overflow === "auto") {
                    return ssc_setCache(elems, el);
                }
            }
        } while (el = el.parentNode);
    }


    /***********************************************
     * HELPERS
     ***********************************************/

    function ssc_addEvent(type, fn, bubble) {
        window.addEventListener(type, fn, (bubble || false));
    }

    function ssc_removeEvent(type, fn, bubble) {
        window.removeEventListener(type, fn, (bubble || false));
    }

    function ssc_isNodeName(el, tag) {
        return el.nodeName.toLowerCase() === tag.toLowerCase();
    }

    function ssc_directionCheck(x, y) {
        x = (x > 0) ? 1 : -1;
        y = (y > 0) ? 1 : -1;
        if (ssc_direction.x !== x || ssc_direction.y !== y) {
            ssc_direction.x = x;
            ssc_direction.y = y;
            ssc_que = [];
        }
    }


    /***********************************************
     * ssc_pulse
     ***********************************************/

    /**
     * Viscous fluid with a ssc_pulse for part and decay for the rest.
     * - Applies a fixed force over an interval (a damped acceleration), and
     * - Lets the exponential bleed away the velocity over a longer interval
     * - Michael Herf, http://stereopsis.com/stopping/
     */
    function ssc_pulse_(x) {
        var val, start, expx;
        // test
        x = x * ssc_pulseScale;
        if (x < 1) { // acceleartion
            val = x - (1 - Math.exp(-x));
        } else {     // tail
            // the previous animation ended here:
            start = Math.exp(-1);
            // simple viscous drag
            x -= 1;
            expx = 1 - Math.exp(-x);
            val = start + (expx * (1 - start));
        }
        return val * ssc_pulseNormalize;
    }

    function ssc_pulse(x) {
        if (x >= 1) return 1;
        if (x <= 0) return 0;

        if (ssc_pulseNormalize == 1) {
            ssc_pulseNormalize /= ssc_pulse_(1);
        }
        return ssc_pulse_(x);
    }

    $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
    if ($.browser.chrome) {
        ssc_addEvent("mousedown", ssc_mousedown);
        ssc_addEvent("mousewheel", ssc_wheel);
        ssc_addEvent("load", ssc_init);
    }
});;
(function (a) { a.fn.swipe = function (c) { if (!this) { return false } var k = { fingers: 1, threshold: 75, timeThreshold: 500, swipe: null, swipeLeft: null, swipeRight: null, swipeUp: null, swipeDown: null, swipeStatus: null, click: null, triggerOnTouchEnd: true, allowPageScroll: "auto" }; var m = "left"; var l = "right"; var d = "up"; var s = "down"; var j = "none"; var v = "horizontal"; var q = "vertical"; var o = "auto"; var f = "start"; var i = "move"; var h = "end"; var n = "cancel"; var t = "ontouchstart" in window, b = t ? "touchstart" : "mousedown", p = t ? "touchmove" : "mousemove", g = t ? "touchend" : "mouseup", r = "touchcancel"; var e = "start"; var u; if (c.allowPageScroll == undefined && (c.swipe != undefined || c.swipeStatus != undefined)) { c.allowPageScroll = j } if (c) { a.extend(k, c) } return this.each(function () { var E = this; var I = a(this); var F = null; var J = 0; var y = { x: 0, y: 0 }; var B = { x: 0, y: 0 }; var L = { x: 0, y: 0 }; function A(P) { var O = t ? P.touches[0] : P; e = f; if (t) { J = P.touches.length } distance = 0; direction = null; if (J == k.fingers || !t) { y.x = B.x = O.pageX; y.y = B.y = O.pageY; if (k.swipeStatus) { z(P, e) } var N = new Date(); u = N.getTime() } else { D(P) } E.addEventListener(p, K, false); E.addEventListener(g, M, false) } function K(Q) { if (e == h || e == n) { return } var P = t ? Q.touches[0] : Q; B.x = P.pageX; B.y = P.pageY; direction = w(); if (t) { J = Q.touches.length } e = i; H(Q, direction); if (J == k.fingers || !t) { distance = C(); if (k.swipeStatus) { z(Q, e, direction, distance) } if (!k.triggerOnTouchEnd) { var O = new Date(); var R = O.getTime(); var N = R - u; if (distance >= k.threshold && N <= k.timeThreshold) { e = h; z(Q, e); D(Q) } } } else { e = n; z(Q, e); D(Q) } } function M(P) { P.preventDefault(); distance = C(); direction = w(); if (k.triggerOnTouchEnd) { e = h; if ((J == k.fingers || !t) && B.x != 0) { var O = new Date(); var Q = O.getTime(); var N = Q - u; if (distance >= k.threshold && N <= k.timeThreshold) { z(P, e); D(P) } else { e = n; z(P, e); D(P) } } else { e = n; z(P, e); D(P) } } else { if (e == i) { e = n; z(P, e); D(P) } } E.removeEventListener(p, K, false); E.removeEventListener(g, M, false) } function D(N) { J = 0; y.x = 0; y.y = 0; B.x = 0; B.y = 0; L.x = 0; L.y = 0 } function z(O, N) { if (k.swipeStatus) { k.swipeStatus.call(I, O, N, direction || null, distance || 0) } if (N == n) { if (k.click && (J == 1 || !t) && (isNaN(distance) || distance == 0)) { k.click.call(I, O, O.target) } } if (N == h) { if (k.swipe) { k.swipe.call(I, O, direction, distance) } switch (direction) { case m: if (k.swipeLeft) { k.swipeLeft.call(I, O, direction, distance) } break; case l: if (k.swipeRight) { k.swipeRight.call(I, O, direction, distance) } break; case d: if (k.swipeUp) { k.swipeUp.call(I, O, direction, distance) } break; case s: if (k.swipeDown) { k.swipeDown.call(I, O, direction, distance) } break } } } function H(N, O) { if (k.allowPageScroll == j) { N.preventDefault() } else { var P = k.allowPageScroll == o; switch (O) { case m: if ((k.swipeLeft && P) || (!P && k.allowPageScroll != v)) { N.preventDefault() } break; case l: if ((k.swipeRight && P) || (!P && k.allowPageScroll != v)) { N.preventDefault() } break; case d: if ((k.swipeUp && P) || (!P && k.allowPageScroll != q)) { N.preventDefault() } break; case s: if ((k.swipeDown && P) || (!P && k.allowPageScroll != q)) { N.preventDefault() } break } } } function C() { return Math.round(Math.sqrt(Math.pow(B.x - y.x, 2) + Math.pow(B.y - y.y, 2))) } function x() { var Q = y.x - B.x; var P = B.y - y.y; var N = Math.atan2(P, Q); var O = Math.round(N * 180 / Math.PI); if (O < 0) { O = 360 - Math.abs(O) } return O } function w() { var N = x(); if ((N <= 45) && (N >= 0)) { return m } else { if ((N <= 360) && (N >= 315)) { return m } else { if ((N >= 135) && (N <= 225)) { return l } else { if ((N > 45) && (N < 135)) { return s } else { return d } } } } } try { this.addEventListener(b, A, false); this.addEventListener(r, D) } catch (G) { } }) } })(jQuery);;
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ï¿½ 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});', 62, 74, '||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'), 0, {}));
(function(e, t) {
    if (!e) return t;
    var n = function() {
        this.el = t;
        this.items = t;
        this.sizes = [];
        this.max = [0, 0];
        this.current = 0;
        this.interval = t;
        this.opts = { speed: 500, delay: 3e3, complete: t, keys: !t, dots: t, fluid: t };
        var n = this;
        this.init = function(t, n) {
            this.el = t;
            this.ul = t.children("ul");
            this.max = [t.outerWidth(), t.outerHeight()];
            this.items = this.ul.children("li").each(this.calculate);
            this.opts = e.extend(this.opts, n);
            this.setup();
            return this;
        };
        this.calculate = function(t) {
            var r = e(this), i = r.outerWidth(), s = r.outerHeight();
            n.sizes[t] = [i, s];
            if (i > n.max[0]) n.max[0] = i;
            if (s > n.max[1]) n.max[1] = s;
        };
        this.setup = function() {
            this.el.css({ overflow: "hidden", width: n.max[0], height: this.items.first().outerHeight() });
            this.ul.css({ width: this.items.length * 100 + "%", position: "relative" });
            this.items.css("width", 100 / this.items.length + "%");
            if (this.opts.delay !== t) {
                this.start();
                this.el.hover(this.stop, this.start);
            }
            this.opts.keys && e(document).keydown(this.keys);
            this.opts.dots && this.dots();
            if (this.opts.fluid) {
                var r = function() { n.el.css("width", Math.min(Math.round(n.el.outerWidth() / n.el.parent().outerWidth() * 100), 100) + "%"); };
                r();
                e(window).resize(r);
            }
            if (this.opts.arrows) {
                this.el.parent().append('<p class="arrows"><span class="prev">Ã¢â€ Â</span><span class="next">Ã¢â€ â€™</span></p>').find(".arrows span").click(function() { e.isFunction(n[this.className]) && n[this.className](); });
            }
            if (e.event.swipe) {
                this.el.on("swipeleft", n.prev).on("swiperight", n.next);
            }
        };
        this.move = function(t, r) {
            if (!this.items.eq(t).length) t = 0;
            if (t < 0) t = this.items.length - 1;
            var i = this.items.eq(t);
            var s = { height: i.outerHeight() };
            var o = r ? 5 : this.opts.speed;
            if (!this.ul.is(":animated")) {
                n.el.find(".dot:eq(" + t + ")").addClass("active").siblings().removeClass("active");
                this.el.animate(s, o) && this.ul.animate(e.extend({ left: "-" + t + "00%" }, s), o, function(i) {
                    n.current = t;
                    e.isFunction(n.opts.complete) && !r && n.opts.complete(n.el);
                });
            }
        };
        this.start = function() { n.interval = setInterval(function() { n.move(n.current + 1); }, n.opts.delay); };
        this.stop = function() {
            n.interval = clearInterval(n.interval);
            return n;
        };
        this.keys = function(t) {
            var r = t.which;
            var i = { 37: n.prev, 39: n.next, 27: n.stop };
            if (e.isFunction(i[r])) {
                i[r]();
            }
        };
        this.next = function() { return n.stop().move(n.current + 1); };
        this.prev = function() { return n.stop().move(n.current - 1); };
        this.dots = function() {
            var t = '<ol class="dots">';
            e.each(this.items, function(e) { t += '<li class="dot' + (e < 1 ? " active" : "") + '">' + (e + 1) + "</li>"; });
            t += "</ol>";
            this.el.addClass("has-dots").append(t).find(".dot").click(function() { n.move(e(this).index()); });
        };
    };
    e.fn.unslider = function(t) {
        var r = this.length;
        return this.each(function(i) {
            var s = e(this);
            var u = (new n).init(s, t);
            s.data("unslider" + (r > 1 ? "-" + (i + 1) : ""), u);
        });
    };
})(window.jQuery, false);
var CONFIG = (function ($, window) {
    var touch = Modernizr.touch,
		windowHeight = !touch ? $(window).height() : '650px' || '600px';
    return {
        objSidebarTweet: {
            username: "juthourpal",
            count: 2,
            page: 1,
            loading_text: 'loading ...'
        },
        objQuotes: {
            easing: 'easeInOutExpo',
            speed: 600,
            timeout: 5000
        },
        objContentTweet: {
            username: "juthourpal",
            count: 2,
            page: 1,
            loading_text: ''
        }
    }
}(jQuery, window));;
(function ($, window, Modernizr, document, CONFIG) {
    "use strict";
    $(function () {
        (function () {
            $('body').OnePage(CONFIG.objOnePage);
            if (!Modernizr.touch) {
                if ($('.full-bg-image').length) {
                    $('.full-bg-image').parallax('center', 0.4);
                }
            }
            if ($('.flexslider').length) {
                $(window).load(function () {
                    $('.flexslider').flexslider({
                        animation: "slide",
                        controlNav: "thumbnails"
                    });
                });
            }
            if ($('.banner').length) {
                if (window.chrome) {
                    $('.banner li').css('background-size', '100% 100%');
                }
                $(window).load(function () {
                    var slidey = $('.banner').unslider({
                        fluid: true,
                        dots: true,
                        speed: 300,
                        delay: false,
                        keys: true,
                        easing: 'swing'
                    });
                    var data = slidey.data('unslider');
                    if (Modernizr.touch) {
                        slidey.swipe({
                            swipeLeft: swipeFunc2,
                            swipeRight: swipeFunc2,
                            allowPageScroll: 'auto'
                        });
                    };
                    function swipeFunc2(e, dir) {
                        if (dir === 'left') {
                            data.next();
                        }
                        if (dir === 'right') {
                            data.prev();
                        }
                    }
                });
            }
            if ($('.tabs-holder').length) {
                var $tabsHolder = $('.tabs-holder');
                $tabsHolder.each(function (i, val) {
                    var $tabsNav = $('.tabs-nav', val),
						tabsNavLis = $tabsNav.children('li'),
					$tabsContainer = $('.tabs-container', val);
                    $tabsNav.each(function () {
                        $(this).next().children('.tab-content').first().stop(true, true).show();
                        $(this).children('li').first().addClass('active').stop(true, true).show();
                    });

                    $tabsNav.on('click', 'a', function (e) {
                        var $this = $(this).parent('li'),
							$index = $this.index();
                        $this.siblings().removeClass('active').end().addClass('active');
                        $this.parent().next().children('.tab-content').stop(true, true).hide().eq($index).stop(true, true).fadeIn(250);
                        e.preventDefault();

                    });

                });
            }

            if ($('.acc-box').length) {

                var $box = $('.acc-box');

                $box.each(function () {

                    var $trigger = $('.acc-trigger', $(this));

                    $trigger.on('click', function () {
                        var $this = $(this);
                        if ($this.data('mode') === 'toggle') {
                            $this.toggleClass('active').next().stop(true, true).slideToggle(300);
                        } else {
                            if ($this.next().is(':hidden')) {
                                $trigger.removeClass('active').next().slideUp(300);
                                $this.toggleClass('active').next().slideDown(300);
                            } else if ($this.hasClass('active')) {
                                $this.removeClass('active').next().slideUp(300);
                            }
                        }
                        return false;
                    });

                });

            }

            var $notifications = $('.error, .success, .info, .notice');

            if ($notifications.length) {
                $notifications.notifications({ speed: 300 });
            }


            if ($('.contact-form2').length) {
                var $el = $("#days");
                $el.prop("disabled", true);

                var option_set_0 = {
                    "0": (LANG == 'arabic') ? "Choose Age Range First" : "Choose Age Range First"
                };
                var option_set_1 = {
                    "0": (LANG == 'arabic') ? "Select Date" : "Select Date",
                    "1": (LANG == 'arabic') ? "June 22" : "June 22",
                    "2": (LANG == 'arabic') ? "June 23" : "June 23",
                    "3": (LANG == 'arabic') ? "June 24" : "June 24"
                };
                var option_set_2 = {
                    "0": (LANG == 'arabic') ? "Select Date" : "Select Date",
                    "4": (LANG == 'arabic') ? "June 25" : "June 25",
                    "5": (LANG == 'arabic') ? "June 26" : "June 26",
                    "6": (LANG == 'arabic') ? "June 27" : "June 27"
                };


                $("#age").change(function () {
                    switch ($('#age').val()) {
                        case '0':
                            $el.empty();
                            $.each(option_set_1, function (key, value) {
                                $el.append($("<option></option>")
                                   .attr("value", key).text(value));
                            });
                            $el.prop("disabled", false);
                            break;
                        case '1':
                            $el.empty();
                            $.each(option_set_2, function (key, value) {
                                $el.append($("<option></option>")
                                   .attr("value", key).text(value));
                            });
                            $el.prop("disabled", false);
                            break;
                        case '':
                        default:
                            $el.empty();
                            $.each(option_set_0, function (key, value) {
                                $el.append($("<option></option>")
                                   .attr("value", key).text(value));
                            });
                            $el.prop("disabled", true);
                            break;
                    }






                });

                var $form = $('.contact-form2');
                $form.append('<div class="hide contact-form-responce" />');


                $form.each(function () {
                    var $this = $(this),
						$response = $('.contact-form-responce', $this).append('<p></p>'),
						p = $response.find('p');



                    $this.submit(function () {
                        $form.children('.input-block').find('.submit').prop("disabled", true).css("cursor", "default");
                        p.html('');
                        p.removeClass().addClass('info');
                        p.html('Submitting Awesomeness!');
                        $response.show(300);
                        setTimeout(function () {



                            $.ajax({
                                type: "POST",
                                url: CI_ROOT + "subscription/camp",
                                data: {
                                    name_child: $('#name_child').val(),
                                    name_parent: $('#name_parent').val(),
                                    phone: $('#phone').val(),
                                    email: $('#email').val(),
                                    days: $('#days').val(),
                                    age: $('#age').val(),
                                    arabic: $('#arabic').val(),
                                    health: $('#health').val(),
                                    cont_name: $('#cont_name').val(),
                                    cont_relation: $('#cont_relation').val(),
                                    cont_numb: $('#cont_numb').val(),
                                    agree: $('#agree').val()
                                },


                                dataType: 'json',
                                cache: false,
                                success: function (data) {
                                    $response.hide(200);
                                    $('.wrong-data', $this).removeClass("wrong-data");
                                    p.html('');
                                    if (data.error == 'validation') {
                                        $form.children('.input-block').find('.submit').prop("disabled", false).css('cursor', 'pointer');
                                        p.removeClass().addClass("error");
                                        p.append(data.response);
                                        $response.show(400);
                                    } else if (data.error == 'database') {
                                        p.removeClass().addClass('info');
                                        p.append(data.response);
                                        $this.find('input, textarea, select').val('').attr('checked', false);
                                        $response.show(300).delay(3000).hide(400);
                                    } else if (data.error == 'no_error') {
                                        p.removeClass().addClass('success');
                                        p.append('Successful!');
                                        $this.find('input, textarea, select').val('').attr('checked', false);
                                        $response.show(300).delay(300).hide(200);

                                        setTimeout(function () {
                                            $this.hide(500);
                                            $('#h2_title').html(data.response);

                                            var offset = $("#form_section").offset();
                                            $("html,body").animate({
                                                scrollTop: offset.top - 175
                                            }, 800);

                                        }, 550);





                                    } else {
                                        p.removeClass().addClass('error');
                                        p.append('Internal Error, Try Later!');
                                        $this.find('input, textarea, select').val('').attr('checked', false);
                                        $response.show(300).delay(3000).hide(400);
                                        $form.children('.input-block').find('.submit').prop("disabled", false).css('cursor', 'pointer');
                                    }
                                },
                                error: function () {
                                    $('.wrong-data', $this).removeClass("wrong-data");
                                    p.html('');
                                    p.removeClass().addClass('error');
                                    p.append('Internal Error, Try Later!');
                                    $this.find('input, textarea, select').val('').attr('checked', false);
                                    $response.show(300).delay(3000).hide(400);
                                    $form.children('.input-block').find('.submit').prop("disabled", false);
                                }
                            })
                        }, 2000);



                        return false;

                    });
                });
            }


            if ($('.contact-form').length) {

                var $form = $('.contact-form');
                $form.append('<div class="hide contact-form-responce" />');


                $form.each(function () {
                    var $this = $(this),
						$response = $('.contact-form-responce', $this).append('<p></p>'),
						p = $response.find('p');



                    $this.submit(function () {
                        $form.children('.input-block').find('.submit').prop("disabled", true).css("cursor", "default");
                        p.html('');
                        p.removeClass().addClass('info');
                        p.html('Submitting Awesomeness!');
                        $response.show(300);
                        setTimeout(function () {

                            $.ajax({
                                type: "POST",
                                url: "subscription/subscribe",
                                data: { name: $("#name").val(), email: $("#email").val() },
                                dataType: 'json',
                                cache: false,
                                success: function (data) {
                                    $response.hide(200);
                                    $('.wrong-data', $this).removeClass("wrong-data");
                                    p.html('');
                                    if (data.is_error === true) {
                                        $form.children('.input-block').find('.submit').prop("disabled", false).css('cursor', 'pointer');

                                        p.removeClass().addClass("error");
                                        $.each(data.info, function (input_name, input_label) {
                                            $("[name=" + input_name + "]", $this).addClass("wrong-data");
                                            p.append(input_label);
                                        });
                                        $response.show(400);
                                    } else if (data.is_error === false) {
                                        if (data.info === 'success') {
                                            p.removeClass().addClass('success');
                                            p.append('Thank you for Subscribing!');
                                            $this.find('input, textarea, select').val('').attr('checked', false);
                                            $response.show(300).delay(4000).hide(400);
                                        } else if (data.info === 'fail') {
                                            p.removeClass().addClass('info');
                                            p.append('You are already Subscribed!');
                                            $this.find('input, textarea, select').val('').attr('checked', false);
                                            $response.show(300).delay(3000).hide(400);
                                        } else {
                                            p.removeClass().addClass('error');
                                            p.append('Internal Error, Try Later!');
                                            $this.find('input, textarea, select').val('').attr('checked', false);
                                            $response.show(300).delay(3000).hide(400);

                                            $form.children('.input-block').find('.submit').prop("disabled", false).css('cursor', 'pointer');
                                        }
                                    }
                                },
                                error: function () {
                                    $('.wrong-data', $this).removeClass("wrong-data");
                                    p.html('');
                                    p.removeClass().addClass('error');
                                    p.append('Internal Error, Try Later!');
                                    $this.find('input, textarea, select').val('').attr('checked', false);
                                    $response.show(300).delay(3000).hide(400);
                                    $form.children('.input-block').find('.submit').prop("disabled", false);
                                }
                            })
                        }, 2000);



                        return false;

                    });
                });

            }

            /* ---------------------------------------------------- */
            /*	Tooltip Init										*/
            /* ---------------------------------------------------- */

            if ($('.tooltip').length) {
                $('.tooltip').tooltipster(CONFIG.objTooltipster);
            }

            /* ---------------------------------------------------- */
            /*	Init Progress Bar									*/
            /* ---------------------------------------------------- */

            if ($('.progress-bar').length) {
                $('.progress-bar').progressBar();
            }

            /* ---------------------------------------------------- */
            /*	Placeholder											*/
            /* ---------------------------------------------------- */

            if (typeof document.createElement("input").placeholder === 'undefined') {
                $('[placeholder]').focus(function () {
                    var input = $(this);
                    if (input.val() === input.attr('placeholder')) {
                        input.val('');
                        input.removeClass('placeholder');
                    }
                }).blur(function () {
                    var input = $(this);
                    if (input.val() === '' || input.val() === input.attr('placeholder')) {
                        input.addClass('placeholder');
                        input.val(input.attr('placeholder'));
                    }
                }).blur().parents('form').submit(function () {
                    $(this).find('[placeholder]').each(function () {
                        var input = $(this);
                        if (input.val() === input.attr('placeholder')) {
                            input.val('');
                        }
                    });
                });
            }

        }());

        /* ---------------------------------------------------- */
        /*	Cycles												*/
        /* ---------------------------------------------------- */

        (function () {


            if ($('.quotes').length) {

                var $quotes = $('.quotes');

                $(window).load(function () {

                    $quotes.each(function (i, val) {

                        var $this = $(val);

                        if ($this.children('li').length < 2) { return; }

                        $this.css('height', $this.children('li:first').height())
						.after('<div id="quote-nav-' + i + '" class="quotes-control-nav">')
						.cycle({
						    before: function (curr, next, opts) {
						        var $this = $(this);
						        $this.parent().stop().animate({
						            height: $this.height()
						        }, opts.speed);
						    },
						    containerResize: false,
						    easing: CONFIG.objQuotes.easing,
						    fit: true,
						    pause: true,
						    slideResize: true,
						    speed: CONFIG.objQuotes.speed,
						    timeout: $this.data('timeout') ? $this.data('timeout') : CONFIG.objQuotes.timeout,
						    width: '100%',
						    pager: '#quote-nav-' + i
						}).data('slideCount', $this.children('li').length);

                    });

                    // Resize
                    if ($quotes.data('slideCount') > 1) {
                        $(window).on('resize', function () {
                            $quotes.css('height', $quotes.find('li:visible').height());
                        });
                    }

                    // Include Swipe
                    if (Modernizr.touch) {
                        $quotes.swipe({
                            swipeLeft: swipeFunc,
                            swipeRight: swipeFunc,
                            allowPageScroll: 'auto'
                        });
                    }

                });

            }

            /* ---------------------------------------------------- */
            /*	Tweets												*/
            /* ---------------------------------------------------- */

            if ($('.sidebar-tweet').length) {
                $('.sidebar-tweet').tweet(CONFIG.objSidebarTweet);
            }

            if ($('.tweet').length) {

                var $tweet = $('.tweet');

                $tweet.tweet(CONFIG.objContentTweet);

                var $tweets = $('.tweets', $tweet);

                $tweets.each(function (i) {

                    var $this = $(this);

                    if ($this.children('li').length < 2) { return; }

                    $this.css('height', $this.children('li:first').height())
							.after('<div id="tweets-nav-' + i + '" class="tweets-control-nav">')
							.cycle({
							    before: function (curr, next, opts) {
							        var $this = $(this);
							        $this.parent().stop().animate({
							            height: $this.height()
							        }, opts.speed);
							    },
							    containerResize: false,
							    easing: 'easeInOutExpo',
							    fit: true,
							    pause: true,
							    slideResize: true,
							    speed: 600,
							    timeout: $this.parent().data('timeout') ? $this.parent().data('timeout') : '',
							    width: '100%',
							    pager: '#tweets-nav-' + i
							}).data('slideCount', $this.children('li').length);

                });

                // Resize
                if ($tweets.data('slideCount') > 1) {
                    $(window).on('resize', function () {
                        $tweets.css('height', $tweets.find('li:visible').height());
                    });
                }

                // Include Swipe
                if (Modernizr.touch) {
                    $tweets.swipe({
                        swipeLeft: swipeFunc,
                        swipeRight: swipeFunc,
                        allowPageScroll: 'auto'
                    });
                }

            }

        }());

    });


    /* ---------------------------------------------------- */
    /*	OnePage												*/
    /* ---------------------------------------------------- */

    function OnePage(el, options) {
        this.el = $(el);
        this.init(options);
    }

    OnePage.DEFAULTS = {
        easing: 'easeInOutExpo',
        animatedElem: true,
        queryLoader: false,
        duration: 1200
    }

    OnePage.prototype = {
        init: function (options) {
            var self = this, $window = $(window),
                windowHeight = $window.height(), support = Modernizr.cssanimations;
            this.o = $.extend({}, OnePage.DEFAULTS, options);


            this.el.append('<a href="#" id="back-top" class="back-top"><span class="back-top-symbol"></span><span class="back-top-slide-icon"></span></a>');
            this.refreshElements();
            this.sections = this.wrapper.children('.page');
            this.scrollingToElement = false;
            this.touch = Modernizr.touch;

            // QueryLoader	
            //this.o.queryLoader ? this.queryLoader(self, $window) : this.loader.fadeOut(200);

            // Navigation
            this.navigation(self);

            // LayerSlider
            if (this.layer.length) {
                if (!this.touch) {
                    this.layer.css({ height: windowHeight }).children().layerSlider(CONFIG.objLayerSlider);
                } else { this.layer.children().layerSlider(CONFIG.objLayerSlider); }
            }

            self.stickyHeader.call(self, $window);

            // ScrollSpy 
            $(window).on('load.scrollSpy', function () {
                self.scrollSpy.call(self);
            });

            $window.on('scroll.OnePage', function (e) {
                // Back To Top
                self.backTopScrollHandler.call(self, e.currentTarget);
                // Sticky Header
                self.stickyHeader.call(self, e.currentTarget);
            });

            if (!this.touch) {

                // Animated Elements

                if (support) {
                    if (this.o.animatedElem) {
                        this.el.addClass('animated');
                        this.animatedElem(self);
                    }
                }

                // Video Full Container
                if (this.videoFull.length) {
                    this.videoFull.height(windowHeight);
                }

                $window.on('keydown', function (e) {
                    self.keyDownHandler.call(self, e);
                });

            }

            if (this.touch) {
                var $items = $('.work-item');
                $items.on('click', function (e) {
                    var target = $(e.target);
                    target.addClass('touched');
                });
            }

            // Back to Top
            this.backTopClickHanlder();
        },
        elements: {
            '.loader': 'loader',
            '.section': 'section',
            '#header': 'header',
            '#layerslider-container': 'layer',
            '#wrapper': 'wrapper',
            '#responsive-nav-button': 'navButton',
            '#navigation': 'nav',
            '#back-top': 'backTop',
            '.video-full-container': 'videoFull'
        },
        $: function (selector) { return $(selector); },
        refreshElements: function () {
            for (var key in this.elements) {
                this[this.elements[key]] = this.$(key);
            }
        },
        waypoints: function (el) {
            return el.each(function () {
                var element = $(this);
                setTimeout(function () {
                    element.waypoint(function (direction) {
                        if (direction == 'down') {
                            $(this).trigger('start');
                        }
                    }, {
                        offset: '60%',
                        triggerOnce: true
                    });
                }, 100);
            });
        },
        effect: function (el, options) {

            var defaults = {
                effect: 'opacity',
                speed: 350,
                beforeCall: function () { }
            }, o = $.extend({}, defaults, options);

            return el.each(function () {
                var container = $(this), elements;
                o.beforeCall(container);
                elements = container.find('.' + o.effect);
                container.on('start', function () {
                    elements.each(function (i, value) {
                        setTimeout(function () {
                            $(value).addClass(o.effect + 'Run');
                            setTimeout(function () {
                                $(value).removeClass(o.effect);
                            }, i * o.speed);
                        }, i * o.speed);
                    });
                });
            });
        },
        animatedElem: function (self) {
            self.waypoints(self.section);
            if ($('.opacity').length) {
                self.effect(self.section, { effect: 'opacity' });
            }
            if ($('.opacity2x').length) {
                self.effect(self.section, { effect: 'opacity2x', speed: 150 });
            }
            if ($('.scale').length) {
                self.effect(self.section, { effect: 'scale' });
            }
            if ($('.slideLeft').length) {
                self.effect(self.section, { effect: 'slideLeft' });
            }
            if ($('.slideRight').length) {
                self.effect(self.section, { effect: 'slideRight' });
            }
            if ($('.slideDown').length) {
                self.effect(self.section, { effect: 'slideDown' });
            }
            if ($('.slideUp').length) {
                self.effect(self.section, { effect: 'slideUp' });
            }
        },
        queryLoader: function (self, $window) {
            this.el.queryLoader2({
                barColor: '#00c2a9',
                backgroundColor: '#fff',
                percentage: true,
                barHeight: 3,
                completeAnimation: 'fade',
                minimumTime: 700,
                onComplete: function () {
                    self.loader.fadeOut(200);

                    if ($("#example_video").length) {
                        videojs("example_video", {
                            "controls": false,
                            "autoplay": true,
                            "preload": "auto",
                            "loop": true
                        });
                    }

                }
            });
        },
        getCurrentSection: function () {
            var $nearestSection, minDistance = 99999;

            this.sections.each(function (idx, val) {
                var $this = $(val),
                    top = $this.offset().top,
                    currentScroll = $(window).scrollTop(),
                    distance = Math.abs(currentScroll - top);

                if (distance < minDistance) {
                    minDistance = distance;
                    $nearestSection = $this;
                }
            });
            return $nearestSection;
        },
        keyDownHandler: function (e) {
            var $newSection, $currentSection;
            switch (e.keyCode) {
                case 38:
                    $currentSection = this.getCurrentSection();
                    $newSection = $currentSection.prev();
                    e.preventDefault();
                    break;
                case 40:
                    $currentSection = this.getCurrentSection();
                    $newSection = $currentSection.next();
                    e.preventDefault();
                    break;
            }

            if ($newSection && $newSection.length > 0) {
                this.sectionAnimate($newSection);
            }

        },
        sectionAnimate: function (section) {
            var self = this;
            this.scrollingToElement = true;
            $('html, body').stop(true, true).animate({
                scrollTop: section.offset().top + "px"
            }, {
                duration: this.o.duration,
                easing: this.o.easing,
                complete: function () {
                    self.scrollingToElement = false;
                }
            });
        },
        checkHashLink: function (href) {
            return href.indexOf('.html') != -1 || href.lastIndexOf('http://') != -1;
        },
        scrollSpy: function () {
            this.el.each(function () {
                var $spy = $(this);
                $spy.scrollspy($spy.data());
            });
        },
        navigation: function (self) {


            self.nav.find('ul').parent('li').each(function (idx, val) {
                var $hidobj = $(val).children('ul');
                var $curobj = $(val);
                $hidobj.stop(true, true).fadeOut(50);
                $curobj.istopheader = $curobj.parents('ul').length === 1 ? true : false;
                $curobj.addClass($curobj.istopheader ? 'downarrowclass' : 'rightarrowclass');
            });


            self.nav.on('mouseenter', 'li', function () {
                var $this = $(this), $subMenu = $this.children('ul');

                if ($subMenu.length && $(window).width() > 1150) {

                    $subMenu.hide().stop(true, true).fadeIn(300);
                }
            }).on('mouseleave', 'li', function () {
                $(this).children('ul').stop(true, true).fadeOut(50);
            });


            self.nav.on('click', 'a', function (e) {
                var $this = $(this).parent('li'),
                    $href = $this.children('a').attr('href');
                if (!self.checkHashLink($href)) {
                    //e.preventDefault();
                }
            });
            self.nav.on('click', 'li', function (e) {
                var $this = $(this), $subMenu = $this.children('ul');
                if ($subMenu.length && $(window).width() < 1150) {
                    if ($subMenu.css('display') == 'none') {
                        $subMenu.hide().stop(true, true).fadeIn(300);
                    } else {
                        $subMenu.stop(true, true).fadeOut(50);
                    }
                }
            });

            self.navButton.on('click', function (e) {
                var $this = $(e.target);
                if (!self.nav.hasClass('active')) {
                    self.nav.stop(true, true).slideDown('normal', function () {
                    }).css('display', 'inline-block').addClass('active');
                } else {
                    self.nav.stop(true, true).slideUp('normal').removeClass('active');
                }
                e.preventDefault();
            });

            $(window).on('resize', function (e) { self.removeAttrNav.call(self); });

        },
        removeAttrNav: function () {
            if ($(window).width() >= 1150) {
                this.nav.attr('style', '');
                this.nav.find('li').each(function (idx, val) {
                    var $hidobj = $(val).children('ul');
                    $hidobj.stop(true, true).fadeOut(50);
                });
            }
        },
        stickyHeader: function (win) {

            if ($(win).scrollTop() > 0) {
                if ($(window).width() >= 1150) { this.header.addClass('header-shrink'); }
            } else {
                this.header.removeClass('header-shrink');
            }
        },
        backTopScrollHandler: function (win) {
            $(win).scrollTop() > 200 ? this.backTop.fadeIn(400) : this.backTop.fadeOut(400);
        },
        backTopClickHanlder: function () {
            this.backTop.on('click', function (e) {
                $('html, body').animate({ scrollTop: 0 }, 800);
                e.preventDefault();
            });
        }
    }

    /* OnePage Plugin Definition
     * ================================== */

    $.fn.OnePage = function (option) {
        return this.each(function () {
            var $this = $(this), data = $this.data('OnePage'),
                options = typeof option == 'object' && option;
            if (!data) {
                $this.data('OnePage', new OnePage(this, options));
            }
        });
    }

    /* ---------------------------------------------------- */
    /*	CountTo												*/
    /* ---------------------------------------------------- */

    $.fn.countTo = function (options) {

        options = options || {};

        return $(this).each(function () {

            // set options for current element
            var settings = $.extend({}, $.fn.countTo.defaults, {
                from: $(this).data('from'),
                to: $(this).data('to'),
                speed: $(this).data('speed'),
                refreshInterval: $(this).data('refresh-interval'),
                decimals: $(this).data('decimals')
            }, options);

            // how many times to update the value, and how much to increment the value on each update
            var loops = Math.ceil(settings.speed / settings.refreshInterval),
            increment = (settings.to - settings.from) / loops;

            // references & variables that will change with each update
            var self = this,
            $self = $(this),
            loopCount = 0,
            value = settings.from,
            data = $self.data('countTo') || {};

            $self.data('countTo', data);

            // if an existing interval can be found, clear it first
            if (data.interval) {
                clearInterval(data.interval);
            }
            data.interval = setInterval(updateTimer, settings.refreshInterval);

            // initialize the element with the starting value
            render(value);

            function updateTimer() {
                value += increment;
                loopCount++;

                render(value);

                if (typeof (settings.onUpdate) == 'function') {
                    settings.onUpdate.call(self, value);
                }

                if (loopCount >= loops) {
                    // remove the interval
                    $self.removeData('countTo');
                    clearInterval(data.interval);
                    value = settings.to;

                    if (typeof (settings.onComplete) == 'function') {
                        settings.onComplete.call(self, value);
                    }
                }
            }

            function render(value) {
                var formattedValue = settings.formatter.call(self, value, settings);
                $self.children('.count').html(formattedValue);
            }
        });
    };


    function formatter(value, settings) {
        return value.toFixed(settings.decimals);
    }

    /* ---------------------------------------------------- */
    /*	Progress Bar										*/
    /* ---------------------------------------------------- */

    $.fn.progressBar = function (options, callback) {

        var defaults = {
            speed: 600,
            easing: 'swing'
        }, o = $.extend({}, defaults, options);

        return this.each(function () {

            var elem = $(this), methods = {};

            methods = {
                init: function () {
                    this.touch = Modernizr.touch ? true : false;
                    this.refreshElements();
                    this.processing();
                },
                elements: {
                    '.bar': 'bar',
                    '.percent': 'per'
                },
                $: function (selector) { return $(selector, elem); },
                refreshElements: function () {
                    for (var key in this.elements) {
                        this[this.elements[key]] = this.$(key);
                    }
                },
                getProgress: function () { return this.bar.data('progress'); },
                setProgress: function (self) {
                    self.bar.animate({ 'width': self.getProgress() + '%' }, {
                        duration: o.speed,
                        easing: o.easing,
                        step: function (progress) {
                            self.per.text(Math.ceil(progress) + '%');
                        },
                        complete: function (scope, i, elem) {
                            if (callback) {
                                callback.call(this, i, elem);
                            }
                        }
                    });
                },
                processing: function () {
                    var self = this;
                    if (self.touch) {
                        self.setProgress(self);
                    } else {
                        elem.waypoint(function (direction) {
                            if (direction == 'down') {
                                self.setProgress(self);
                            }
                        }, { offset: '64%' });
                    }
                }
            };
            methods.init();
        });
    };

    /* ---------------------------------------------------- */
    /*	Parallax											*/
    /* ---------------------------------------------------- */

    $.fn.parallax = function (xpos, speed) {
        var firstTop, pos;
        return this.each(function (idx, value) {

            var $this = $(value);
            if (arguments.length < 1 || xpos === null) { xpos = "50%"; }
            if (arguments.length < 2 || speed === null) { speed = 0.4; }

            return ({
                update: function () {
                    firstTop = $this.offset().top;
                    pos = $(window).scrollTop();
                    $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speed) + "px");
                },
                init: function () {
                    var self = this;
                    self.update();
                    $(window).on('scroll', self.update);
                }
            }.init());
        });

    };



    /* ---------------------------------------------------- */
    /*	Notifications										*/
    /* ---------------------------------------------------- */

    $.fn.notifications = function (options) {

        var defaults = { speed: 200 },
            o = $.extend({}, defaults, options);

        return this.each(function () {

            var closeBtn = $('<a class="alert-close" href="#"></a>'),
                closeButton = $(this).append(closeBtn).find('> .alert-close');

            function fadeItSlideIt(object) {
                object.fadeTo(o.speed, 0, function () {
                    object.slideUp(o.speed);
                });
            }
            closeButton.click(function () {
                fadeItSlideIt($(this).parent());
                return false;
            });
        });
    };



    /* ---------------------------------------------------- */
    /*	Scroll Spy											*/
    /* ---------------------------------------------------- */

    function ScrollSpy(element, options) {
        var href;
        var process = $.proxy(this.process, this);

        this.$element = $(element).is('body') ? $(window) : $(element);
        this.$body = $('body');
        this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process);
        this.options = $.extend({}, ScrollSpy.DEFAULTS, options);
        this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) || '') + ' > ul > li > a';
        this.offsets = $([]);
        this.targets = $([]);
        this.activeTarget = null;

        this.refresh();
        this.process();
    }

    ScrollSpy.DEFAULTS = {
        offset: 10
    }

    ScrollSpy.prototype.refresh = function () {
        var offsetMethod = this.$element[0] == window ? 'offset' : 'position';

        this.offsets = $([]);
        this.targets = $([]);

        var self = this;
        var $targets = this.$body.find(this.selector).map(function () {
            var $el = $(this);
            var href = $el.data('target') || $el.attr('href');
            var $href = /^#\w/.test(href) && $(href);
            return ($href && $href.length && [[$href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href]]) || null;
        }).sort(function (a, b) {
            return a[0] - b[0];
        }).each(function () {
            self.offsets.push(this[0]);
            self.targets.push(this[1]);
        });

    }

    ScrollSpy.prototype.process = function () {
        var scrollTop = this.$scrollElement.scrollTop() + this.options.offset;
        var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight;
        var maxScroll = scrollHeight - this.$scrollElement.height();
        var offsets = this.offsets;
        var targets = this.targets;
        var activeTarget = this.activeTarget;
        var i;

        if (scrollTop >= maxScroll) {
            return activeTarget != (i = targets.last()[0]) && this.activate(i);
        }

        for (i = offsets.length; i--;) {
            activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) && this.activate(targets[i]);
        }
    }

    ScrollSpy.prototype.activate = function (target) {
        this.activeTarget = target;
        $(this.selector).parents('.current-menu-item').removeClass('current-menu-item');
        var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]';
        var active = $(selector).parents('li').addClass('current-menu-item');

        active.trigger('activate.bs.scrollspy');
    }





    // SCROLLSPY PLUGIN DEFINITION
    // ===========================

    $.fn.scrollspy = function (option) {
        return this.each(function () {
            var $this = $(this)
            var data = $this.data('bs.scrollspy')
            var options = typeof option == 'object' && option

            if (!data) {
                $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)));
            }
            if (typeof option == 'string') {
                data[option]();
            }
        })
    }

    $.fn.scrollspy.Constructor = ScrollSpy;




}(jQuery, window, Modernizr, document, CONFIG));

; (function (e, t, n, r) { function u(t, n) { this.element = t; this.options = e.extend({}, o, n); this._defaults = o; this._name = s; this.init() } function a() { return !!("ontouchstart" in t) } function f() { var e = n.body || n.documentElement; var t = e.style; var r = "transition"; if (typeof t[r] == "string") { return true } v = ["Moz", "Webkit", "Khtml", "O", "ms"], r = r.charAt(0).toUpperCase() + r.substr(1); for (var i = 0; i < v.length; i++) { if (typeof t[v[i] + r] == "string") { return true } } return false } var s = "tooltipster", o = { animation: "fade", arrow: true, arrowColor: "", content: "", delay: 200, fixedWidth: 0, maxWidth: 0, functionInit: function (e, t) { }, functionBefore: function (e, t) { t() }, functionReady: function (e, t) { }, functionAfter: function (e) { }, icon: "(?)", iconDesktop: false, iconTouch: false, iconTheme: ".tooltipster-icon", interactive: false, interactiveTolerance: 350, interactiveAutoClose: true, offsetX: 0, offsetY: 0, onlyOne: true, position: "top", speed: 350, timer: 0, theme: ".tooltipster-default", touchDevices: true, trigger: "hover", updateAnimation: true }; var l = true; if (!f()) { l = false } var c = a(); e(t).on("mousemove.tooltipster", function () { c = false; e(t).off("mousemove.tooltipster") }); u.prototype = { init: function () { var t = e(this.element); var i = this; var s = true; if (!i.options.touchDevices && c) { s = false } if (n.all && !n.querySelector) { s = false } if (s) { var o = e.trim(i.options.content).length > 0 ? i.options.content : t.attr("title"); var u = i.options.functionInit(t, o); if (u) o = u; t.data("tooltipsterContent", o); t.removeAttr("title"); if (i.options.iconDesktop && !c || i.options.iconTouch && c) { var a = i.options.iconTheme; var f = e('<span class="' + a.replace(".", "") + '"></span>'); f.data("tooltipsterContent", o).append(i.options.icon).insertAfter(t); t.data("tooltipsterIcon", f); t = f } if (i.options.touchDevices && c && (i.options.trigger == "click" || i.options.trigger == "hover")) { t.on("touchstart.tooltipster", function (e, t) { i.showTooltip() }) } else { if (i.options.trigger == "hover") { t.on("mouseenter.tooltipster", function () { i.showTooltip() }); if (i.options.interactive) { t.on("mouseleave.tooltipster", function () { var n = t.data("tooltipster"); var s = false; if (n !== r && n !== "") { n.mouseenter(function () { s = true }); n.mouseleave(function () { s = false }); var o = setTimeout(function () { if (s) { if (i.options.interactiveAutoClose) { n.find("select").on("change", function () { i.hideTooltip() }); n.mouseleave(function (t) { var n = e(t.target); if (n.parents(".tooltipster-base").length === 0 || n.hasClass("tooltipster-base")) { i.hideTooltip() } else { n.on("mouseleave", function (e) { i.hideTooltip() }) } }) } } else { i.hideTooltip() } }, i.options.interactiveTolerance) } else { i.hideTooltip() } }) } else { t.on("mouseleave.tooltipster", function () { i.hideTooltip() }) } } if (i.options.trigger == "click") { t.on("click.tooltipster", function () { if (t.data("tooltipster") === "" || t.data("tooltipster") === r) { i.showTooltip() } else { i.hideTooltip() } }) } } } }, showTooltip: function (t) { var n = e(this.element); var i = this; if (n.data("tooltipsterIcon") !== r) { n = n.data("tooltipsterIcon") } if (!n.hasClass("tooltipster-disable")) { if (e(".tooltipster-base").not(".tooltipster-dying").length > 0 && i.options.onlyOne) { e(".tooltipster-base").not(".tooltipster-dying").not(n.data("tooltipster")).each(function () { e(this).addClass("tooltipster-kill"); var t = e(this).data("origin"); t.data("plugin_tooltipster").hideTooltip() }) } n.clearQueue().delay(i.options.delay).queue(function () { i.options.functionBefore(n, function () { if (n.data("tooltipster") !== r && n.data("tooltipster") !== "") { var t = n.data("tooltipster"); if (!t.hasClass("tooltipster-kill")) { var s = "tooltipster-" + i.options.animation; t.removeClass("tooltipster-dying"); if (l) { t.clearQueue().addClass(s + "-show") } if (i.options.timer > 0) { var o = t.data("tooltipsterTimer"); clearTimeout(o); o = setTimeout(function () { t.data("tooltipsterTimer", r); i.hideTooltip() }, i.options.timer); t.data("tooltipsterTimer", o) } if (i.options.touchDevices && c) { e("body").bind("touchstart", function (t) { if (i.options.interactive) { var n = e(t.target); var r = true; n.parents().each(function () { if (e(this).hasClass("tooltipster-base")) { r = false } }); if (r) { i.hideTooltip(); e("body").unbind("touchstart") } } else { i.hideTooltip(); e("body").unbind("touchstart") } }) } } } else { i.options._bodyOverflowX = e("body").css("overflow-x"); e("body").css("overflow-x", "hidden"); var u = i.getContent(n); var a = i.options.theme; var h = a.replace(".", ""); var s = "tooltipster-" + i.options.animation; var p = "-webkit-transition-duration: " + i.options.speed + "ms; -webkit-animation-duration: " + i.options.speed + "ms; -moz-transition-duration: " + i.options.speed + "ms; -moz-animation-duration: " + i.options.speed + "ms; -o-transition-duration: " + i.options.speed + "ms; -o-animation-duration: " + i.options.speed + "ms; -ms-transition-duration: " + i.options.speed + "ms; -ms-animation-duration: " + i.options.speed + "ms; transition-duration: " + i.options.speed + "ms; animation-duration: " + i.options.speed + "ms;"; var d = i.options.fixedWidth > 0 ? "width:" + Math.round(i.options.fixedWidth) + "px;" : ""; var v = i.options.maxWidth > 0 ? "max-width:" + Math.round(i.options.maxWidth) + "px;" : ""; var m = i.options.interactive ? "pointer-events: auto;" : ""; var t = e('<div class="tooltipster-base ' + h + " " + s + '" style="' + d + " " + v + " " + m + " " + p + '"></div>'); var g = e('<div class="tooltipster-content"></div>'); g.html(u); t.append(g); t.appendTo("body"); n.data("tooltipster", t); t.data("origin", n); i.positionTooltip(); i.options.functionReady(n, t); if (l) { t.addClass(s + "-show") } else { t.css("display", "none").removeClass(s).fadeIn(i.options.speed) } var y = u; var b = setInterval(function () { var r = i.getContent(n); if (e("body").find(n).length === 0) { t.addClass("tooltipster-dying"); i.hideTooltip() } else if (y !== r && r !== "") { y = r; t.find(".tooltipster-content").html(r); if (i.options.updateAnimation) { if (f()) { t.css({ width: "", "-webkit-transition": "all " + i.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms", "-moz-transition": "all " + i.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms", "-o-transition": "all " + i.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms", "-ms-transition": "all " + i.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms", transition: "all " + i.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms" }).addClass("tooltipster-content-changing"); setTimeout(function () { t.removeClass("tooltipster-content-changing"); setTimeout(function () { t.css({ "-webkit-transition": i.options.speed + "ms", "-moz-transition": i.options.speed + "ms", "-o-transition": i.options.speed + "ms", "-ms-transition": i.options.speed + "ms", transition: i.options.speed + "ms" }) }, i.options.speed) }, i.options.speed) } else { t.fadeTo(i.options.speed, .5, function () { t.fadeTo(i.options.speed, 1) }) } } i.positionTooltip() } if (e("body").find(t).length === 0 || e("body").find(n).length === 0) { clearInterval(b) } }, 200); if (i.options.timer > 0) { var o = setTimeout(function () { t.data("tooltipsterTimer", r); i.hideTooltip() }, i.options.timer + i.options.speed); t.data("tooltipsterTimer", o) } if (i.options.touchDevices && c) { e("body").bind("touchstart", function (t) { if (i.options.interactive) { var n = e(t.target); var r = true; n.parents().each(function () { if (e(this).hasClass("tooltipster-base")) { r = false } }); if (r) { i.hideTooltip(); e("body").unbind("touchstart") } } else { i.hideTooltip(); e("body").unbind("touchstart") } }) } } }); n.dequeue() }) } }, hideTooltip: function (t) { var n = e(this.element); var i = this; if (n.data("tooltipsterIcon") !== r) { n = n.data("tooltipsterIcon") } var s = n.data("tooltipster"); if (s === r) { s = e(".tooltipster-dying") } n.clearQueue(); if (s !== r && s !== "") { var o = s.data("tooltipsterTimer"); if (o !== r) { clearTimeout(o) } var u = "tooltipster-" + i.options.animation; if (l) { s.clearQueue().removeClass(u + "-show").addClass("tooltipster-dying").delay(i.options.speed).queue(function () { s.remove(); n.data("tooltipster", ""); e("body").css("overflow-x", i.options._bodyOverflowX); i.options.functionAfter(n) }) } else { s.clearQueue().addClass("tooltipster-dying").fadeOut(i.options.speed, function () { s.remove(); n.data("tooltipster", ""); e("body").css("overflow-x", i.options._bodyOverflowX); i.options.functionAfter(n) }) } } }, positionTooltip: function (n) { var s = e(this.element); var o = this; if (s.data("tooltipsterIcon") !== r) { s = s.data("tooltipsterIcon") } if (s.data("tooltipster") !== r && s.data("tooltipster") !== "") { var u = s.data("tooltipster"); u.css("width", ""); var a = e(t).width(); var f = s.outerWidth(false); var l = s.outerHeight(false); var c = u.outerWidth(false); var h = u.innerWidth() + 1; var p = u.outerHeight(false); var d = s.offset(); var v = d.top; var m = d.left; var g = r; if (s.is("area")) { var y = s.attr("shape"); var b = s.parent().attr("name"); var w = e('img[usemap="#' + b + '"]'); var E = w.offset().left; var S = w.offset().top; var x = s.attr("coords") !== r ? s.attr("coords").split(",") : r; if (y == "circle") { var T = parseInt(x[0]); var N = parseInt(x[1]); var C = parseInt(x[2]); l = C * 2; f = C * 2; v = S + N - C; m = E + T - C } else if (y == "rect") { var T = parseInt(x[0]); var N = parseInt(x[1]); var k = parseInt(x[2]); var L = parseInt(x[3]); l = L - N; f = k - T; v = S + N; m = E + T } else if (y == "poly") { var A = []; var O = []; var M = 0, _ = 0, D = 0, P = 0; var H = "even"; for (i = 0; i < x.length; i++) { var B = parseInt(x[i]); if (H == "even") { if (B > D) { D = B; if (i === 0) { M = D } } if (B < M) { M = B } H = "odd" } else { if (B > P) { P = B; if (i == 1) { _ = P } } if (B < _) { _ = B } H = "even" } } l = P - _; f = D - M; v = S + _; m = E + M } else { l = w.outerHeight(false); f = w.outerWidth(false); v = S; m = E } } if (o.options.fixedWidth === 0) { u.css({ width: Math.round(h) + "px", "padding-left": "0px", "padding-right": "0px" }) } var j = 0, F = 0, I = 0; var q = parseInt(o.options.offsetY); var R = parseInt(o.options.offsetX); var U = ""; function z() { var n = e(t).scrollLeft(); if (j - n < 0) { var r = j - n; j = n; u.data("arrow-reposition", r) } if (j + c - n > a) { var r = j - (a + n - c); j = a + n - c; u.data("arrow-reposition", r) } } function W(n, r) { if (v - e(t).scrollTop() - p - q - 12 < 0 && r.indexOf("top") > -1) { o.options.position = n; g = r } if (v + l + p + 12 + q > e(t).scrollTop() + e(t).height() && r.indexOf("bottom") > -1) { o.options.position = n; g = r; I = v - p - q - 12 } } if (o.options.position == "top") { var X = m + c - (m + f); j = m + R - X / 2; I = v - p - q - 12; z(); W("bottom", "top") } if (o.options.position == "top-left") { j = m + R; I = v - p - q - 12; z(); W("bottom-left", "top-left") } if (o.options.position == "top-right") { j = m + f + R - c; I = v - p - q - 12; z(); W("bottom-right", "top-right") } if (o.options.position == "bottom") { var X = m + c - (m + f); j = m - X / 2 + R; I = v + l + q + 12; z(); W("top", "bottom") } if (o.options.position == "bottom-left") { j = m + R; I = v + l + q + 12; z(); W("top-left", "bottom-left") } if (o.options.position == "bottom-right") { j = m + f + R - c; I = v + l + q + 12; z(); W("top-right", "bottom-right") } if (o.options.position == "left") { j = m - R - c - 12; F = m + R + f + 12; var V = v + p - (v + s.outerHeight(false)); I = v - V / 2 - q; if (j < 0 && F + c > a) { var J = parseFloat(u.css("border-width")) * 2; var K = c + j - J; u.css("width", K + "px"); p = u.outerHeight(false); j = m - R - K - 12 - J; V = v + p - (v + s.outerHeight(false)); I = v - V / 2 - q } else if (j < 0) { j = m + R + f + 12; u.data("arrow-reposition", "left") } } if (o.options.position == "right") { j = m + R + f + 12; F = m - R - c - 12; var V = v + p - (v + s.outerHeight(false)); I = v - V / 2 - q; if (j + c > a && F < 0) { var J = parseFloat(u.css("border-width")) * 2; var K = a - j - J; u.css("width", K + "px"); p = u.outerHeight(false); V = v + p - (v + s.outerHeight(false)); I = v - V / 2 - q } else if (j + c > a) { j = m - R - c - 12; u.data("arrow-reposition", "right") } } if (o.options.arrow) { var Q = "tooltipster-arrow-" + o.options.position; if (o.options.arrowColor.length < 1) { var G = u.css("background-color") } else { var G = o.options.arrowColor } var Y = u.data("arrow-reposition"); if (!Y) { Y = "" } else if (Y == "left") { Q = "tooltipster-arrow-right"; Y = "" } else if (Y == "right") { Q = "tooltipster-arrow-left"; Y = "" } else { Y = "left:" + Math.round(Y) + "px;" } if (o.options.position == "top" || o.options.position == "top-left" || o.options.position == "top-right") { var Z = parseFloat(u.css("border-bottom-width")); var et = u.css("border-bottom-color") } else if (o.options.position == "bottom" || o.options.position == "bottom-left" || o.options.position == "bottom-right") { var Z = parseFloat(u.css("border-top-width")); var et = u.css("border-top-color") } else if (o.options.position == "left") { var Z = parseFloat(u.css("border-right-width")); var et = u.css("border-right-color") } else if (o.options.position == "right") { var Z = parseFloat(u.css("border-left-width")); var et = u.css("border-left-color") } else { var Z = parseFloat(u.css("border-bottom-width")); var et = u.css("border-bottom-color") } if (Z > 1) { Z++ } var tt = ""; if (Z !== 0) { var nt = ""; var rt = "border-color: " + et + ";"; if (Q.indexOf("bottom") !== -1) { nt = "margin-top: -" + Math.round(Z) + "px;" } else if (Q.indexOf("top") !== -1) { nt = "margin-bottom: -" + Math.round(Z) + "px;" } else if (Q.indexOf("left") !== -1) { nt = "margin-right: -" + Math.round(Z) + "px;" } else if (Q.indexOf("right") !== -1) { nt = "margin-left: -" + Math.round(Z) + "px;" } tt = '<span class="tooltipster-arrow-border" style="' + nt + " " + rt + ';"></span>' } u.find(".tooltipster-arrow").remove(); U = '<div class="' + Q + ' tooltipster-arrow" style="' + Y + '">' + tt + '<span style="border-color:' + G + ';"></span></div>'; u.append(U) } u.css({ top: Math.round(I) + "px", left: Math.round(j) + "px" }); if (g !== r) { o.options.position = g } } }, getContent: function (t) { var n = t.data("tooltipsterContent"); n = e(e.parseHTML("<div>" + n + "</div>")).html(); return n } }; e.fn[s] = function (t) { if (t && t === "setDefaults") { e.extend(o, arguments[1]) } else { if (typeof t === "string") { var n = this; var i = arguments[1]; var a = null; if (n.data("plugin_tooltipster") === r) { var f = n.find("*"); n = e(); f.each(function () { if (e(this).data("plugin_tooltipster") !== r) { n.push(e(this)) } }) } n.each(function () { switch (t.toLowerCase()) { case "show": e(this).data("plugin_tooltipster").showTooltip(); break; case "hide": e(this).data("plugin_tooltipster").hideTooltip(); break; case "disable": e(this).addClass("tooltipster-disable"); break; case "enable": e(this).removeClass("tooltipster-disable"); break; case "destroy": e(this).data("plugin_tooltipster").hideTooltip(); var s = e(this).data("tooltipsterIcon"); if (s) s.remove(); e(this).attr("title", n.data("tooltipsterContent")).removeData("plugin_tooltipster").removeData("tooltipsterContent").removeData("tooltipsterIcon").off(".tooltipster"); break; case "elementicon": a = e(this).data("tooltipsterIcon"); a = a ? a[0] : r; return false; case "update": var o = i; if (e(this).data("tooltipsterIcon") === r) { e(this).data("tooltipsterContent", o) } else { var u = e(this).data("tooltipsterIcon"); u.data("tooltipsterContent", o) } break; case "reposition": e(this).data("plugin_tooltipster").positionTooltip(); break; case "val": a = e(this).data("tooltipsterContent"); console.log(a); return false } }); return a !== null ? a : this } else { return this.each(function () { if (!e.data(this, "plugin_" + s)) { e.data(this, "plugin_" + s, new u(this, t)) } }) } } }; if (c) { t.addEventListener("orientationchange", function () { if (e(".tooltipster-base").length > 0) { e(".tooltipster-base").each(function () { var t = e(this).data("origin"); t.data("plugin_tooltipster").hideTooltip() }) } }, false) } e(t).on("scroll.tooltipster", function () { var t = e(".tooltipster-base").data("origin"); if (t) { t.tooltipster("reposition") } }); e(t).on("resize.tooltipster", function () { var t = e(".tooltipster-base").data("origin"); if (t !== null && t !== r) { t.tooltipster("reposition") } }) })(jQuery, window, document);;
$(document).ready(function(){

	// switching seasons for trees collection 
	$(".season").click(function(){
		$(".season.active").removeClass("active");
		$(this).addClass("active");
		$(".trees").hide();
		
		if($(this).hasClass("spring") ){
			$(".spring-trees").fadeIn();
		}
		if($(this).hasClass("summer") ){
			$(".summer-trees").fadeIn();
		}
		if($(this).hasClass("autumn") ){
			$(".autumn-trees").fadeIn();
		}
		if($(this).hasClass("winter") ){
			$(".winter-trees").fadeIn();
		}
	});

	// show/hide activities
    // 
	$(".side-menu li").click(function () {
	    $(".side-menu .active").removeClass("active");
	    $(this).addClass("active");
	    // show content div
	    var klass = $(this).attr("class").split(' ')[0];
	    console.log(klass);
	    $(".content .active").hide();
	    $("." + klass + "-content").fadeIn().addClass("active");
	    return false;
	});
    
    //// gallery
	//var $container = $('#gallery-wrapper');
    //// initialize
	//$container.masonry({
	//    itemSelector: '.item'
	//});

    //// initialize Masonry again
    //// // layout Masonry again after all images have loaded
	//imagesLoaded($container, function () {
	//    $container.masonry({
	//        itemSelector: '.item'
	//    });
	//});
});

;
/**
 * Created by ezgoing on 14/9/2014.
 */

"use strict";
(function (factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else {
        factory(jQuery);
    }
}(function ($) {
    var cropbox = function(options, el){
        var el = el || $(options.imageBox),
            obj =
            {
                state : {},
                ratio : 1,
                options : options,
                imageBox : el,
                thumbBox : el.find(options.thumbBox),
                spinner : el.find(options.spinner),
                image : new Image(),
                getDataURL: function ()
                {
                    var width = this.thumbBox.width(),
                        height = this.thumbBox.height(),
                        canvas = document.createElement("canvas"),
                        dim = el.css('background-position').split(' '),
                        size = el.css('background-size').split(' '),
                        dx = parseInt(dim[0]) - el.width()/2 + width/2,
                        dy = parseInt(dim[1]) - el.height()/2 + height/2,
                        dw = parseInt(size[0]),
                        dh = parseInt(size[1]),
                        sh = parseInt(this.image.height),
                        sw = parseInt(this.image.width);

                    canvas.width = width;
                    canvas.height = height;
                    var context = canvas.getContext("2d");
                    context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh);
                    var imageData = canvas.toDataURL('image/png');
                    return imageData;
                },
                getBlob: function()
                {
                    var imageData = this.getDataURL();
                    var b64 = imageData.replace('data:image/png;base64,','');
                    var binary = atob(b64);
                    var array = [];
                    for (var i = 0; i < binary.length; i++) {
                        array.push(binary.charCodeAt(i));
                    }
                    return  new Blob([new Uint8Array(array)], {type: 'image/png'});
                },
                zoomIn: function ()
                {
                    this.ratio*=1.1;
                    setBackground();
                },
                zoomOut: function ()
                {
                    this.ratio*=0.9;
                    setBackground();
                }
            },
            setBackground = function()
            {
                var w =  parseInt(obj.image.width)*obj.ratio;
                var h =  parseInt(obj.image.height)*obj.ratio;

                var pw = (el.width() - w) / 2;
                var ph = (el.height() - h) / 2;

                el.css({
                    'background-image': 'url(' + obj.image.src + ')',
                    'background-size': w +'px ' + h + 'px',
                    'background-position': pw + 'px ' + ph + 'px',
                    'background-repeat': 'no-repeat'});
            },
            imgMouseDown = function(e)
            {
                e.stopImmediatePropagation();

                obj.state.dragable = true;
                obj.state.mouseX = e.clientX;
                obj.state.mouseY = e.clientY;
            },
            imgMouseMove = function(e)
            {
                e.stopImmediatePropagation();

                if (obj.state.dragable)
                {
                    var x = e.clientX - obj.state.mouseX;
                    var y = e.clientY - obj.state.mouseY;

                    var bg = el.css('background-position').split(' ');

                    var bgX = x + parseInt(bg[0]);
                    var bgY = y + parseInt(bg[1]);

                    el.css('background-position', bgX +'px ' + bgY + 'px');

                    obj.state.mouseX = e.clientX;
                    obj.state.mouseY = e.clientY;
                }
            },
            imgMouseUp = function(e)
            {
                e.stopImmediatePropagation();
                obj.state.dragable = false;
            },
            zoomImage = function(e)
            {
                e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0 ? obj.ratio*=1.1 : obj.ratio*=0.9;
                setBackground();
            }

        obj.spinner.show();
        obj.image.onload = function() {
            obj.spinner.hide();
            setBackground();

            el.bind('mousedown', imgMouseDown);
            el.bind('mousemove', imgMouseMove);
            $(window).bind('mouseup', imgMouseUp);
            el.bind('mousewheel DOMMouseScroll', zoomImage);
        };
        obj.image.src = options.imgSrc;
        el.on('remove', function(){$(window).unbind('mouseup', imgMouseUp)});

        return obj;
    };

    jQuery.fn.cropbox = function(options){
        return new cropbox(options, this);
    };
}));


$(window).load(function () {
    var options =
    {
        thumbBox: '.thumbBox',
        spinner: '.spinner',
    };
    var cropper = $('.imageBox').cropbox(options);
    $('#file').on('change', function() {
        var reader = new FileReader();
        reader.onload = function(e) {
            options.imgSrc = e.target.result;
            cropper = $('.imageBox').cropbox(options);
        };
        reader.readAsDataURL(this.files[0]);
        this.files = [];
    });
    $('#btnCrop').on('click', function() {
        var img = cropper.getDataURL();
        $('.cropped').empty();
        $('.cropped').append('<img id="croppedPhoto" src="' + img + '">');
    });
    $('#btnZoomIn').on('click', function() {
        cropper.zoomIn();
    });
    $('#btnZoomOut').on('click', function() {
        cropper.zoomOut();
    });
});
;
/*
 * Basic jQuery Slider plug-in v.1.3
 *
 * http://www.basic-slider.com
 *
 * Authored by John Cobb
 * http://www.johncobb.name
 * @john0514
 *
 * Copyright 2011, John Cobb
 * License: GNU General Public License, version 3 (GPL-3.0)
 * http://www.opensource.org/licenses/gpl-3.0.html
 *
 */(function(e){"use strict";e.fn.bjqs=function(t){var n={width:700,height:300,animtype:"fade",animduration:450,animspeed:4e3,automatic:!0,showcontrols:!0,centercontrols:!0,nexttext:"Next",prevtext:"Prev",showmarkers:!0,centermarkers:!0,keyboardnav:!0,hoverpause:!0,usecaptions:!0,randomstart:!1,responsive:!1},r=e.extend({},n,t),i=this,s=i.find("ul.bjqs"),o=s.children("li"),u=null,a=null,f=null,l=null,c=null,h=null,p=null,d=null,v={slidecount:o.length,animating:!1,paused:!1,currentslide:1,nextslide:0,currentindex:0,nextindex:0,interval:null},m={width:null,height:null,ratio:null},g={fwd:"forward",prev:"previous"},y=function(){o.addClass("bjqs-slide");r.responsive?b():E();if(v.slidecount>1){r.randomstart&&L();r.showcontrols&&x();r.showmarkers&&T();r.keyboardnav&&N();r.hoverpause&&r.automatic&&C();r.animtype==="slide"&&S()}r.usecaptions&&k();if(r.animtype==="slide"&&!r.randomstart){v.currentindex=1;v.currentslide=2}s.show();o.eq(v.currentindex).show();r.automatic&&(v.interval=setInterval(function(){O(g.fwd,!1)},r.animspeed))},b=function(){m.width=i.outerWidth();m.ratio=m.width/r.width,m.height=r.height*m.ratio;if(r.animtype==="fade"){o.css({height:r.height,width:"100%"});o.children("img").css({height:r.height,width:"100%"});s.css({height:r.height,width:"100%"});i.css({height:r.height,"max-width":r.width,position:"relative"});if(m.width<r.width){o.css({height:m.height});o.children("img").css({height:m.height});s.css({height:m.height});i.css({height:m.height})}e(window).resize(function(){m.width=i.outerWidth();m.ratio=m.width/r.width,m.height=r.height*m.ratio;o.css({height:m.height});o.children("img").css({height:m.height});s.css({height:m.height});i.css({height:m.height})})}if(r.animtype==="slide"){o.css({height:r.height,width:r.width});o.children("img").css({height:r.height,width:r.width});s.css({height:r.height,width:r.width*r.slidecount});i.css({height:r.height,"max-width":r.width,position:"relative"});if(m.width<r.width){o.css({height:m.height});o.children("img").css({height:m.height});s.css({height:m.height});i.css({height:m.height})}e(window).resize(function(){m.width=i.outerWidth(),m.ratio=m.width/r.width,m.height=r.height*m.ratio;o.css({height:m.height,width:m.width});o.children("img").css({height:m.height,width:m.width});s.css({height:m.height,width:m.width*r.slidecount});i.css({height:m.height});h.css({height:m.height,width:m.width});w(function(){O(!1,v.currentslide)},200,"some unique string")})}},w=function(){var e={};return function(t,n,r){r||(r="Don't call this twice without a uniqueId");e[r]&&clearTimeout(e[r]);e[r]=setTimeout(t,n)}}(),E=function(){o.css({height:r.height,width:r.width});s.css({height:r.height,width:r.width});i.css({height:r.height,width:r.width,position:"relative"})},S=function(){p=o.eq(0).clone();d=o.eq(v.slidecount-1).clone();p.attr({"data-clone":"last","data-slide":0}).appendTo(s).show();d.attr({"data-clone":"first","data-slide":0}).prependTo(s).show();o=s.children("li");v.slidecount=o.length;h=e('<div class="bjqs-wrapper"></div>');if(r.responsive&&m.width<r.width){h.css({width:m.width,height:m.height,overflow:"hidden",position:"relative"});s.css({width:m.width*(v.slidecount+2),left:-m.width*v.currentslide})}else{h.css({width:r.width,height:r.height,overflow:"hidden",position:"relative"});s.css({width:r.width*(v.slidecount+2),left:-r.width*v.currentslide})}o.css({"float":"left",position:"relative",display:"list-item"});h.prependTo(i);s.appendTo(h)},x=function(){u=e('<ul class="bjqs-controls"></ul>');a=e('<li class="bjqs-next"><a href="#" data-direction="'+g.fwd+'">'+r.nexttext+"</a></li>");f=e('<li class="bjqs-prev"><a href="#" data-direction="'+g.prev+'">'+r.prevtext+"</a></li>");u.on("click","a",function(t){t.preventDefault();var n=e(this).attr("data-direction");if(!v.animating){n===g.fwd&&O(g.fwd,!1);n===g.prev&&O(g.prev,!1)}});f.appendTo(u);a.appendTo(u);u.appendTo(i);if(r.centercontrols){u.addClass("v-centered");var t=(i.height()-a.children("a").outerHeight())/2,n=t/r.height*100,s=n+"%";a.find("a").css("top",s);f.find("a").css("top",s)}},T=function(){l=e('<ol class="bjqs-markers"></ol>');e.each(o,function(t,n){var i=t+1,s=t+1;r.animtype==="slide"&&(s=t+2);var o=e('<li><a href="#">'+i+"</a></li>");i===v.currentslide&&o.addClass("active-marker");o.on("click","a",function(e){e.preventDefault();!v.animating&&v.currentslide!==s&&O(!1,s)});o.appendTo(l)});l.appendTo(i);c=l.find("li");if(r.centermarkers){l.addClass("h-centered");var t=(r.width-l.width())/2;l.css("left",t)}},N=function(){e(document).keyup(function(e){if(!v.paused){clearInterval(v.interval);v.paused=!0}if(!v.animating)if(e.keyCode===39){e.preventDefault();O(g.fwd,!1)}else if(e.keyCode===37){e.preventDefault();O(g.prev,!1)}if(v.paused&&r.automatic){v.interval=setInterval(function(){O(g.fwd)},r.animspeed);v.paused=!1}})},C=function(){i.hover(function(){if(!v.paused){clearInterval(v.interval);v.paused=!0}},function(){if(v.paused){v.interval=setInterval(function(){O(g.fwd,!1)},r.animspeed);v.paused=!1}})},k=function(){e.each(o,function(t,n){var r=e(n).children("img:first-child").attr("title");r||(r=e(n).children("a").find("img:first-child").attr("title"));if(r){r=e('<p class="bjqs-caption">'+r+"</p>");r.appendTo(e(n))}})},L=function(){var e=Math.floor(Math.random()*v.slidecount)+1;v.currentslide=e;v.currentindex=e-1},A=function(e){if(e===g.fwd)if(o.eq(v.currentindex).next().length){v.nextindex=v.currentindex+1;v.nextslide=v.currentslide+1}else{v.nextindex=0;v.nextslide=1}else if(o.eq(v.currentindex).prev().length){v.nextindex=v.currentindex-1;v.nextslide=v.currentslide-1}else{v.nextindex=v.slidecount-1;v.nextslide=v.slidecount}},O=function(e,t){if(!v.animating){v.animating=!0;if(t){v.nextslide=t;v.nextindex=t-1}else A(e);if(r.animtype==="fade"){if(r.showmarkers){c.removeClass("active-marker");c.eq(v.nextindex).addClass("active-marker")}o.eq(v.currentindex).fadeOut(r.animduration);o.eq(v.nextindex).fadeIn(r.animduration,function(){v.animating=!1;v.currentslide=v.nextslide;v.currentindex=v.nextindex})}if(r.animtype==="slide"){if(r.showmarkers){var n=v.nextindex-1;n===v.slidecount-2?n=0:n===-1&&(n=v.slidecount-3);c.removeClass("active-marker");c.eq(n).addClass("active-marker")}r.responsive&&m.width<r.width?v.slidewidth=m.width:v.slidewidth=r.width;s.animate({left:-v.nextindex*v.slidewidth},r.animduration,function(){v.currentslide=v.nextslide;v.currentindex=v.nextindex;if(o.eq(v.currentindex).attr("data-clone")==="last"){s.css({left:-v.slidewidth});v.currentslide=2;v.currentindex=1}else if(o.eq(v.currentindex).attr("data-clone")==="first"){s.css({left:-v.slidewidth*(v.slidecount-2)});v.currentslide=v.slidecount-1;v.currentindex=v.slidecount-2}v.animating=!1})}}};y()}})(jQuery);;
