| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556 |
- !function ($) {
- "use strict"; // jshint ;_;
- /* MODAL CLASS DEFINITION
- * ====================== */
- var Modal = function (element, options) {
- this.options = options
- this.$element = $(element)
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
- }
- Modal.prototype = {
- constructor: Modal
- , toggle: function () {
- return this[!this.isShown ? 'show' : 'hide']()
- }
- , show: function () {
- var that = this
- , e = $.Event('show')
- this.$element.trigger(e)
- if (this.isShown || e.isDefaultPrevented()) return
- this.isShown = true
- this.escape()
- this.backdrop(function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
- if (!that.$element.parent().length) {
- that.$element.appendTo(document.body) //don't move modals dom position
- }
- that.$element.show()
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
- that.$element
- .addClass('in')
- .attr('aria-hidden', false)
- that.enforceFocus()
- transition ?
- that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
- that.$element.focus().trigger('shown')
- })
- }
- , hide: function (e) {
- e && e.preventDefault()
- var that = this
- e = $.Event('hide')
- this.$element.trigger(e)
- if (!this.isShown || e.isDefaultPrevented()) return
- this.isShown = false
- this.escape()
- $(document).off('focusin.modal')
- this.$element
- .removeClass('in')
- .attr('aria-hidden', true)
- $.support.transition && this.$element.hasClass('fade') ?
- this.hideWithTransition() :
- this.hideModal()
- }
- , enforceFocus: function () {
- var that = this
- $(document).on('focusin.modal', function (e) {
- if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
- that.$element.focus()
- }
- })
- }
- , escape: function () {
- var that = this
- if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.modal', function ( e ) {
- e.which == 27 && that.hide()
- })
- } else if (!this.isShown) {
- this.$element.off('keyup.dismiss.modal')
- }
- }
- , hideWithTransition: function () {
- var that = this
- , timeout = setTimeout(function () {
- that.$element.off($.support.transition.end)
- that.hideModal()
- }, 500)
- this.$element.one($.support.transition.end, function () {
- clearTimeout(timeout)
- that.hideModal()
- })
- }
- , hideModal: function () {
- var that = this
- this.$element.hide()
- this.backdrop(function () {
- that.removeBackdrop()
- that.$element.trigger('hidden')
- })
- }
- , removeBackdrop: function () {
- this.$backdrop && this.$backdrop.remove()
- this.$backdrop = null
- }
- , backdrop: function (callback) {
- var that = this
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
- .appendTo(document.body)
- this.$backdrop.click(
- this.options.backdrop == 'static' ?
- $.proxy(this.$element[0].focus, this.$element[0])
- : $.proxy(this.hide, this)
- )
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
- this.$backdrop.addClass('in')
- if (!callback) return
- doAnimate ?
- this.$backdrop.one($.support.transition.end, callback) :
- callback()
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
- $.support.transition && this.$element.hasClass('fade')?
- this.$backdrop.one($.support.transition.end, callback) :
- callback()
- } else if (callback) {
- callback()
- }
- }
- }
- /* MODAL PLUGIN DEFINITION
- * ======================= */
- var old = $.fn.modal
- $.fn.modal = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('modal')
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
- if (!data) $this.data('modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
- })
- }
- $.fn.modal.defaults = {
- backdrop: true
- , keyboard: true
- , show: true
- }
- $.fn.modal.Constructor = Modal
- /* MODAL NO CONFLICT
- * ================= */
- $.fn.modal.noConflict = function () {
- $.fn.modal = old
- return this
- }
- /* MODAL DATA-API
- * ============== */
- $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
- var $this = $(this)
- , href = $this.attr('href')
- , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
- e.preventDefault()
- $target
- .modal(option)
- .one('hide', function () {
- $this.focus()
- })
- })
- }(window.jQuery);
- !function ( $ ) {
- "use strict"
- /* SCROLLSPY CLASS DEFINITION
- * ========================== */
- function ScrollSpy( element, options) {
- var process = $.proxy(this.process, this)
- , $element = $(element).is('body') ? $(window) : $(element)
- , href
- this.options = $.extend({}, $.fn.scrollspy.defaults, options)
- this.$scrollElement = $element.on('scroll.scroll.data-api', process)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.$body = $('body').on('click.scroll.data-api', this.selector, process)
- this.refresh()
- this.process()
- }
- ScrollSpy.prototype = {
- constructor: ScrollSpy
- , refresh: function () {
- this.targets = this.$body
- .find(this.selector)
- .map(function () {
- var href = $(this).attr('href')
- return /^#\w/.test(href) && $(href).length ? href : null
- })
- this.offsets = $.map(this.targets, function (id) {
- return $(id).position().top
- })
- }
- , process: function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- , offsets = this.offsets
- , targets = this.targets
- , activeTarget = this.activeTarget
- , i
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
- }
- , activate: function (target) {
- var active
- this.activeTarget = target
- this.$body
- .find(this.selector).parent('.active')
- .removeClass('active')
- active = this.$body
- .find(this.selector + '[href="' + target + '"]')
- .parent('li')
- .addClass('active')
- if ( active.parent('.dropdown-menu') ) {
- active.closest('li.dropdown').addClass('active')
- }
- }
- }
- /* SCROLLSPY PLUGIN DEFINITION
- * =========================== */
- $.fn.scrollspy = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('scrollspy')
- , options = typeof option == 'object' && option
- if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
- $.fn.scrollspy.Constructor = ScrollSpy
- $.fn.scrollspy.defaults = {
- offset: 10
- }
- /* SCROLLSPY DATA-API
- * ================== */
- $(function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
- })
- }( window.jQuery );
- (function($){
- var settings = {
- speed: 350 //animation duration
- , easing: "linear" //use easing plugin for more options
- , padding: 10
- , constrain: false
- }
- , $window = $(window)
- , stickyboxes = []
- , methods = {
- init:function(opts){
- settings = $.extend(settings,opts);
- return this.each(function () {
- var $this = $(this);
- setPosition($this);
- stickyboxes[stickyboxes.length] = $this;
- moveIntoView();
- });
- }
- , remove:function(){
- return this.each(function () {
- var sticky = this;
- $.each(stickyboxes, function (i, $sb) {
- if($sb.get(0) === sticky){
- reset(null, $sb);
- stickyboxes.splice(i, 1);
- return false;
- }
- });
- });
- }
- , destroy: function () {
- $.each(stickyboxes, function (i, $sb) {
- reset(null, $sb);
- });
- stickyboxes=[];
- $window.unbind("scroll", moveIntoView);
- $window.unbind("resize", reset);
- return this;
- }
- };
- var moveIntoView = function () {
- $.each(stickyboxes, function (i, $sb) {
- var $this = $sb
- , data = $this.data("stickySB");
- if (data) {
- var sTop = $window.scrollTop() - data.offs.top
- , currOffs = $this.offset()
- , origTop = data.orig.offset.top - data.offs.top
- , animTo = origTop;
- //scrolled down out of view
- if (origTop < sTop) {
- //make sure to stop inside parent
- if ((sTop + settings.padding) > data.offs.bottom)
- animTo = data.offs.bottom;
- else animTo = sTop + settings.padding;
- }
- $this
- .stop()
- .animate(
- {top: animTo}
- , settings.speed
- , settings.easing
- );
- }
- });
- }
- var setPosition = function ($sb) {
- if ($sb) {
- var $this = $sb
- , $parent = $this.parent()
- , parentOffs = $parent.offset()
- , currOff = $this.offset()
- , data = $this.data("stickySB");
- if (!data) {
- data = {
- offs: {} // our parents offset
- , orig: { // cache for original css
- top: $this.css("top")
- , left: $this.css("left")
- , position: $this.css("position")
- , marginTop: $this.css("marginTop")
- , marginLeft: $this.css("marginLeft")
- , offset: $this.offset()
- }
- }
- }
- //go up the tree until we find an elem to position from
- while (parentOffs && "top" in parentOffs
- && $parent.css("position") == "static") {
- $parent = $parent.parent();
- parentOffs = $parent.offset();
- }
- if (parentOffs) { // found a postioned ancestor
- var padBtm = parseInt($parent.css("paddingBottom"));
- padBtm = isNaN(padBtm) ? 0 : padBtm;
- data.offs = parentOffs;
- data.offs.bottom = settings.constrain ?
- Math.abs(($parent.innerHeight() - padBtm) - $this.outerHeight()) :
- $(document).height();
- }
- else data.offs = { // went to far set to doc
- top: 0
- , left: 0
- , bottom: $(document).height()
- };
- $this.css({
- position: "absolute"
- , top: Math.floor(currOff.top - data.offs.top) + "px"
- , left: Math.floor(currOff.left - data.offs.left) + "px"
- , margin: 0
- , width: $this.width()
- }).data("stickySB", data);
- }
- }
- var reset = function (ev, $toReset) {
- var stickies = stickyboxes;
- if ($toReset) { // just resetting selected items
- stickies = [$toReset];
- }
- $.each(stickies, function(i, $sb) {
- var data = $sb.data("stickySB");
- if (data) {
- $sb.css({
- position: data.orig.position
- , marginTop: data.orig.marginTop
- , marginLeft: data.orig.marginLeft
- , left: data.orig.left
- , top: data.orig.top
- });
- if (!$toReset) { // just resetting
- setPosition($sb);
- moveIntoView();
- }
- }
- });
- }
- $window.bind("scroll", moveIntoView);
- $window.bind("resize", reset);
- $.fn.stickySidebar = function (method) {
- if (methods[method]) {
- return methods[method].apply(
- this
- , Array.prototype.slice.call(arguments, 1)
- );
- } else if (!method || typeof method == "object") {
- return methods.init.apply(this, arguments);
- }
- }
- })(jQuery);
- (function($,g){var h={},id=1,etid=g+'ETID';$.fn[g]=function(e,f){id++;f=f||this.data(etid)||id;e=e||150;if(f===id)this.data(etid,f);this._hover=this.hover;this.hover=function(c,d){c=c||$.noop;d=d||$.noop;this._hover(function(a){var b=this;clearTimeout(h[f]);h[f]=setTimeout(function(){c.call(b,a)},e)},function(a){var b=this;clearTimeout(h[f]);h[f]=setTimeout(function(){d.call(b,a)},e)});return this};return this};$.fn[g+'Pause']=function(){clearTimeout(this.data(etid));return this};$[g]={get:function(){return id++},pause:function(a){clearTimeout(h[a])}}})(jQuery,'mouseDelay');
- function autoFlashHeight(){
- $(".newsList").height($(window).height()-296 );$(".contentBg").height($(window).height()-305 );
- };
- $(window).resize(autoFlashHeight);
- $(function(){
- $(".videoItem li").hover(function () {
- $(this).children(".videoCon").animate({top:'0'},"normal","swing");
- },
- function () {
- $(this).children(".videoCon").animate({top:'110px'},"fast");
- }
- );
- });
- $(function(){
- $(".trainEntry").hover(function () {
- $(this).addClass("shake")
- },
- function () {
- $(this).removeClass("shake")
- }
- );
- $(".trainFormTab a").click(function(){
- $(this).addClass("now").siblings().removeClass("now");
- $(".trainFormItem > .formEntry ").hide().eq($(".trainFormTab a").index(this)).animate({opacity: 'toggle'},500);});
- $(".openAll").click(function(){
- $(".mainContact").animate({left:"340px"},"normal").hide();
- $(".allContact").show().animate({left:"0"},"normal");
- });
- $(".closeAll").click(function(){
- $(".allContact").hide().animate({left:"450px"},"normal");
- $(".mainContact").show().animate({left:"0"},"normal");
- });
- $(".indexSoft .softEntry").hover(function () {
- $(this).addClass("focus").children(".seList").show("fast");
- },
- function () {
- $(this).removeClass("focus").children(".seList").hide();
- }
- );
- $(".contentBottom").mouseDelay(800).hover(function () {
- $(this).children(".newsExtra").show().animate({top:"-255px",opacity:"1"});
- },
- function () {
- $(this).children(".newsExtra").animate({top:"-200",opacity:"0"}).fadeOut();
- }
- );
- $('.selectTitle').click(function(){
- $(this).siblings(".selectList").fadeToggle();
- $(this).toggleClass("focus");
- if ($(this).hasClass('focus')) $(this).find('b').html('▲').addClass("down")
- else $(this).find('b').html('▼').removeClass("down")
- });
- });
|