",{
id:"bar"
});
$progressbar.append($bar).prependto($elem);
}
function start() {
//reset timer
percenttime = 0;
ispause = false;
//run interval every 0.01 second
tick = setinterval(interval, 10);
};
var time = 7; // time in seconds
function interval() {
if(ispause === false){
percenttime += 1 / time;
$bar.css({
width: percenttime+"%"
});
//if percenttime is equal or greater than 100
if(percenttime >= 100){
//slide to next item
$elem.trigger('owl.next')
}
}
}
//pause while dragging
function pauseondragging(){
ispause = true;
}
//moved callback
function moved(){
//clear interval
cleartimeout(tick);
//start again
start();
}
});
});
}
}
/** 04. flexslider
**************************************************************** **/
function _flexslider() {
var _container = jquery(".flexslider");
if(_container.length > 0) {
loadscript(plugin_path + 'slider/flexslider/jquery.flexslider-min.js', function() {
if(jquery().flexslider) {
var _controlnav = _container.attr('data-controlnav'),
_slideshowspeed = _container.attr('data-slideshowspeed') || 7000,
_pauseonhover = _container.attr('data-pauseonhover') || false;
if(_pauseonhover == "true") {
_pauseonhover = true;
} else{
_pauseonhover = false;
}
if(_controlnav == 'thumbnails') {
_controlnav = 'thumbnails';
} else
if(_controlnav == 'true') {
_controlnav = true;
} else
if(_controlnav == 'false') {
_controlnav = false;
} else {
_controlnav = true;
}
if(_controlnav == 'thumbnails' || _controlnav == false) {
_directionnav = false;
} else {
_directionnav = true;
}
jquery(_container).flexslider({
animation : "slide",
controlnav : _controlnav,
slideshowspeed : parseint(_slideshowspeed) || 7000,
directionnav : _directionnav,
pauseonhover : _pauseonhover,
start: function(slider){
jquery('.flex-prev').html('
');
jquery('.flex-next').html('
');
}
});
// resize flex slider if exists!
_container.resize();
}
});
}
}
/** 04. popover
**************************************************************** **/
function _popover() {
jquery("a[data-toggle=popover]").bind("click", function(e) {
jquery('.popover-title .close').remove();
e.preventdefault();
});
var isvisible = false,
clickedaway = false;
jquery("a[data-toggle=popover], button[data-toggle=popover]").popover({
html: true,
trigger: 'manual'
}).click(function(e) {
jquery(this).popover('show');
clickedaway = false;
isvisible = true;
e.preventdefault();
});
jquery(document).click(function(e) {
if(isvisible & clickedaway) {
jquery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide');
isvisible = clickedaway = false;
} else {
clickedaway = true;
}
});
jquery("a[data-toggle=popover], button[data-toggle=popover]").popover({
html: true,
trigger: 'manual'
}).click(function(e) {
$(this).popover('show');
$('.popover-title').append('
');
$('.close').click(function(e){
jquery("a[data-toggle=popover], button[data-toggle=popover]").popover('hide');
});
e.preventdefault();
});
// jquery("a[data-toggle=popover], button[data-toggle=popover]").popover();
}
/** 05. lightbox
**************************************************************** **/
function _lightbox() {
var _el = jquery(".lightbox");
if(_el.length > 0) {
loadscript(plugin_path + 'magnific-popup/jquery.magnific-popup.min.js', function() {
if(typeof(jquery.magnificpopup) == "undefined") {
return false;
}
jquery.extend(true, jquery.magnificpopup.defaults, {
tclose: 'close',
tloading: 'loading...',
gallery: {
tprev: 'previous',
tnext: 'next',
tcounter: '%curr% / %total%'
},
image: {
terror: 'image not loaded!'
},
ajax: {
terror: 'content not loaded!'
}
});
_el.each(function() {
var _t = jquery(this),
options = _t.attr('data-plugin-options'),
config = {},
defaults = {
type: 'image',
fixedcontentpos: false,
fixedbgpos: false,
mainclass: 'mfp-no-margins mfp-with-zoom',
closeoncontentclick: true,
closeonbgclick: true,
image: {
verticalfit: true
},
zoom: {
enabled: false,
duration: 300
},
gallery: {
enabled: false,
navigatebyimgclick: true,
preload: [0,1],
arrowmarkup: '
',
tprev: 'previous',
tnext: 'next',
tcounter: '
%curr% / %total%'
},
};
if(_t.data("plugin-options")) {
config = jquery.extend({}, defaults, options, _t.data("plugin-options"));
}
jquery(this).magnificpopup(config);
});
});
}
}
/** 06. scrollto
**************************************************************** **/
function _scrollto(to, offset) {
if(to == false) {
jquery("a.scrollto").bind("click", function(e) {
e.preventdefault();
var href = jquery(this).attr('href'),
_offset = jquery(this).attr('data-offset') || 0;
if(href != '#' && href != '#top') {
jquery('html,body').animate({scrolltop: jquery(href).offset().top - parseint(_offset)}, 800, 'easeinoutexpo');
}
if(href == '#top') {
jquery('html,body').animate({scrolltop: 0}, 800, 'easeinoutexpo');
}
});
jquery("#totop").bind("click", function(e) {
e.preventdefault();
jquery('html,body').animate({scrolltop: 0}, 800, 'easeinoutexpo');
});
} else {
// usage: _scrollto("#footer", 150);
jquery('html,body').animate({scrolltop: jquery(to).offset().top - offset}, 800, 'easeinoutexpo');
}
}
/** 07. parallax
**************************************************************** **/
function _parallax() {
if(jquery().parallax) {
// jquery(".parallax-1").css("background-attachment", "fixed");
jquery(".parallax-1").parallax("50%", "0.1");
// jquery(".parallax-2").css("background-attachment", "fixed");
jquery(".parallax-2").parallax("50%", "0.2");
// jquery(".parallax-3").css("background-attachment", "fixed");
jquery(".parallax-3").parallax("50%", "0.3");
// jquery(".parallax-4").css("background-attachment", "fixed");
jquery(".parallax-4").parallax("50%", "0.4");
}
/** slider parallax
do not use overlay - will be very slow!
**************************** **/
var _slider = jquery('#slider');
if(_slider.length > 0) {
if(_slider.hasclass('parallax-slider')) {
var block_intro_top = _slider.offset().top;
jquery(window).scroll(function() {
var _currenttop = jquery(document).scrolltop();
if(_currenttop < 768) {
var _sliderh = jquery('#slider').height();
jquery('#slider>div').css('top', (_currenttop*0.5));
jquery('#slider>div').css('opacity', (1 - _currenttop/_sliderh*1));
}
});
}
}
}
/** 07. video
**************************************************************** **/
function _video() {
if(jquery("section.section-video").length > 0) {
var _t = jquery("section.section-video .section-container-video>video");
_w = jquery(window).width();
_t.width(_w);
}
}
/** 07. youtube backround
**************************************************************** **/
function _youtubebg() {
var _container = jquery('#ytplayer');
if(_container.length > 0) {
loadscript(plugin_path + 'jquery.mb.ytplayer.min.js', function() {
if(jquery().mb_ytplayer) {
var disablemobile = false;
if( /android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.useragent) ) {
// disablemobile = true;
}
if(disablemobile === false) {
jquery(".player").mb_ytplayer();
jquery("#video-volume").bind("click", function(e) {
e.preventdefault();
jquery('#ytplayer').togglevolume();
});
// audio control
jquery("#video-volume").bind("click", function() {
if(jquery('i.fa', this).hasclass('fa-volume-down')) {
jquery('i.fa', this).removeclass('fa-volume-down');
jquery('i.fa', this).removeclass('fa-volume-up');
jquery('i.fa', this).addclass('fa-volume-up');
} else {
jquery('i.fa', this).removeclass('fa-volume-up');
jquery('i.fa', this).removeclass('fa-volume-v');
jquery('i.fa', this).addclass('fa-volume-down');
}
});
} else {
jquery(".player , #video-volume").hide();
}
}
});
}
}
/** 08. mixitup filter
**************************************************************** **/
function _mixitup() {
var _container = jquery('.mix-grid');
if(_container.length > 0) {
loadscript(plugin_path + 'mixitup/jquery.mixitup.min.js', function() {
if(jquery().mixitup) {
_container.mixitup();
jquery("ul.mix-filter a").bind("click", function(e) {
e.preventdefault();
});
}
});
}
}
/** 09. toggle
**************************************************************** **/
function _toggle() {
var $_t = this,
previewparclosedheight = 25;
jquery("div.toggle.active > p").addclass("preview-active");
jquery("div.toggle.active > div.toggle-content").slidedown(400);
jquery("div.toggle > label").click(function(e) {
var parentsection = jquery(this).parent(),
parentwrapper = jquery(this).parents("div.toggle"),
previewpar = false,
isaccordion = parentwrapper.hasclass("toggle-accordion");
if(isaccordion && typeof(e.originalevent) != "undefined") {
parentwrapper.find("div.toggle.active > label").trigger("click");
}
parentsection.toggleclass("active");
if(parentsection.find("> p").get(0)) {
previewpar = parentsection.find("> p");
var previewparcurrentheight = previewpar.css("height");
var previewparanimateheight = previewpar.css("height");
previewpar.css("height", "auto");
previewpar.css("height", previewparcurrentheight);
}
var togglecontent = parentsection.find("> div.toggle-content");
if(parentsection.hasclass("active")) {
jquery(previewpar).animate({height: previewparanimateheight}, 350, function() {jquery(this).addclass("preview-active");});
togglecontent.slidedown(350);
} else {
jquery(previewpar).animate({height: previewparclosedheight}, 350, function() {jquery(this).removeclass("preview-active");});
togglecontent.slideup(350);
}
});
}
/** 11. placeholder
**************************************************************** **/
function _placeholder() {
//check for ie
if(navigator.appversion.indexof("msie")!=-1) {
jquery('[placeholder]').focus(function() {
var input = jquery(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeclass('placeholder');
}
}).blur(function() {
var input = jquery(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {
input.addclass('placeholder');
input.val(input.attr('placeholder'));
}
}).blur();
}
}
/** 12. word rotate
**************************************************************** **/
function _wrotate() {
jquery(".word-rotator").each(function() {
var _t = jquery(this),
_items = _t.find(".items"),
items = _items.find("> span"),
firstitem = items.eq(0),
firstitemclone = firstitem.clone(),
_iheight = jquery(this).height(),
_citem = 1,
_ctop = 0,
_delay = jquery(this).attr('data-delay') || 2000;
_items.append(firstitemclone);
_t.height(_iheight).addclass("active");
setinterval(function() {
_ctop = (_citem * _iheight);
_items.animate({top: - (_ctop) + "px"}, 300, "easeoutquad", function(){
_citem++;
if(_citem > items.length) {
_items.css("top", 0);
_citem = 1;
}
});
}, _delay);
});
var _container = jquery('span.rotate');
if(_container.length > 0) {
loadscript(plugin_path + 'text-rotator/jquery.simple-text-rotator.min.js', function() {
_container.each(function() {
var _t = jquery(this),
_animation = _t.attr('data-animation') || 'fade', // fade|flip|flipcube|flipup|spin
_speed = _t.attr('data-speed') || 2000;
_t.textrotator({
animation: _animation,
speed: parseint(_speed)
});
});
});
}
}
/** 08. lazy load
**************************************************************** **/
function _lazyload() {
var _container = jquery('img.lazy');
if(_container.length > 0) {
loadscript(plugin_path + 'lazyload/jquery.lazyload.min.js', function() {
if(jquery().lazyload) {
_container.each(function () {
var _t = jquery(this),
_effect = _t.attr('data-effect') || 'fadein';
_t.lazyload({
effect : _effect
});
});
}
});
}
}
/** 13. misc
**************************************************************** **/
function _misc() {
/** portfolio bugfix
*********************** **/
if(jquery("#portfolio").length > 0) {
jquery("#portfolio .item-box .owl-carousel").each(function() {
// fix if has owl-carousel slider!
jquery(this).parent().parent().find('.item-box-desc').css({"padding-top":"29px"});
});
}
/** masonry
*********************** **/
if(jquery().masonry) {
jquery(".masonry").masonry();
}
/** isotope portfolio
*********************** **/
var portfolio_isotope_container = jquery("#portfolio.portfolio-isotope");
if(portfolio_isotope_container.length > 0) {
loadscript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
// isotope portfolio
if(jquery().isotope) {
var _container = jquery('#portfolio');
// calculate item width on fullwidth portfolio
if(_container.hasclass('portfolio-isotope-2')) {
_cols = 2;
} else
if(_container.hasclass('portfolio-isotope-3')) {
_cols = 3;
} else
if(_container.hasclass('portfolio-isotope-4')) {
_cols = 4;
} else
if(_container.hasclass('portfolio-isotope-5')) {
_cols = 5;
} else
if(_container.hasclass('portfolio-isotope-6')) {
_cols = 6;
} else { _cols = 4; }
function _recalcw() {
_dw = jquery(document).width();
if(_container.hasclass('fullwidth')) { // fullwidth
// _w = jquery(document).width(); // not used - problems on aside header
_w = _container.width();
_witem = (_w/_cols);
if(_dw < 760) {
_witem = (_w/2);
}
if(_dw < 480) {
_witem = jquery("#portfolio").width();
}
// apply item width
jquery("#portfolio>.portfolio-item").css({"width":_witem});
} else { // non fullwidth
_mr = parseint(jquery("#portfolio>.portfolio-item").css('margin-right'));
_w = jquery("#portfolio").closest('.container').width();
_witem = _w / _cols - _mr;
if(_dw < 760) {
_witem = (_w/2 - _mr);
}
if(_dw < 480) {
_witem = _w;
}
// apply item & container width
jquery("#portfolio.portfolio-isotope").css({"width":_w});
jquery("#portfolio>.portfolio-item").css({"width":_witem});
}
// resize flex slider if exists!
if(jquery('.flexslider').length > 0) {
jquery('.flexslider').resize();
}
} _recalcw();
jquery(window).load(function(){
var _t = settimeout(function(){
_container.isotope({
masonry: {},
filter: '*',
animationoptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
jquery('#portfolio_filter>li>a').bind("click", function(e){
e.preventdefault();
jquery('#portfolio_filter>li.active').removeclass('active');
jquery(this).parent('li').addclass('active');
var selector = jquery(this).attr('data-filter');
_container.isotope({
filter: selector,
animationoptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
});
}, 50 );
settimeout(function() {
_container.isotope('layout');
}, 300);
});
// on resize
jquery(window).resize(function() {
if(window.afterresizeapp2) {
cleartimeout(window.afterresizeapp2);
}
window.afterresizeapp2 = settimeout(function() {
_recalcw();
settimeout(function() {
_container.isotope('layout');
}, 300);
}, 300);
});
}
});
} /** end isotope **/
/** isotope blog
*********************** **/
var blog_isotope_container = jquery("#blog.blog-isotope");
if(blog_isotope_container.length > 0) {
loadscript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
// isotope blog
if(jquery().isotope) {
var _container = jquery('#blog');
// calculate item width on fullwidth blog
if(_container.hasclass('blog-isotope-2')) {
_cols = 2;
} else
if(_container.hasclass('blog-isotope-3')) {
_cols = 3;
} else
if(_container.hasclass('blog-isotope-4')) {
_cols = 4;
} else { _cols = 4; }
function _recalcw() {
_dw = jquery(document).width();
if(_container.hasclass('fullwidth')) { // fullwidth
_w = jquery(document).width();
_witem = (_w/_cols);
if(_dw < 760) {
_witem = (_w/2);
}
if(_dw < 480) {
_witem = jquery("#blog").width();
}
// apply item width
jquery("#blog>.blog-post-item").css({"width":_witem});
} else { // non fullwidth
_mr = parseint(jquery("#blog>.blog-post-item").css('margin-right'));
_w = jquery("#blog").closest('.container').width();
_witem = _w / _cols - _mr;
if(_dw < 760) {
_witem = (_w/2 - _mr);
}
if(_dw < 480) {
_witem = _w;
}
// apply item & container width
jquery("#blog.blog-isotope").css({"width":_w});
jquery("#blog>.blog-post-item").css({"width":_witem});
}
// resize flex slider if exists!
if(jquery('.flexslider').length > 0) {
jquery('.flexslider').resize();
}
} _recalcw();
jquery(window).load(function(){
var _t = settimeout(function(){
_container.isotope({
masonry: {},
filter: '*',
animationoptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
jquery('#blog_filter>li>a').bind("click", function(e){
e.preventdefault();
jquery('#blog_filter>li.active').removeclass('active');
jquery(this).parent('li').addclass('active');
var selector = jquery(this).attr('data-filter');
_container.isotope({
filter: selector,
animationoptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
});
}, 50 );
settimeout(function() {
_container.isotope('layout');
}, 300);
});
// on resize
jquery(window).resize(function() {
if(window.afterresizeapp2) {
cleartimeout(window.afterresizeapp2);
}
window.afterresizeapp2 = settimeout(function() {
_recalcw();
settimeout(function() {
_container.isotope('layout');
}, 300);
}, 300);
});
}
});
} /** end isotope **/
/** flip boxes
*********************** **/
if(jquery('.box-flip').length > 0) {
jquery('.box-flip').each(function() {
_height1 = jquery('.box1',this).outerheight();
_height2 = jquery('.box2',this).outerheight();
if(_height1 >= _height2) {
_height = _height1;
} else {
_height = _height2;
}
jquery(this).css({"min-height":_height+"px"});
jquery('.box1',this).css({"min-height":_height+"px"});
jquery('.box2',this).css({"min-height":_height+"px"});
});
jquery('.box-flip').hover(function() {
jquery(this).addclass('flip');
},function(){
jquery(this).removeclass('flip');
});
}
/** sticky side (social icons)
*********************** **/
if(jquery("div.sticky-side").length > 0) {
var _t = jquery("div.sticky-side");
_h = _t.height() / 2;
_t.css({"margin-top":"-"+_h+"px"});
}
/** increase / decrease no.
example: shop-single-left.html
*********************** **/
jquery(".incr").bind("click", function(e) {
e.preventdefault();
var _for = jquery(this).attr('data-for'),
_max = parseint(jquery(this).attr('data-max')),
_curval = parseint(jquery("#" + _for).val());
if(_curval < _max) {
jquery("#" + _for).val(_curval + 1);
}
});
jquery(".decr").bind("click", function(e) {
e.preventdefault();
var _for = jquery(this).attr('data-for'),
_min = parseint(jquery(this).attr('data-min')),
_curval = parseint(jquery("#" + _for).val());
if(_curval > _min) {
jquery("#" + _for).val(_curval - 1);
}
});
/** default button toggle
*********************** **/
jquery("a.toggle-default").bind("click", function(e) {
e.preventdefault();
var _href = jquery(this).attr('href');
if(jquery(_href).is(":hidden")) {
jquery(_href).slidetoggle(200);
jquery('i.fa', this).removeclass('fa-plus-square').addclass('fa-minus-square');
} else {
jquery(_href).slidetoggle(200);
jquery('i.fa', this).removeclass('fa-minus-square').addclass('fa-plus-square');
}
});
/** custom file upload
*********************** **/
var file_container = jquery("input[type=file]");
if(file_container.length > 0) {
loadscript(plugin_path + 'custom.fle_upload.js');
}
/** textarea words limit
*********************** **/
jquery("textarea.word-count").on('keyup', function() {
var _t = jquery(this),
words = this.value.match(/\s+/g).length,
_limit = _t.attr('data-maxlength') || 200;
if (words > parseint(_limit)) {
// split the string on first 200 words and rejoin on spaces
var trimmed = _t.val().split(/\s+/, 200).join(" ");
// add a space at the end to keep new typing making new words
_t.val(trimmed + " ");
} else {
var _data_info = _t.attr('data-info');
if(_data_info == '' || _data_info == undefined) {
var _infocontainer = _t.next('div');
jquery('span', _infocontainer).text(words + '/' + _limit);
} else {
jquery('#' +_data_info).text(words + '/' + _limit);
}
}
});
}
/** sticky footer
**************************************************************** **/
function _stickyfooter() {
if(jquery("#footer").hasclass('sticky')) {
var footerheight = 0,
footertop = 0,
_footer = jquery("#footer.sticky");
positionfooter();
function positionfooter() {
footerheight = _footer.height();
footertop = (jquery(window).scrolltop()+jquery(window).height()-footerheight)+"px";
if((jquery(document.body).height()+footerheight) > jquery(window).height()) {
_footer.css({
position: "absolute"
}).stop().animate({
top: footertop
},0);
} else {
_footer.css({position: "static"});
}
}
jquery(window).scroll(positionfooter).resize(positionfooter);
}
}
/** countdown
**************************************************************** **/
function _countdown() {
var _container = jquery(".countdown"),
_container2 = jquery(".countdown-download");
if(_container.length > 0 || _container2.length > 0) {
loadscript(plugin_path + 'countdown/jquery.countdown.pack.min.js', function() {
/** on page load **/
_container.each(function() {
var _t = jquery(this),
_date = _t.attr('data-from'),
_labels = _t.attr('data-labels');
if(_labels) {
_labels = _labels.split(",");
}
if(_date) {
var _d = new date(_date);
jquery(this).countdown({
until: new date(_d),
labels: _labels || ["years","months","weeks","days","hours","minutes","seconds"]
});
}
});
/** download **/
_container2.bind("click", function(e){
e.preventdefault();
var _t = jquery(this),
cd_container = _t.attr('data-for'),
_countdown = jquery("#"+cd_container+' span.download-wait>.countdown'),
_seconds = parseint(_t.attr('data-seconds')),
_dataurl = _t.attr('href');
_t.fadeout(250, function(){
jquery("#"+cd_container).fadein(250, function() {
var currentdate = new date();
currentdate.setseconds(currentdate.getseconds() + _seconds);
_countdown.countdown({
until: currentdate,
format: 's',
expiryurl: _dataurl,
onexpiry: function(){
jquery("#"+cd_container+' span.download-message').removeclass('hide');
jquery("#"+cd_container+' span.download-wait').addclass('hide');
}
});
});
});
return false;
});
});
}
}
/** masonry gallery
**************************************************************** **/
function _masonrygallery() {
if(jquery(".masonry-gallery").length > 0) {
jquery(".masonry-gallery").each(function() {
var _container = jquery(this),
columns = 4;
if(_container.hasclass('columns-2')) columns = 2;
else if(_container.hasclass('columns-3')) columns = 3;
else if(_container.hasclass('columns-4')) columns = 4;
else if(_container.hasclass('columns-5')) columns = 5;
else if(_container.hasclass('columns-6')) columns = 6;
var _firstelemwidth = _container.find('a:eq(0)').outerwidth(),
_bigimageno = _container.attr('data-img-big'),
_containerwidth = _container.width();
// fix margins & width
var postwidth = (_containerwidth/columns);
postwidth = math.floor(postwidth);
if((postwidth * columns) >= _containerwidth) {
_container.css({ 'margin-right': '-1px' });
}
if(columns < 6) {
_container.children('a').css({"width":postwidth+"px"});
}
// set big image
if(parseint(_bigimageno) > 0) {
_bigimageno = number(_bigimageno) - 1;
_container.find('a:eq('+_bigimageno+')').css({ width: _firstelemwidth*2 + 'px'});
loadscript(plugin_path + 'isotope/isotope.pkgd.min.js', function() {
settimeout( function() {
_container.isotope({
masonry: {
columnwidth: _firstelemwidth
}
});
_container.isotope('layout');
}, 1000);
});
}
});
}
}
/** toastr
type:
primary
info
error
sucess
warning
position
top-right
top-left
top-center
top-full-width
bottom-right
bottom-left
bottom-center
bottom-full-width
usage:
_toastr("my message here","top-right","error",false);
note:
_onclick = url to redirect (example: http://www.stepofweb.com)
**************************************************************** **/
function _toastr(_message,_position,_notifytype,_onclick) {
var _btn = jquery(".toastr-notify");
if(_btn.length > 0 || _message != false) {
loadscript(plugin_path + 'toastr/toastr.js', function() {
// toastr.clear();
/** button click
********************* **/
_btn.bind("click", function(e) {
e.preventdefault();
var _message = jquery(this).attr('data-message'),
_notifytype = jquery(this).attr('data-notifytype') || "default",
_position = jquery(this).attr('data-position') || "top-right",
_progressbar = jquery(this).attr('data-progressbar') == "true" ? true : false,
_closebutton = jquery(this).attr('data-closebutton') == "true" ? true : false,
_debug = jquery(this).attr('data-debug') == "true" ? true : false,
_newestontop = jquery(this).attr('data-newestontop') == "true" ? true : false,
_preventduplicates = jquery(this).attr('data-preventduplicates') == "true" ? true : false,
_showduration = jquery(this).attr('data-showduration') || "300",
_hideduration = jquery(this).attr('data-hideduration') || "1000",
_timeout = jquery(this).attr('data-timeout') || "5000",
_extendedtimeout = jquery(this).attr('data-extendedtimeout') || "1000",
_showeasing = jquery(this).attr('data-showeasing') || "swing",
_hideeasing = jquery(this).attr('data-hideeasing') || "linear",
_showmethod = jquery(this).attr('data-showmethod') || "fadein",
_hidemethod = jquery(this).attr('data-hidemethod') || "fadeout";
toastr.options = {
"closebutton": _closebutton,
"debug": _debug,
"newestontop": _newestontop,
"progressbar": _progressbar,
"positionclass": "toast-" + _position,
"preventduplicates": _preventduplicates,
"onclick": null,
"showduration": _showduration,
"hideduration": _hideduration,
"timeout": _timeout,
"extendedtimeout": _extendedtimeout,
"showeasing": _showeasing,
"hideeasing": _hideeasing,
"showmethod": _showmethod,
"hidemethod": _hidemethod
}
toastr[_notifytype](_message);
});
/** javscript / on load
************************* **/
if(_message != false) {
if(_onclick != false) {
onclick = function() {
window.location = _onclick;
}
} else {
onclick = null
}
toastr.options = {
"closebutton": true,
"debug": false,
"newestontop": false,
"progressbar": true,
"positionclass": "toast-" + _position,
"preventduplicates": false,
"onclick": onclick,
"showduration": "300",
"hideduration": "1000",
"timeout": "5000",
"extendedtimeout": "1000",
"showeasing": "swing",
"hideeasing": "linear",
"showmethod": "fadein",
"hidemethod": "fadeout"
}
settimeout(function(){
toastr[_notifytype](_message);
}, 1500); // delay 1.5s
}
});
}
}
/** chart
**************************************************************** **/
function _charts() {
/** easy pie chart
************************* **/
var _container = jquery(".piechart");
if(_container.length > 0) {
loadscript(plugin_path + 'chart.easypiechart/dist/jquery.easypiechart.min.js', function() {
jquery(".piechart").each(function() {
var _t = jquery(this),
_size = _t.attr('data-size') || 150,
_animate = _t.attr('data-animate') || "3000";
_t.easypiechart({
size: _size,
animate: _animate,
scalecolor: false,
trackcolor: _t.attr('data-trackcolor') || 'rgba(0,0,0,0.04)',
linewidth: _t.attr('data-width') || '2',
linecap: 'square',
barcolor: _t.attr('data-color') || '#0093bf'
});
jquery("span", this).attr('style', "line-height:"+_size+"px !important; height:"+_size+"px; width:"+_size+"px");
jquery("i", this).attr('style', "line-height:"+_size+"px !important; height:"+_size+"px; width:"+_size+"px");
// jquery("span", this).css({"line-height":_size+"px", "height":_size+"px", "width":_size+"px"});
// jquery("i", this).css({"line-height":_size+"px", "height":_size+"px", "width":_size+"px"});
});
});
}
}
/** select2
**************************************************************** **/
function _select2() {
var _container = jquery('select.select2');
if(_container.length > 0) {
loadscript(plugin_path + 'select2/js/select2.full.min.js', function() {
if(jquery().select2) {
jquery('select.select2').select2();
}
});
}
}
/** form [form plugin + validation plugin]
**************************************************************** **/
function _form() {
/** form validate
load plugin only!
************************ **/
if(jquery('form.validate-plugin').length > 0) {
loadscript(plugin_path + 'form.validate/jquery.form.min.js', function() {
loadscript(plugin_path + 'form.validate/jquery.validation.min.js');
});
}
/** form validate
************************ **/
if(jquery('form.validate').length > 0) {
loadscript(plugin_path + 'form.validate/jquery.form.min.js', function() {
loadscript(plugin_path + 'form.validate/jquery.validation.min.js', function() {
if(jquery().validate) {
jquery('form.validate').each(function() {
var _t = jquery(this),
_smessage = _t.attr('data-success') || "successfully! thank you!",
_cmessage = _t.attr('data-captcha') || "invalid captcha!",
_tposition = _t.attr('data-toastr-position') || "top-right",
_ttype = _t.attr('data-toastr-type') || "success";
_turl = _t.attr('data-toastr-url') || false;
// append 'is_ajax' hidden input field!
_t.append('
');
_t.validate({
submithandler: function(form) {
// show spin icon
jquery(form).find('.input-group-addon').find('.fa-envelope').removeclass('fa-envelope').addclass('fa-refresh fa-spin');
jquery(form).ajaxsubmit({
target: jquery(form).find('.validate-result').length > 0 ? jquery(form).find('.validate-result') : '',
error: function(data) {
_toastr("sent failed!",_tposition,"error",false);
},
success: function(data) {
var data = data.trim();
// smtp error
if(data == '_failed_') {
_toastr("smtp error! please, check your config file!",_tposition,"error",false);
}
// captcha error
else if(data == '_captcha_') {
_toastr("invalid captcha!",_tposition,"error",false);
// success
} else {
// remove spin icon
jquery(form).find('.input-group-addon').find('.fa-refresh').removeclass('fa-refresh fa-spin').addclass('fa-envelope');
// clear the form
jquery(form).find('input.form-control').val('');
// toastr message
_toastr(_smessage,_tposition,_ttype,_turl);
}
}
});
}
});
});
}
});
});
}
/** masked input
************************ **/
var _container = jquery('input.masked');
if(_container.length > 0) {
loadscript(plugin_path + 'form.masked/jquery.maskedinput.js', function() {
_container.each(function() {
var _t = jquery(this);
_format = _t.attr('data-format') || '(999) 999-999999',
_placeholder = _t.attr('data-placeholder') || 'x';
jquery.mask.definitions['f'] = "[a-fa-f0-9]";
_t.mask(_format, {placeholder:_placeholder});
});
});
}
}
/** pickers
**************************************************************** **/
function _pickers() {
/** date picker
******************* **/
var _container_1 = jquery('.datepicker');
if(_container_1.length > 0) {
loadscript(plugin_path + 'bootstrap.datepicker/js/bootstrap-datepicker.min.js', function() {
if(jquery().datepicker) {
_container_1.each(function() {
var _t = jquery(this),
_lang = _t.attr('data-lang') || 'en';
if(_lang != 'en' && _lang != '') { // load language file
loadscript(plugin_path + 'bootstrap.datepicker/locales/bootstrap-datepicker.'+_lang+'.min.js');
}
jquery(this).datepicker({
format: _t.attr('data-format') || 'yyyy-mm-dd',
language: _lang,
rtl: _t.attr('data-rtl') == "true" ? true : false,
changemonth: _t.attr('data-changemonth') == "false" ? false : true,
todaybtn: _t.attr('data-todaybtn') == "false" ? false : "linked",
calendarweeks: _t.attr('data-calendarweeks') == "false" ? false : true,
autoclose: _t.attr('data-autoclose') == "false" ? false : true,
todayhighlight: _t.attr('data-todayhighlight') == "false" ? false : true,
onrender: function(date) {
// return date.valueof() < nowdate.valueof() ? 'disabled' : '';
}
}).on('changedate', function(ev) {
// ajax post - optional
}).data('datepicker');
});
}
});
}
/** range picker
******************* **/
var _container_2 = jquery('.rangepicker');
if(_container_2.length > 0) {
loadscript(plugin_path + 'bootstrap.daterangepicker/moment.min.js', function() {
loadscript(plugin_path + 'bootstrap.daterangepicker/daterangepicker.js', function() {
if(jquery().datepicker) {
_container_2.each(function() {
var _t = jquery(this),
_format = _t.attr('data-format').touppercase() || 'yyyy-mm-dd';
_t.daterangepicker(
{
format: _format,
startdate: _t.attr('data-from'),
enddate: _t.attr('data-to'),
ranges: {
'today': [moment(), moment()],
'yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'last 7 days': [moment().subtract(6, 'days'), moment()],
'last 30 days': [moment().subtract(29, 'days'), moment()],
'this month': [moment().startof('month'), moment().endof('month')],
'last month': [moment().subtract(1, 'month').startof('month'), moment().subtract(1, 'month').endof('month')]
}
},
function(start, end, label) {
// alert("a new date range was chosen: " + start.format('yyyy-mm-dd') + ' to ' + end.format('yyyy-mm-dd'));
});
});
}
});
});
}
/** time picker
******************* **/
var _container_3 = jquery('.timepicker');
if(_container_3.length > 0) {
loadscript(plugin_path + 'timepicki/timepicki.min.js', function() {
if(jquery().timepicki) {
_container_3.timepicki();
}
});
}
/** color picker
******************* **/
var _container_4 = jquery('.colorpicker');
if(_container_4.length > 0) {
loadscript(plugin_path + 'spectrum/spectrum.min.js', function() {
if(jquery().spectrum) {
_container_4.each(function() {
var _t = jquery(this),
_preferredformat = _t.attr('data-format') || "hex", // hex, hex3, hsl, rgb, name
_palletteonly = _t.attr('data-palletteonly') || "false",
_fullpicker = _t.attr('data-fullpicker') || "false",
_allowempty = _t.attr('data-allowempty') || false;
_flat = _t.attr('data-flat') || false;
if(_palletteonly == "true" || _fullpicker == "true") {
var _palette = [
["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],
["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],
["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],
["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],
["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],
["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],
["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],
["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]
];
} else {
_palette = null;
}
if(_t.attr('data-defaultcolor')) {
_color = _t.attr('data-defaultcolor');
} else {
_color = "#ff0000";
}
if(!_t.attr('data-defaultcolor') && _allowempty == "true") {
_color = null;
}
_t.spectrum({
showpaletteonly: _palletteonly == "true" ? true : false,
togglepaletteonly: _palletteonly == "true" ? true : false,
flat: _flat == "true" ? true : false,
showinitial: _allowempty == "true" ? true : false,
showinput: _allowempty == "true" ? true : false,
allowempty: _allowempty == "true" ? true : false,
choosetext: _t.attr('data-choosetext') || "coose",
canceltext: _t.attr('data-canceltext') || "cancel",
color: _color,
showinput: true,
showpalette: true,
preferredformat: _preferredformat,
showalpha: _preferredformat == "rgb" ? true : false,
palette: _palette
});
});
}
});
}
}
/** editors
**************************************************************** **/
function _editors() {
/** summernote html editor
***************************** **/
var _container_1 = jquery('textarea.summernote');
if(_container_1.length > 0) {
loadscript(plugin_path + 'editor.summernote/summernote.min.js', function() {
if(jquery().summernote) {
_container_1.each(function() {
var _lang = jquery(this).attr('data-lang') || 'en-us';
if(_lang != 'en-us') { // language!
alert(_lang);
loadscript(plugin_path + 'editor.summernote/lang/summernote-'+_lang+'.js');
}
jquery(this).summernote({
height: jquery(this).attr('data-height') || 200,
lang: jquery(this).attr('data-lang') || 'en-us', // default: 'en-us'
toolbar: [
/* [groupname, [button list]] */
['style', ['style']],
['fontsize', ['fontsize']],
['style', ['bold', 'italic', 'underline','strikethrough', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['media', ['link', 'picture', 'video']],
['misc', ['codeview', 'fullscreen', 'help']]
]
});
});
}
});
}
/** markdown html editor
***************************** **/
var _container_2 = jquery('textarea.markdown');
if(_container_2.length > 0) {
loadscript(plugin_path + 'editor.markdown/js/bootstrap-markdown.min.js', function() {
if(jquery().markdown) {
_container_2.each(function() {
var _t = jquery(this);
var _lang = _t.attr('data-lang') || 'en';
if(_lang != 'en') { // language!
loadscript(plugin_path + 'editor.markdown/locale/bootstrap-markdown.'+_lang+'.js');
}
jquery(this).markdown({
autofocus: _t.attr('data-autofocus') == "true" ? true : false,
savable: _t.attr('data-savable') == "true" ? true : false,
height: _t.attr('data-height') || 'inherit',
language: _lang == 'en' ? null : _lang
});
});
}
});
}
}
/** pajinate [jquery pagination]
usage
**************************************************************** **/
function _pajinate() {
var _container = jquery('div.pajinate');
if(_container.length > 0) {
loadscript(plugin_path + 'pajinate/jquery.pajinate.bootstrap.min.js', function() {
if(jquery().pajinate) {
_container.each(function() {
var _t = jquery(this),
_perpage = _t.attr('data-pajinante-items-per-page') || 8;
_numlinks = _t.attr('data-pajinante-num-links') || 5;
_t.pajinate({
items_per_page : parseint(_perpage),
num_page_links_to_display : parseint(_numlinks),
item_container_id : _t.attr('data-pajinate-container') || '.pajinate-container',
nav_panel_id : '.pajinate-nav ul',
show_first_last : false,
wrap_around : true,
abort_on_small_lists : true,
start_page : 0,
nav_label_prev : '«',
nav_label_next : '»'
});
});
}
});
}
}
/** infininte scroll
**************************************************************** **/
function _infinitescroll() {
var _container = jquery(".infinite-scroll");
if(_container.length > 0) {
loadscript(plugin_path + 'infinite-scroll/jquery.infinitescroll.min.js', function() {
_navselector = _container.attr('data-nextselector') || "#inf-load-nex",
_itemselector = _container.attr('data-itemselector') || ".item",
_nextselector = _navselector + " a";
_container.infinitescroll({
loading: {
finishedmsg : '
',
msgtext : '
',
img : "data:image/gif;base64,r0lgodlhgaayapuaabqsfcwulbwahawkdkyurgxqbnze3cwqlcqmjls2tozu7oti5jyenbwehbqwfjyanpz+/hrydlsytfxexpz6/exotksmpfrsvhr2dawodaqcbozq7pty9ischpt29iykjiyojisghotm5grizjswljsslfrwvmtcxnza3exktnts1kyqrhx6fgrmzksipmzozmtgxdqyndw+paqgbdq2nercrfxaxmzkzgxubdw6pcqijly+vergrly6vhx+fntw1ch/c05fvfndqvbfmi4waweaaaah+qqjbqaaacwaaaaagaayaeagqecacahoraiojqjfiaii0kh0qoszohqhdmk9zadgai0wbmhaxahfvm5hbzr0atydsfpskwqjo5srlatpijxuuzzpecmgji1qa4jckh5lgvicdhfpgyoqgx4udwenfh4ikjcbir4mt1itljspjwkuno9uayhpbpaogjdpoy7excyaiqs9osupibfenzoqif9gy1epqlwilah+m4aqjmucobjjgz8eokjrqqah+qqjbqabacwaaaaagaayaaagp8cacbhorbildgdfkaii0khab5ruzbuwdalxmj5r4scmiwpoj67iem4tzx0upocub1jyir2tuxe3dnthe3ilglenchwdh0qdg3itjuq7cigtqxfybjgbgkcyghoypagdardyokchcjunhh8znqaccmcyjzgndpaqn2wdfxi+pwefch2znre+mdtbbzgmbqiphlwwlbcynsmglif2ai0wkaocbhi4uerbach5bakfacwalaaaaaayabgaaaaoqjzwyniejiajcpwicijqkfgd6gw8d4d0c3uqijskd1wsqsgfmldjguau6q1ja27eprg34x5fucaet3xdax5ubqamjyz8grxufirufaf3b24qkguye3cpmaubbil3i5ggkpgidwf/ea9tgan8jicmgqvuhlodqgkgeku9qgxugmncdqpgamgsf38rgs4ffx/tybuiectayaiphgohadi9drfktcaj5vjbach5bakfaaaalaaaaaayabgaaaa0qibwsaqmaphhovfsooezlselefqjdsnmcu1qljbw9zpquspjqwyycqgpbaiilyrbgidmagjraegreb4ce3wqfan0nhwryhwwdaanfbiqhlx0axwgcnx+kqv8cp0qbzeal3wbbnwbkregkgl8tgkadnwugra0dbkuhhmnhhardbqweaszaawqkhqiegqhqgibfdkrtruul4nbrc0qfjphrbcbem7nqg0ubi3g7q0rdxeyzfdbach5bakfaagalaaaaaayabgaaaaxqirwscwkhmwkssglczbqymnnugpmh6gqoiouzqqih6zfhdjv7qlclpuricutawkzvwubhyfwcowna28iox4cbxy3aimijrafemwosiwyeaqgbdwmqiwqbh4qkpxcjhyhbqqqebyzlkq1baarr4wokgwsiklvadd2bqiej4mdj3ycsa8ulfqwdibcagohbyr2c4tcjhwbztqueao5rquqzvahjuhdjjsnpfihkffg7ffbach5bakfaaaalaaaaqayabyaaaa3qibqmenlnmokcgmogscqejniy048uihhkqs1lclkftljclmmowazvunmgjmqiwrkdtykhibxarpiecude0mihg0rucv6hqaagxeseaszjkkvek8sl0kqkgoqcj1cgiikchunlwcqcigvpgcqkbkxpamlebi4ipaxgivqodoeb44dwhauagaugiuaeyhzdeinkr9ccddjg81cjpxmo2mupeojvvy6ubq2tdgeuyfqczkyjzk880nbach5bakfaaealaaaaaayabgaaaazwibwgabmohcncckuokokijtvrayqg6k2ywxikfptpes0gbwbxmfmhqwbwcjnjlcsywihq9qxk4uavaieeb1/tcanbranfodcexeeedspszujkcewszqghbicrbuchimiqywkc5wogjaoctkoatqubbetqdmneaunh6ghebqoat6ozbo+ugxcajf/mw0tn1ikeujuvtmfpsjhebepgohebzyj4si8ncxahb/gnboxisyatueaifkecquakgasaaaaabgagaaabqpalxcoerqsr4wblce6nq2xb0ktup5yk6lkhzywzgklyplskrfwseldya6ddci1oaifgg2ealirhxafgn5gdr4rg4rpghebdopyaqkdkfgjbnavtieoizpdcqmfrbooikndbwyjqeidcqgtdgofnpoaeh4nqbogea+odisqjn4xexuiaamilciqfbv+jmnuhh7veawemf1vcmmelt4udakqgsuocy8wi+dpqqah+qqjbqajacwaaaaagaayaaagrmcecjhorcqoxublmmsi0kga4yfyr9bfiuqsblbgk4erlfaoseiuesi8sbkyifkqrtwxk+el4zyulgnkqhkazbyshooloigai5are5cqdzouixgyi3abxanpnle5olyapuqzd6helaesdgynrakzei5kmwoknxybs1eikh4wf5dqnsoqf2qswc8fato0gdcuhi2dbgfggymlbwvcebqpdpqzni4qgxsoejgcxeeaifkebquacaasaaaaabgagaaabqzahhciebqibg/hick4inch4ogbwk9wtgkqhzoulfmjwykpsjcfrbvhhj7qggqrga9tr0bx6hhhtuqno3z7adbwfadeiqj7uamrjtreajyol0mnmjucnz6fokgio6sdmqqphdlja5wciuqbvrawxjcao6dcjlg3tl0bpxdqagpykdvrah8cof05c2g/jsw+jtaecsofjrxovx4pjzgorygchcgetl1bads=",
speed : 'normal'
},
nextselector : _nextselector,
navselector : _navselector,
itemselector : _itemselector,
behavior : '',
state: {
isdone : false
}
},
function(newelements) {
init(true);
if(jquery().isotope) {
_container.isotope('appended', jquery(newelements));
settimeout( function(){
_container.isotope('layout');
}, 2000);
}
});
});
}
}
/** image zoom
**************************************************************** **/
function _zoom() {
var _container = jquery('figure.zoom');
if(_container.length > 0) {
loadscript(plugin_path + 'image.zoom/jquery.zoom.min.js', function() {
if(jquery().zoom) {
_container.each(function() {
var _t = jquery(this),
_mode = _t.attr('data-mode'),
_id = _t.attr('id');
if(_mode == 'grab') {
_t.zoom({ on:'grab' });
} else
if(_mode == 'click') {
_t.zoom({ on:'click' });
} else
if(_mode == 'toggle') {
_t.zoom({ on:'toggle' });
} else {
_t.zoom();
}
// thumbnails
if(_id) {
jquery('.zoom-more[data-for='+_id+'] a').bind("click", function(e) {
e.preventdefault();
var _href = jquery(this).attr('href');
if(_href != "#") {
jquery('.zoom-more[data-for='+_id+'] a').removeclass('active');
jquery(this).addclass('active');
jquery('figure#'+_id + '>.lightbox').attr('href', _href);
jquery('figure#'+_id + '>img').fadeout(0, function() {
jquery('figure#'+_id + '>img').attr('src', _href);
}).fadein(500);
}
});
}
});
}
});
}
}
/** autosuggest
http://twitter.github.io/typeahead.js/
**************************************************************** **/
function _autosuggest() {
_container = jquery('div.autosuggest');
if(_container.length > 0) {
loadscript(plugin_path + 'typeahead.bundle.js', function() {
if(jquery().typeahead) {
_container.each(function() {
var _t = jquery(this),
_minlength = _t.attr('data-minlength') || 1,
_qryurl = _t.attr('data-queryurl'),
_limit = _t.attr('data-limit') || 10,
_autoload = _t.attr('data-autoload');
if(_autoload == "false") {
return false;
}
/** **/
/* bloodhound (suggestion engine) */
var _typeahead = new bloodhound({
datumtokenizer: bloodhound.tokenizers.obj.whitespace('value'),
querytokenizer: bloodhound.tokenizers.whitespace,
limit: _limit,
remote: {
url: _qryurl + '%query',
},
});
jquery('.typeahead', _t).typeahead({
limit: _limit,
hint: _t.attr('data-hint') == "false" ? false : true,
highlight: _t.attr('data-highlight') == "false" ? false : true,
minlength: parseint(_minlength),
cache: false,
},
{
name: '_typeahead',
source: _typeahead
});
/** **/
});
}
});
}
}
/** form stepper
**************************************************************** **/
function _stepper() {
var _container = jquery('input.stepper');
if(_container.length > 0) {
loadscript(plugin_path + 'form.stepper/jquery.stepper.min.js', function() {
if(jquery().stepper) {
jquery(_container).each(function() {
var _t = jquery(this),
_min = _t.attr('min') || null,
_max = _t.attr('max') || null;
_t.stepper({
limit: [_min,_max],
floatprecission: _t.attr('data-floatprecission') || 2,
wheel_step: _t.attr('data-wheelstep') || 0.1,
arrow_step: _t.attr('data-arrowstep') || 0.2,
allowwheel: _t.attr('data-mousescrool') == "false" ? false : true,
ui: _t.attr('data-ui') == "false" ? false : true,
// --
type: _t.attr('data-type') || "float",
preventwheelacceleration: _t.attr('data-preventwheelacceleration') == "false" ? false : true,
incrementbutton: _t.attr('data-incrementbutton') || "▴",
decrementbutton: _t.attr('data-decrementbutton') || "▾",
onstep: null,
onwheel: null,
onarrow: null,
onbutton: null,
onkeyup: null
});
});
}
});
}
}
/** slimscroll
**************************************************************** **/
function _slimscroll() {
var _container = jquery('.slimscroll');
if(_container.length > 0) {
loadscript(plugin_path + 'slimscroll/jquery.slimscroll.min.js', function() {
if(jquery().slimscroll) {
jquery('.slimscroll').each(function () {
var height;
if (jquery(this).attr("data-height")) {
height = jquery(this).attr("data-height");
} else {
height = jquery(this).height();
}
jquery(this).slimscroll({
size: jquery(this).attr("data-size") || '5px',
opacity: jquery(this).attr("data-opacity") || .6,
position: jquery(this).attr("data-position") || 'right',
allowpagescroll: false, // not working
disablefadeout: false,
railvisible: true,
railcolor: jquery(this).attr("data-railcolor") || '#222',
railopacity: jquery(this).attr("data-railopacity") || 0.05,
alwaysvisible: (jquery(this).attr("data-alwaysvisible") != "false" ? true : false),
railvisible: (jquery(this).attr("data-railvisible") != "false" ? true : false),
color: jquery(this).attr("data-color") || '#333',
wrapperclass: jquery(this).attr("data-wrapper-class") || 'slimscrolldiv',
railcolor: jquery(this).attr("data-railcolor") || '#eaeaea',
height: height
});
// disable body scroll on slimscroll hover
if(jquery(this).attr('disable-body-scroll') == 'true') {
jquery(this).bind('mousewheel dommousescroll', function(e) {
var scrollto = null;
if (e.type == 'mousewheel') {
scrollto = (e.originalevent.wheeldelta * -1);
}
else if (e.type == 'dommousescroll') {
scrollto = 40 * e.originalevent.detail;
}
if (scrollto) {
e.preventdefault();
jquery(this).scrolltop(scrollto + jquery(this).scrolltop());
}
});
}
});
}
});
}
}
/** modal autoload
usage:
...
**************************************************************** **/
function _modalautoload() {
if(jquery("div.modal").length > 0) {
jquery("div.modal").each(function() {
var _t = jquery(this),
_id = _t.attr('id'),
_autostart = _t.attr('data-autoload') || false;
// reset allow
// localstorage.removeitem(_id);
if(_id != '') { // rewrite if set to hidden by the user
if(localstorage.getitem(_id) == 'hidden') {
_autostart = 'false';
}
}
if(_autostart == 'true') {
jquery(window).load(function() { // required on load!
var _delay = _t.attr('data-autoload-delay') || 1000; // delay when modal apprear
settimeout(
function() {
_t.modal('toggle');
}, parseint(_delay));
});
}
// local storage - do not hide on next page load!
jquery("input.loadmodalhide", this).bind("click", function() {
var _tt = jquery(this);
if(_tt.is(":checked")) {
localstorage.setitem(_id, 'hidden');
console.log('[modal autoload #'+_id+'] added to localstorage');
} else {
localstorage.removeitem(_id);
console.log('[modal autoload #'+_id+'] removed from localstorage');
}
});
});
}
}
/** 10. background image
class="boxed" should be added to body.
add to body - example: data-background="assets/images/boxed_background/1.jpg"
**************************************************************** **/
function _bgimage() {
var data_background = jquery('body').attr('data-background') || '';
if(data_background != '') {
loadscript(plugin_path + 'jquery.backstretch.min.js', function() {
if(data_background) {
jquery.backstretch(data_background);
jquery('body').addclass('transparent'); // remove backround color of boxed class
}
});
}
}
/** flickr widget
**************************************************************** **/
function _widget_flickr() {
var _container = jquery('.widget-flickr');
if(_container.length > 0) {
loadscript(plugin_path + 'widget.jflickr/jflickrfeed.min.js', function() {
if(jquery().jflickrfeed) {
if(jquery('.widget-flickr')) {
/** **/
_container.each(function() {
var _t = jquery(this),
_id = _t.attr('data-id'),
_limit = _t.attr('data-limit') || 14;
_t.jflickrfeed({
limit: parseint(_limit),
qstrings: {
id: _id
},
itemtemplate: '
'+
'' +
'' +
'' +
''
}, function(data) {
_lightbox();
});
});
/** **/
}
}
});
}
}
/** twitter widget
**************************************************************** **/
function _widget_twitter() {
var _container = jquery(".widget-twitter");
if(_container.length > 0) {
loadscript(plugin_path + 'widget.twittie/twittie.min.js', function() {
if(jquery().twittie) {
// jquery('.example1 .tweet').twittie({
// dateformat: '%b. %d, %y',
// template: '{{tweet}}
{{date}}
',
// count: 1,
// loadingtext: 'loading!'
// });
_container.each(function() {
var _t = jquery(this),
_php = _t.attr('data-php'), // php script path
_usr = _t.attr('data-username'), // twitter username
_lmt = _t.attr('data-limit') || 3, // tweets limit
_url = _php + "?username=" + _usr + "&limit=" + _lmt;
jquery.getjson(_url, function(tweets){
_t.html(format_twitter(tweets));
});
});
}
});
}
}
function format_twitter(twitt) {
var statushtml = [];
for(var i=0; i
]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
return ''+url+'';
}).replace(/\b@([_a-z0-9]+)/ig, function(reply) {
return reply.charat(0)+''+reply.substring(1)+'';
});
statushtml.push(''+status+''+relative_time(twitt[i].created_at)+'');
}
return statushtml.join('');
}
function relative_time(time_value) {
var values = time_value.split(" "),
parsed_date = date.parse(time_value),
relative_to = (arguments.length > 1) ? arguments[1] : new date(),
delta = parseint((relative_to.gettime() - parsed_date) / 1000);
time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
delta = delta + (relative_to.gettimezoneoffset() * 60);
if (delta < 60) {
return 'less than a minute ago';
} else if(delta < 120) {
return 'about a minute ago';
} else if(delta < (60*60)) {
return (parseint(delta / 60)).tostring() + ' minutes ago';
} else if(delta < (120*60)) {
return 'about an hour ago';
} else if(delta < (24*60*60)) {
return 'about ' + (parseint(delta / 3600)).tostring() + ' hours ago';
} else if(delta < (48*60*60)) {
return '1 day ago';
} else {
return (parseint(delta / 86400)).tostring() + ' days ago';
}
}
/** facebook widget
**************************************************************** **/
function _widget_facebook() {
/** like & share button
************************ **/
var _container_1 = jquery('div.fb-like');
var _container_2 = jquery('div.fb-share-button');
if(_container_1.length > 0 || _container_2.length > 0) {
jquery('body').append('');
(function(d, s, id) {
var js, fjs = d.getelementsbytagname(s)[0];
if (d.getelementbyid(id)) return;
js = d.createelement(s); js.id = id;
js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.3";
fjs.parentnode.insertbefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
}
/** dribbble widget
**************************************************************** **/
function _widget_dribbble() {
var _container = jquery(".widget-dribbble");
if(_container.length > 0) {
loadscript(plugin_path + 'widget.dribbble/jribbble.min.js', function() {
var _token = _container.attr('data-token') || 'f688ac519289f19ce5cebc1383c15ad5c02bd58205cd83c86cbb0ce09170c1b4', // demo default
_target = _container.attr('data-target') || '_blank',
_shots = _container.attr('data-shots') || 2046896; // demo default
jquery.jribbble.settoken(_token);
jquery.jribbble.shots(_shots).rebounds().then(function(res) {
var html = [];
res.foreach(function(shot) {
html.push('');
html.push('');
html.push('');
html.push('');
});
_container.html(html.join(''));
});
});
}
}
/** media widget [mediaelement plugin]
**************************************************************** **/
function _widget_media() {
var _container = jquery(".widget-media");
if(_container.length > 0) {
loadscript(plugin_path + 'widget.mediaelementbuild/mediaelement-and-player.min.js', function() {
});
}
}
/** **************************************************************************************************************** **/
/** **************************************************************************************************************** **/
/** **************************************************************************************************************** **/
/** **************************************************************************************************************** **/
// scroll
function wheel(e) {
e.preventdefault();
}
function disable_scroll() {
if (window.addeventlistener) {
window.addeventlistener('dommousescroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = wheel;
}
function enable_scroll() {
if (window.removeeventlistener) {
window.removeeventlistener('dommousescroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = document.onkeydown = null;
}
// overlay
function enable_overlay() {
jquery("span.global-overlay").remove(); // remove first!
jquery('body').append('');
}
function disable_overlay() {
jquery("span.global-overlay").remove();
}
/** count to
https://github.com/mhuggins/jquery-countto
**************************************************************** **/
(function ($) {
$.fn.countto = function (options) {
options = options || {};
return jquery(this).each(function () {
// set options for current element
var settings = jquery.extend({}, $.fn.countto.defaults, {
from: jquery(this).data('from'),
to: jquery(this).data('to'),
speed: jquery(this).data('speed'),
refreshinterval: jquery(this).data('refresh-interval'),
decimals: jquery(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 = jquery(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);
// __construct 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.html(formattedvalue);
}
});
};
$.fn.countto.defaults = {
from: 0, // the number the element should start at
to: 0, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshinterval: 100, // how often the element should be updated
decimals: 0, // the number of decimal places to show
formatter: formatter, // handler for formatting the value before rendering
onupdate: null, // callback method for every time the element is updated
oncomplete: null // callback method for when the element finishes updating
};
function formatter(value, settings) {
return value.tofixed(settings.decimals);
}
}(jquery));
/** browser detect
add browser to html class
**************************************************************** **/
(function($) {
$.extend({
browserdetect: function() {
var u = navigator.useragent,
ua = u.tolowercase(),
is = function (t) {
return ua.indexof(t) > -1;
},
g = 'gecko',
w = 'webkit',
s = 'safari',
o = 'opera',
h = document.documentelement,
b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + parsefloat(navigator.appversion.split("msie")[1])) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + regexp.jquery1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + regexp.jquery2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + regexp.jquery1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js'];
c = b.join(' ');
h.classname += ' ' + c;
var isie11 = !(window.activexobject) && "activexobject" in window;
if(isie11) {
jquery('html').removeclass('gecko').addclass('ie ie11');
return;
}
}
});
})(jquery);
/** appear
https://github.com/bas2k/jquery.appear/
**************************************************************** **/
(function(a){a.fn.appear=function(d,b){var c=a.extend({data:undefined,one:true,accx:0,accy:0},b);return this.each(function(){var g=a(this);g.appeared=false;if(!d){g.trigger("appear",c.data);return}var f=a(window);var e=function(){if(!g.is(":visible")){g.appeared=false;return}var r=f.scrollleft();var q=f.scrolltop();var l=g.offset();var s=l.left;var p=l.top;var i=c.accx;var t=c.accy;var k=g.height();var j=f.height();var n=g.width();var m=f.width();if(p+k+t>=q&&p<=q+j+t&&s+n+i>=r&&s<=r+m+i){if(!g.appeared){g.trigger("appear",c.data)}}else{g.appeared=false}};var h=function(){g.appeared=true;if(c.one){f.unbind("scroll",e);var j=a.inarray(e,a.fn.appear.checks);if(j>=0){a.fn.appear.checks.splice(j,1)}}d.apply(this,arguments)};if(c.one){g.one("appear",c.data,h)}else{g.bind("appear",c.data,h)}f.scroll(e);a.fn.appear.checks.push(e);(e)()})};a.extend(a.fn.appear,{checks:[],timeout:null,checkall:function(){var b=a.fn.appear.checks.length;if(b>0){while(b--){(a.fn.appear.checks[b])()}}},run:function(){if(a.fn.appear.timeout){cleartimeout(a.fn.appear.timeout)}a.fn.appear.timeout=settimeout(a.fn.appear.checkall,20)}});a.each(["append","prepend","after","before","attr","removeattr","addclass","removeclass","toggleclass","remove","css","show","hide"],function(c,d){var b=a.fn[d];if(b){a.fn[d]=function(){var e=b.apply(this,arguments);a.fn.appear.run();return e}}})})(jquery);
/** parallax
http://www.ianlunn.co.uk/plugins/jquery-parallax/
**************************************************************** **/
(function(a){var b=a(window);var c=b.height();b.resize(function(){c=b.height()});a.fn.parallax=function(e,d,g){var i=a(this);var j;var h;var f=0;function k(){i.each(function(){h=i.offset().top});if(g){j=function(m){return m.outerheight(true)}}else{j=function(m){return m.height()}}if(arguments.length<1||e===null){e="50%"}if(arguments.length<2||d===null){d=0.5}if(arguments.length<3||g===null){g=true}var l=b.scrolltop();i.each(function(){var n=a(this);var o=n.offset().top;var m=j(n);if(o+ml+c){return}i.css("backgroundposition",e+" "+math.round((h-l)*d)+"px")})}b.bind("scroll",k).resize(k);k()}})(jquery);
/** jquery easing v1.3
http://gsgd.co.uk/sandbox/jquery/easing/
**************************************************************** **/
jquery.easing.jswing=jquery.easing.swing;jquery.extend(jquery.easing,{def:"easeoutquad",swing:function(e,f,a,h,g){return jquery.easing[jquery.easing.def](e,f,a,h,g)},easeinquad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeoutquad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeinoutquad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeincubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeoutcubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeinoutcubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeinquart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeoutquart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeinoutquart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeinquint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeoutquint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeinoutquint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeinsine:function(e,f,a,h,g){return -h*math.cos(f/g*(math.pi/2))+h+a},easeoutsine:function(e,f,a,h,g){return h*math.sin(f/g*(math.pi/2))+a},easeinoutsine:function(e,f,a,h,g){return -h/2*(math.cos(math.pi*f/g)-1)+a},easeinexpo:function(e,f,a,h,g){return(f==0)?a:h*math.pow(2,10*(f/g-1))+a},easeoutexpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-math.pow(2,-10*f/g)+1)+a},easeinoutexpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*math.pow(2,10*(f-1))+a}return h/2*(-math.pow(2,-10*--f)+2)+a},easeincirc:function(e,f,a,h,g){return -h*(math.sqrt(1-(f/=g)*f)-1)+a},easeoutcirc:function(e,f,a,h,g){return h*math.sqrt(1-(f=f/g-1)*f)+a},easeinoutcirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(math.sqrt(1-f*f)-1)+a}return h/2*(math.sqrt(1-(f-=2)*f)+1)+a},easeinelastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(gb;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.ismobile=function(a){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(a)},a.prototype.addevent=function(a,b,c){return null!=a.addeventlistener?a.addeventlistener(b,c,!1):null!=a.attachevent?a.attachevent("on"+b,c):a[b]=c},a.prototype.removeevent=function(a,b,c){return null!=a.removeeventlistener?a.removeeventlistener(b,c,!1):null!=a.detachevent?a.detachevent("on"+b,c):delete a[b]},a.prototype.innerheight=function(){return"innerheight"in window?window.innerheight:document.documentelement.clientheight},a}(),c=this.weakmap||this.mozweakmap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.mutationobserver||this.webkitmutationobserver||this.mozmutationobserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("mutationobserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("wow.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notsupported=!0,a.prototype.observe=function(){},a}()),d=this.getcomputedstyle||function(a){return this.getpropertyvalue=function(b){var c;return"float"===b&&(b="stylefloat"),e.test(b)&&b.replace(e,function(a,b){return b.touppercase()}),(null!=(c=a.currentstyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.wow=function(){function e(a){null==a&&(a={}),this.scrollcallback=f(this.scrollcallback,this),this.scrollhandler=f(this.scrollhandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationnamecache=new c}return e.prototype.defaults={boxclass:"wow",animateclass:"animated",offset:0,mobile:!0,live:!0,callback:null},e.prototype.init=function(){var a;return this.element=window.document.documentelement,"interactive"===(a=document.readystate)||"complete"===a?this.start():this.util().addevent(document,"domcontentloaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.queryselectorall("."+this.config.boxclass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetstyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applystyle(b,!0);return this.disabled()||(this.util().addevent(window,"scroll",this.scrollhandler),this.util().addevent(window,"resize",this.scrollhandler),this.interval=setinterval(this.scrollcallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addednodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.dosync(c));return f}.call(a));return g}}(this)).observe(document.body,{childlist:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeevent(window,"scroll",this.scrollhandler),this.util().removeevent(window,"resize",this.scrollhandler),null!=this.interval?clearinterval(this.interval):void 0},e.prototype.sync=function(){return a.notsupported?this.dosync(this.element):void 0},e.prototype.dosync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodetype){for(a=a.parentnode||a,e=a.queryselectorall("."+this.config.boxclass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetstyle():this.applystyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applystyle(a),a.classname=""+a.classname+" "+this.config.animateclass,null!=this.config.callback?this.config.callback(a):void 0},e.prototype.applystyle=function(a,b){var c,d,e;return d=a.getattribute("data-wow-duration"),c=a.getattribute("data-wow-delay"),e=a.getattribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customstyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestanimationframe"in window?function(a){return window.requestanimationframe(a)}:function(a){return a()}}(),e.prototype.resetstyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customstyle=function(a,b,c,d,e){return b&&this.cacheanimationname(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorset(a.style,{animationduration:c}),d&&this.vendorset(a.style,{animationdelay:d}),e&&this.vendorset(a.style,{animationiterationcount:e}),this.vendorset(a.style,{animationname:b?"none":this.cachedanimationname(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorset=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charat(0).touppercase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorcss=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getpropertycssvalue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getpropertycssvalue("-"+f+"-"+b);return c},e.prototype.animationname=function(a){var b;try{b=this.vendorcss(a,"animation-name").csstext}catch(c){b=d(a).getpropertyvalue("animation-name")}return"none"===b?"":b},e.prototype.cacheanimationname=function(a){return this.animationnamecache.set(a,this.animationname(a))},e.prototype.cachedanimationname=function(a){return this.animationnamecache.get(a)},e.prototype.scrollhandler=function(){return this.scrolled=!0},e.prototype.scrollcallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isvisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsettop=function(a){for(var b;void 0===a.offsettop;)a=a.parentnode;for(b=a.offsettop;a=a.offsetparent;)b+=a.offsettop;return b},e.prototype.isvisible=function(a){var b,c,d,e,f;return c=a.getattribute("data-wow-offset")||this.config.offset,f=window.pageyoffset,e=f+math.min(this.element.clientheight,this.util().innerheight())-c,d=this.offsettop(a),b=d+a.clientheight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().ismobile(navigator.useragent)},e}()}).call(this);
/** modernizr 2.7.1
http://modernizr.com/download/#-csstransforms3d-csstransitions-video-touch-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
**************************************************************** **/
;window.modernizr=function(a,b,c){function a(a){j.csstext=a}function b(a,b){return a(m.join(a+";")+(b||""))}function c(a,b){return typeof a===b}function d(a,b){return!!~(""+a).indexof(b)}function e(a,b){for(var d in a){var e=a[d];if(!d(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function f(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:c(f,"function")?f.bind(d||b):f}return!1}function g(a,b,c){var d=a.charat(0).touppercase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return c(b,"string")||c(b,"undefined")?e(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),f(e,b,c))}var d="2.7.1",e={},f=!0,g=b.documentelement,h="modernizr",i=b.createelement(h),j=i.style,k,l={}.tostring,m=" -webkit- -moz- -o- -ms- ".split(" "),n="webkit moz o ms",o=n.split(" "),p=n.tolowercase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createelement("div"),m=b.body,n=m||b.createelement("body");if(parseint(d,10))while(d--)j=b.createelement("div"),j.id=e?e[d]:h+(d+1),l.appendchild(j);return f=["",'"].join(""),l.id=h,(m?l:n).innerhtml+=f,n.appendchild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendchild(n)),i=c(l,a),m?l.parentnode.removechild(l):(n.parentnode.removechild(n),g.style.overflow=k),!!i},x=function(){function d(d,e){e=e||b.createelement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setattribute||(e=b.createelement("div")),e.setattribute&&e.removeattribute&&(e.setattribute(d,""),f=c(e[d],"function"),c(e[d],"undefined")||(e[d]=c),e.removeattribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y={}.hasownproperty,z;!c(y,"undefined")&&!c(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&c(a.constructor.prototype[b],"undefined")},function.prototype.bind||(function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new typeerror;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.documenttouch&&b instanceof documenttouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsettop===9}),c},q.csstransforms3d=function(){var a=!!g("perspective");return a&&"webkitperspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetleft===9&&b.offsetheight===3}),a},q.csstransitions=function(){return g("transition")},q.video=function(){var a=b.createelement("video"),c=!1;try{if(c=!!a.canplaytype)c=new boolean(c),c.ogg=a.canplaytype('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canplaytype('video/mp4; codecs="avc1.42e01e"').replace(/^no$/,""),c.webm=a.canplaytype('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c};for(var h in q)z(q,h)&&(v=h.tolowercase(),e[v]=q[h](),t.push((e[v]?"":"no-")+v));return e.addtest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addtest(d,a[d]);else{a=a.tolowercase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.classname+=" "+(b?"":"no-")+a),e[a]=b}return e},a(""),i=k=null,function(a,b){function l(a,b){var c=a.createelement("p"),d=a.getelementsbytagname("head")[0]||a.documentelement;return c.innerhtml="x",d.insertbefore(c.lastchild,d.firstchild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createelement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].clonenode():f.test(a)?g=(d.cache[a]=d.createelem(a)).clonenode():g=d.createelem(a),g.canhavechildren&&!e.test(a)&&!g.tagurn?d.frag.appendchild(g):g}function p(a,c){a||(a=b);if(k)return a.createdocumentfragment();c=c||n(a);var d=c.frag.clonenode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childnodes.length==1||function(){b.createelement("a");var a=b.createdocumentfragment();return typeof a.clonenode=="undefined"||typeof a.createdocumentfragment=="undefined"||typeof a.createelement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivcss:d.shivcss!==!1,supportsunknownelements:k,shivmethods:d.shivmethods!==!1,type:"default",shivdocument:r,createelement:o,createdocumentfragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domprefixes=p,e._cssomprefixes=o,e.hasevent=x,e.testprop=function(a){return e([a])},e.testallprops=g,e.teststyles=w,e.prefixed=function(a,b,c){return b?g(a,b,c):g(a,"pfx")},g.classname=g.classname.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?b.injectcss:b.injectjs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readystate)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removechild(l)},50);for(var d in y[c])y[c].hasownproperty(d)&&y[c][d].onload()}}var j=j||b.errortimeout,l=b.createelement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertbefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=b;return a.loader={load:j,i:0},a}var l=b.documentelement,m=a.settimeout,n=b.getelementsbytagname("script")[0],o={}.tostring,p=[],q=0,r="mozappearance"in l.style,s=r&&!!b.createrange().comparenode,t=s?l:n.parentnode,l=a.opera&&"[object opera]"==o.call(a.opera),l=!!b.attachevent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=array.isarray||function(a){return"[object array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},a,b;b=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origurl:c,prefixes:a},e,f,g;for(f=0;f