/* sCore/public/js/scripts.js */ //PRIORITY:1 /* * * Simple Global Scripts (non-module-specific) * */ function doLogin() { var userEmail = document.getElementById('userEmail').value; var userPassword = document.getElementById('userPassword').value; $.ajax({ type: "POST", url: "module/sCore/ajax/login.php", data: "userEmail="+userEmail+"&userPassword="+userPassword, success: function(ajaxValues){ var ajaxParts = ajaxValues.split("|"); if(ajaxParts[0] == '1') { window.location = 'home'; } else { document.getElementById('loginError').innerHTML = ajaxParts[1]; document.getElementById('userPassword').value = ""; document.getElementById('userPassword').focus(); } } }); } function logoutUser() { $.ajax({ type: "POST", url: "module/sCore/ajax/logout.php", success: function(ajaxValues){ window.location='home'; } }); } /* sSlide/public/js/scripts.js */ //PRIORITY:150 /* slides */ function playVimeo(videoId) { $.fancybox.open({ href : 'module/sSlide/ajax/vimeo.php?videoId='+videoId, type : 'iframe', width : 716, height : 414, autoSize : false, scrolling : 'no', openEffect : 'elastic', openSpeed : 200, closeEffect : 'elastic', closeSpeed : 200, padding : 5 }); } function playYouTube(videoId) { $.fancybox.open({ href : 'module/sSlide/ajax/youtube.php?videoId='+videoId, type : 'iframe', width : 716, height : 414, autoSize : false, scrolling : 'no', openEffect : 'elastic', openSpeed : 200, closeEffect : 'elastic', closeSpeed : 200, padding : 5 }); } /* * Slides, A Slideshow Plugin for jQuery * Intructions: http://slidesjs.com * By: Nathan Searles, http://nathansearles.com * Version: 1.1.9 * Updated: September 5th, 2011 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function($){ $.fn.slides = function( option ) { // override defaults with specified option option = $.extend( {}, $.fn.slides.option, option ); return this.each(function(){ // wrap slides in control container, make sure slides are block level $('.' + option.container, $(this)).children().wrapAll('
'); var elem = $(this), control = $('.slides_control',elem), total = control.children().size(), width = control.children().outerWidth(), height = control.children().outerHeight(), start = option.start - 1, effect = option.effect.indexOf(',') < 0 ? option.effect : option.effect.replace(' ', '').split(',')[0], paginationEffect = option.effect.indexOf(',') < 0 ? effect : option.effect.replace(' ', '').split(',')[1], next = 0, prev = 0, number = 0, current = 0, loaded, active, clicked, position, direction, imageParent, pauseTimeout, playInterval; // is there only one slide? if (total < 2) { // Fade in .slides_container $('.' + option.container, $(this)).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ // let the script know everything is loaded loaded = true; // call the loaded funciton option.slidesLoaded(); }); // Hide the next/previous buttons $('.' + option.next + ', .' + option.prev).fadeOut(0); return false; } // animate slides function animate(direction, effect, clicked) { if (!active && loaded) { active = true; // start of animation option.animationStart(current + 1); switch(direction) { case 'next': // change current slide to previous prev = current; // get next from current + 1 next = current + 1; // if last slide, set next to first slide next = total === next ? 0 : next; // set position of next slide to right of previous position = width*2; // distance to slide based on width of slides direction = -width*2; // store new current slide current = next; break; case 'prev': // change current slide to previous prev = current; // get next from current - 1 next = current - 1; // if first slide, set next to last slide next = next === -1 ? total-1 : next; // set position of next slide to left of previous position = 0; // distance to slide based on width of slides direction = 0; // store new current slide current = next; break; case 'pagination': // get next from pagination item clicked, convert to number next = parseInt(clicked,10); // get previous from pagination item with class of current prev = $('.' + option.paginationClass + ' li.'+ option.currentClass +' a', elem).attr('href').match('[^#/]+$'); // if next is greater then previous set position of next slide to right of previous if (next > prev) { position = width*2; direction = -width*2; } else { // if next is less then previous set position of next slide to left of previous position = 0; direction = 0; } // store new current slide current = next; break; } // fade animation if (effect === 'fade') { // fade animation with crossfade if (option.crossfade) { // put hidden next above current control.children(':eq('+ next +')', elem).css({ zIndex: 10 // fade in next }).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ }); if (option.autoHeight) { // animate container to height of next control.animate({ height: control.children(':eq('+ next +')', elem).outerHeight() }, option.autoHeightSpeed, function(){ control.children(':eq('+ prev +')', elem).fadeOut(option.fadeSpeed, option.fadeEasing, function(){ // hide previous control.children(':eq('+ prev +')', elem).css({ display: 'none', zIndex: 0 }); // reset z index control.children(':eq('+ next +')', elem).css({ zIndex: 0 }); // end of animation option.animationComplete(next + 1); active = false; }) }); } else { control.children(':eq('+ prev +')', elem).fadeOut(option.fadeSpeed, option.fadeEasing, function(){ // hide previous control.children(':eq('+ prev +')', elem).css({ display: 'none', zIndex: 0 }); // reset zindex control.children(':eq('+ next +')', elem).css({ zIndex: 0 }); // end of animation option.animationComplete(next + 1); active = false; }); } } else { // fade animation with no crossfade control.children(':eq('+ prev +')', elem).fadeOut(option.fadeSpeed, option.fadeEasing, function(){ // animate to new height if (option.autoHeight) { control.animate({ // animate container to height of next height: control.children(':eq('+ next +')', elem).outerHeight() }, option.autoHeightSpeed, // fade in next slide function(){ control.children(':eq('+ next +')', elem).fadeIn(option.fadeSpeed, option.fadeEasing); }); } else { // if fixed height control.children(':eq('+ next +')', elem).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ // fix font rendering in ie, lame if($.browser.msie) { $(this).get(0).style.removeAttribute('filter'); } }); } // end of animation option.animationComplete(next + 1); active = false; }); } // slide animation } else { // move next slide to right of previous control.children(':eq('+ next +')').css({ left: position, display: 'block' }); // animate to new height if (option.autoHeight) { control.animate({ left: direction, height: control.children(':eq('+ next +')').outerHeight() },option.slideSpeed, option.slideEasing, function(){ control.css({ left: -width }); control.children(':eq('+ next +')').css({ left: width, zIndex: 5 }); // reset previous slide control.children(':eq('+ prev +')').css({ left: width, display: 'none', zIndex: 0 }); // end of animation option.animationComplete(next + 1); active = false; }); // if fixed height } else { // animate control control.animate({ left: direction },option.slideSpeed, option.slideEasing, function(){ // after animation reset control position control.css({ left: -width }); // reset and show next control.children(':eq('+ next +')').css({ left: width, zIndex: 5 }); // reset previous slide control.children(':eq('+ prev +')').css({ left: width, display: 'none', zIndex: 0 }); // end of animation option.animationComplete(next + 1); active = false; }); } } // set current state for pagination if (option.pagination) { // remove current class from all $('.'+ option.paginationClass +' li.' + option.currentClass, elem).removeClass(option.currentClass); // add current class to next $('.' + option.paginationClass + ' li:eq('+ next +')', elem).addClass(option.currentClass); } } } // end animate function function stop() { // clear interval from stored id clearInterval(elem.data('interval')); } function pause() { if (option.pause) { // clear timeout and interval clearTimeout(elem.data('pause')); clearInterval(elem.data('interval')); // pause slide show for option.pause amount pauseTimeout = setTimeout(function() { // clear pause timeout clearTimeout(elem.data('pause')); // start play interval after pause playInterval = setInterval( function(){ animate("next", effect); },option.play); // store play interval elem.data('interval',playInterval); },option.pause); // store pause interval elem.data('pause',pauseTimeout); } else { // if no pause, just stop stop(); } } // 2 or more slides required if (total < 2) { return; } // error corection for start slide if (start < 0) { start = 0; } if (start > total) { start = total - 1; } // change current based on start option number if (option.start) { current = start; } // randomizes slide order if (option.randomize) { control.randomize(); } // make sure overflow is hidden, width is set $('.' + option.container, elem).css({ overflow: 'hidden', // fix for ie position: 'relative' }); // set css for slides control.children().css({ position: 'absolute', top: 0, left: control.children().outerWidth(), zIndex: 0, display: 'none' }); // set css for control div control.css({ position: 'relative', // size of control 3 x slide width width: (width * 3), // set height to slide height height: height, // center control to slide left: -width }); // show slides $('.' + option.container, elem).css({ display: 'block' }); // if autoHeight true, get and set height of first slide if (option.autoHeight) { control.children().css({ height: 'auto' }); control.animate({ height: control.children(':eq('+ start +')').outerHeight() },option.autoHeightSpeed); } // checks if image is loaded if (option.preload && control.find('img:eq(' + start + ')').length) { // adds preload image $('.' + option.container, elem).css({ background: 'url(' + option.preloadImage + ') no-repeat 50% 50%' }); // gets image src, with cache buster var img = control.find('img:eq(' + start + ')').attr('src') + '?' + (new Date()).getTime(); // check if the image has a parent if ($('img', elem).parent().attr('class') != 'slides_control') { // If image has parent, get tag name imageParent = control.children(':eq(0)')[0].tagName.toLowerCase(); } else { // Image doesn't have parent, use image tag name imageParent = control.find('img:eq(' + start + ')'); } // checks if image is loaded control.find('img:eq(' + start + ')').attr('src', img).load(function() { // once image is fully loaded, fade in control.find(imageParent + ':eq(' + start + ')').fadeIn(option.fadeSpeed, option.fadeEasing, function(){ $(this).css({ zIndex: 5 }); // removes preload image $('.' + option.container, elem).css({ background: '' }); // let the script know everything is loaded loaded = true; // call the loaded funciton option.slidesLoaded(); }); }); } else { // if no preloader fade in start slide control.children(':eq(' + start + ')').fadeIn(option.fadeSpeed, option.fadeEasing, function(){ // let the script know everything is loaded loaded = true; // call the loaded funciton option.slidesLoaded(); }); } // click slide for next if (option.bigTarget) { // set cursor to pointer control.children().css({ cursor: 'pointer' }); // click handler control.children().click(function(){ // animate to next on slide click animate('next', effect); return false; }); } // pause on mouseover if (option.hoverPause && option.play) { control.bind('mouseover',function(){ // on mouse over stop stop(); }); control.bind('mouseleave',function(){ // on mouse leave start pause timeout pause(); }); } // generate next/prev buttons if (option.generateNextPrev) { $('.' + option.container, elem).after('Prev'); $('.' + option.prev, elem).after('Next'); } // next button $('.' + option.next ,elem).click(function(e){ e.preventDefault(); if (option.play) { pause(); } animate('next', effect); }); // previous button $('.' + option.prev, elem).click(function(e){ e.preventDefault(); if (option.play) { pause(); } animate('prev', effect); }); // generate pagination if (option.generatePagination) { // create unordered list if (option.prependPagination) { elem.prepend(''); } else { elem.append(''); } // for each slide create a list item and link control.children().each(function(){ $('.' + option.paginationClass, elem).append('
  • '+ (number+1) +'
  • '); number++; }); } else { // if pagination exists, add href w/ value of item number to links $('.' + option.paginationClass + ' li a', elem).each(function(){ $(this).attr('href', '#' + number); number++; }); } // add current class to start slide pagination $('.' + option.paginationClass + ' li:eq('+ start +')', elem).addClass(option.currentClass); // click handling $('.' + option.paginationClass + ' li a', elem ).click(function(){ // pause slideshow if (option.play) { pause(); } // get clicked, pass to animate function clicked = $(this).attr('href').match('[^#/]+$'); // if current slide equals clicked, don't do anything if (current != clicked) { animate('pagination', paginationEffect, clicked); } return false; }); // click handling $('a.link', elem).click(function(){ // pause slideshow if (option.play) { pause(); } // get clicked, pass to animate function clicked = $(this).attr('href').match('[^#/]+$') - 1; // if current slide equals clicked, don't do anything if (current != clicked) { animate('pagination', paginationEffect, clicked); } return false; }); if (option.play) { // set interval playInterval = setInterval(function() { animate('next', effect); }, option.play); // store interval id elem.data('interval',playInterval); } }); }; // default options $.fn.slides.option = { preload: false, // boolean, Set true to preload images in an image based slideshow preloadImage: '/img/loading.gif', // string, Name and location of loading image for preloader. Default is "/img/loading.gif" container: 'slides_container', // string, Class name for slides container. Default is "slides_container" generateNextPrev: false, // boolean, Auto generate next/prev buttons next: 'next', // string, Class name for next button prev: 'prev', // string, Class name for previous button pagination: true, // boolean, If you're not using pagination you can set to false, but don't have to generatePagination: true, // boolean, Auto generate pagination prependPagination: false, // boolean, prepend pagination paginationClass: 'pagination', // string, Class name for pagination currentClass: 'current', // string, Class name for current class fadeSpeed: 350, // number, Set the speed of the fading animation in milliseconds fadeEasing: '', // string, must load jQuery's easing plugin before http://gsgd.co.uk/sandbox/jquery/easing/ slideSpeed: 350, // number, Set the speed of the sliding animation in milliseconds slideEasing: '', // string, must load jQuery's easing plugin before http://gsgd.co.uk/sandbox/jquery/easing/ start: 1, // number, Set the speed of the sliding animation in milliseconds effect: 'slide', // string, '[next/prev], [pagination]', e.g. 'slide, fade' or simply 'fade' for both crossfade: false, // boolean, Crossfade images in a image based slideshow randomize: false, // boolean, Set to true to randomize slides play: 0, // number, Autoplay slideshow, a positive number will set to true and be the time between slide animation in milliseconds pause: 0, // number, Pause slideshow on click of next/prev or pagination. A positive number will set to true and be the time of pause in milliseconds hoverPause: false, // boolean, Set to true and hovering over slideshow will pause it autoHeight: false, // boolean, Set to true to auto adjust height autoHeightSpeed: 350, // number, Set auto height animation time in milliseconds bigTarget: false, // boolean, Set to true and the whole slide will link to next slide on click animationStart: function(){}, // Function called at the start of animation animationComplete: function(){}, // Function called at the completion of animation slidesLoaded: function() {} // Function is called when slides is fully loaded }; // Randomize slide order on load $.fn.randomize = function(callback) { function randomizeOrder() { return(Math.round(Math.random())-0.5); } return($(this).each(function() { var $this = $(this); var $children = $this.children(); var childCount = $children.length; if (childCount > 1) { $children.hide(); var indices = []; for (i=0;i 0; }, getValue = function(value, dim) { if (dim && isPercentage(value)) { value = F.getViewport()[ dim ] / 100 * parseInt(value, 10); } return Math.round(value) + 'px'; }; $.extend(F, { // The current version of fancyBox version: '2.0.5', defaults: { padding: 15, margin: 20, width: 800, height: 600, minWidth: 100, minHeight: 100, maxWidth: 9999, maxHeight: 9999, autoSize: true, autoResize: !isTouch, autoCenter : !isTouch, fitToView: true, aspectRatio: false, topRatio: 0.5, fixed: false, scrolling: 'auto', // 'auto', 'yes' or 'no' wrapCSS: '', arrows: true, closeBtn: true, closeClick: false, nextClick : false, mouseWheel: true, autoPlay: false, playSpeed: 3000, preload : 3, modal: false, loop: true, ajax: { dataType: 'html', headers: { 'X-fancyBox': true } }, keys: { next: [13, 32, 34, 39, 40], // enter, space, page down, right arrow, down arrow prev: [8, 33, 37, 38], // backspace, page up, left arrow, up arrow close: [27] // escape key }, // Override some properties index: 0, type: null, href: null, content: null, title: null, // HTML templates tpl: { wrap: '
    ', image: '', iframe: '', swf: '', error: '

    The requested content cannot be loaded.
    Please try again later.

    ', closeBtn: '
    ', next: '', prev: '' }, // Properties for each animation type // Opening fancyBox openEffect: 'fade', // 'elastic', 'fade' or 'none' openSpeed: 300, openEasing: 'swing', openOpacity: true, openMethod: 'zoomIn', // Closing fancyBox closeEffect: 'fade', // 'elastic', 'fade' or 'none' closeSpeed: 300, closeEasing: 'swing', closeOpacity: true, closeMethod: 'zoomOut', // Changing next gallery item nextEffect: 'elastic', // 'elastic', 'fade' or 'none' nextSpeed: 300, nextEasing: 'swing', nextMethod: 'changeIn', // Changing previous gallery item prevEffect: 'elastic', // 'elastic', 'fade' or 'none' prevSpeed: 300, prevEasing: 'swing', prevMethod: 'changeOut', // Enabled helpers helpers: { overlay: { speedIn: 0, speedOut: 300, opacity: 0.8, css: { cursor: 'pointer' }, closeClick: true }, title: { type: 'float' // 'float', 'inside', 'outside' or 'over' } }, // Callbacks onCancel: $.noop, // If canceling beforeLoad: $.noop, // Before loading afterLoad: $.noop, // After loading beforeShow: $.noop, // Before changing in current item afterShow: $.noop, // After opening beforeClose: $.noop, // Before closing afterClose: $.noop // After closing }, //Current state group: {}, // Selected group opts: {}, // Group options coming: null, // Element being loaded current: null, // Currently loaded element isOpen: false, // Is currently open isOpened: false, // Have been fully opened at least once wrap: null, skin: null, outer: null, inner: null, player: { timer: null, isActive: false }, // Loaders ajaxLoad: null, imgPreload: null, // Some collections transitions: {}, helpers: {}, /* * Static methods */ open: function (group, opts) { //Kill existing instances F.close(true); //Normalize group if (group && !$.isArray(group)) { group = group instanceof $ ? $(group).get() : [group]; } F.isActive = true; //Extend the defaults F.opts = $.extend(true, {}, F.defaults, opts); //All options are merged recursive except keys if ($.isPlainObject(opts) && opts.keys !== undefined) { F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; } F.group = group; F._start(F.opts.index || 0); }, cancel: function () { if (F.coming && false === F.trigger('onCancel')) { return; } F.coming = null; F.hideLoading(); if (F.ajaxLoad) { F.ajaxLoad.abort(); } F.ajaxLoad = null; if (F.imgPreload) { F.imgPreload.onload = F.imgPreload.onabort = F.imgPreload.onerror = null; } }, close: function (a) { F.cancel(); if (!F.current || false === F.trigger('beforeClose')) { return; } F.unbindEvents(); //If forced or is still opening then remove immediately if (!F.isOpen || (a && a[0] === true)) { $('.fancybox-wrap').stop().trigger('onReset').remove(); F._afterZoomOut(); } else { F.isOpen = F.isOpened = false; $('.fancybox-item, .fancybox-nav').remove(); F.wrap.stop(true).removeClass('fancybox-opened'); F.inner.css('overflow', 'hidden'); F.transitions[F.current.closeMethod](); } }, // Start/stop slideshow play: function (a) { var clear = function () { clearTimeout(F.player.timer); }, set = function () { clear(); if (F.current && F.player.isActive) { F.player.timer = setTimeout(F.next, F.current.playSpeed); } }, stop = function () { clear(); $('body').unbind('.player'); F.player.isActive = false; F.trigger('onPlayEnd'); }, start = function () { if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { F.player.isActive = true; $('body').bind({ 'afterShow.player onUpdate.player': set, 'onCancel.player beforeClose.player': stop, 'beforeLoad.player': clear }); set(); F.trigger('onPlayStart'); } }; if (F.player.isActive || (a && a[0] === false)) { stop(); } else { start(); } }, next: function () { if (F.current) { F.jumpto(F.current.index + 1); } }, prev: function () { if (F.current) { F.jumpto(F.current.index - 1); } }, jumpto: function (index) { if (!F.current) { return; } index = parseInt(index, 10); if (F.group.length > 1 && F.current.loop) { if (index >= F.group.length) { index = 0; } else if (index < 0) { index = F.group.length - 1; } } if (F.group[index] !== undefined) { F.cancel(); F._start(index); } }, reposition: function (e, onlyAbsolute) { var pos; if (F.isOpen) { pos = F._getPosition(onlyAbsolute); if (e && e.type === 'scroll') { delete pos.position; F.wrap.stop(true, true).animate(pos, 200); } else { F.wrap.css(pos); } } }, update: function (e) { if (!F.isOpen) { return; } // Run this code after a delay for better performance if (!didResize) { resizeTimer = setTimeout(function () { var current = F.current, anyway = !e || (e && e.type === 'orientationchange'); if (didResize) { didResize = false; if (!current) { return; } if ((!e || e.type !== 'scroll') || anyway) { if (current.autoSize && current.type !== 'iframe') { F.inner.height('auto'); current.height = F.inner.height(); } if (current.autoResize || anyway) { F._setDimension(); } if (current.canGrow && current.type !== 'iframe') { F.inner.height('auto'); } } if (current.autoCenter || anyway) { F.reposition(e); } F.trigger('onUpdate'); } }, 200); } didResize = true; }, toggle: function () { if (F.isOpen) { F.current.fitToView = !F.current.fitToView; F.update(); } }, hideLoading: function () { D.unbind('keypress.fb'); $('#fancybox-loading').remove(); }, showLoading: function () { F.hideLoading(); //If user will press the escape-button, the request will be canceled D.bind('keypress.fb', function(e) { if (e.keyCode === 27) { e.preventDefault(); F.cancel(); } }); $('
    ').click(F.cancel).appendTo('body'); }, getViewport: function () { // See http://bugs.jquery.com/ticket/6724 return { x: W.scrollLeft(), y: W.scrollTop(), w: isTouch && window.innerWidth ? window.innerWidth : W.width(), h: isTouch && window.innerHeight ? window.innerHeight : W.height() }; }, // Unbind the keyboard / clicking actions unbindEvents: function () { if (F.wrap) { F.wrap.unbind('.fb'); } D.unbind('.fb'); W.unbind('.fb'); }, bindEvents: function () { var current = F.current, keys = current.keys; if (!current) { return; } W.bind('resize.fb orientationchange.fb' + (current.autoCenter && !current.fixed ? ' scroll.fb' : ''), F.update); if (keys) { D.bind('keydown.fb', function (e) { var code, target = e.target || e.srcElement; // Ignore key combinations and key events within form elements if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { code = e.keyCode; if ($.inArray(code, keys.close) > -1) { F.close(); e.preventDefault(); } else if ($.inArray(code, keys.next) > -1) { F.next(); e.preventDefault(); } else if ($.inArray(code, keys.prev) > -1) { F.prev(); e.preventDefault(); } } }); } if ($.fn.mousewheel && current.mouseWheel && F.group.length > 1) { F.wrap.bind('mousewheel.fb', function (e, delta) { var target = e.target || null; if (delta !== 0 && (!target || target.clientHeight === 0 || (target.scrollHeight === target.clientHeight && target.scrollWidth === target.clientWidth))) { e.preventDefault(); F[delta > 0 ? 'prev' : 'next'](); } }); } }, trigger: function (event, o) { var ret, obj = o || F[ $.inArray(event, ['onCancel', 'beforeLoad', 'afterLoad']) > -1 ? 'coming' : 'current' ]; if (!obj) { return; } if ($.isFunction( obj[event] )) { ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); } if (ret === false) { return false; } if (obj.helpers) { $.each(obj.helpers, function (helper, opts) { if (opts && $.isPlainObject(F.helpers[helper]) && $.isFunction(F.helpers[helper][event])) { F.helpers[helper][event](opts, obj); } }); } $.event.trigger(event + '.fb'); }, isImage: function (str) { return isString(str) && str.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i); }, isSWF: function (str) { return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); }, _start: function (index) { var coming = {}, element = F.group[index] || null, isDom, href, type, rez, hrefParts; if (element && (element.nodeType || element instanceof $)) { isDom = true; if ($.metadata) { coming = $(element).metadata(); } } coming = $.extend(true, {}, F.opts, {index : index, element : element}, ($.isPlainObject(element) ? element : coming)); // Re-check overridable options $.each(['href', 'title', 'content', 'type'], function(i,v) { coming[v] = F.opts[ v ] || (isDom && $(element).attr( v )) || coming[ v ] || null; }); // Convert margin property to array - top, right, bottom, left if (typeof coming.margin === 'number') { coming.margin = [coming.margin, coming.margin, coming.margin, coming.margin]; } // 'modal' propery is just a shortcut if (coming.modal) { $.extend(true, coming, { closeBtn : false, closeClick: false, nextClick : false, arrows : false, mouseWheel : false, keys : null, helpers: { overlay : { css: { cursor : 'auto' }, closeClick : false } } }); } //Give a chance for callback or helpers to update coming item (type, title, etc) F.coming = coming; if (false === F.trigger('beforeLoad')) { F.coming = null; return; } type = coming.type; href = coming.href || element; ///Check if content type is set, if not, try to get if (!type) { if (isDom) { type = $(element).data('fancybox-type'); if (!type) { rez = element.className.match(/fancybox\.(\w+)/); type = rez ? rez[1] : null; } } if (!type && isString(href)) { if (F.isImage(href)) { type = 'image'; } else if (F.isSWF(href)) { type = 'swf'; } else if (href.match(/^#/)) { type = 'inline'; } } // ...if not - display element itself if (!type) { type = isDom ? 'inline' : 'html'; } coming.type = type; } // Check before try to load; 'inline' and 'html' types need content, others - href if (type === 'inline' || type === 'html') { if (!coming.content) { if (type === 'inline') { coming.content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 } else { coming.content = element; } } if (!coming.content || !coming.content.length) { type = null; } } else if (!href) { type = null; } /* * Add reference to the group, so it`s possible to access from callbacks, example: * afterLoad : function() { * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); * } */ if (type === 'ajax' && isString(href)) { hrefParts = href.split(/\s+/, 2); href = hrefParts.shift(); coming.selector = hrefParts.shift(); } coming.href = href; coming.group = F.group; coming.isDom = isDom; switch (type) { case 'image': F._loadImage(); break; case 'ajax': F._loadAjax(); break; case 'inline': case 'iframe': case 'swf': case 'html': F._afterLoad(); break; default: F._error( 'type' ); } }, _error: function ( type ) { F.hideLoading(); $.extend(F.coming, { type : 'html', autoSize : true, minWidth : 0, minHeight : 0, padding : 15, hasError : type, content : F.coming.tpl.error }); F._afterLoad(); }, _loadImage: function () { // Reset preload image so it is later possible to check "complete" property var img = F.imgPreload = new Image(); img.onload = function () { this.onload = this.onerror = null; F.coming.width = this.width; F.coming.height = this.height; F._afterLoad(); }; img.onerror = function () { this.onload = this.onerror = null; F._error( 'image' ); }; img.src = F.coming.href; if (img.complete === undefined || !img.complete) { F.showLoading(); } }, _loadAjax: function () { F.showLoading(); F.ajaxLoad = $.ajax($.extend({}, F.coming.ajax, { url: F.coming.href, error: function (jqXHR, textStatus) { if (F.coming && textStatus !== 'abort') { F._error( 'ajax', jqXHR ); } else { F.hideLoading(); } }, success: function (data, textStatus) { if (textStatus === 'success') { F.coming.content = data; F._afterLoad(); } } })); }, _preloadImages: function() { var group = F.group, current = F.current, len = group.length, item, href, i, cnt = Math.min(current.preload, len - 1); if (!current.preload || group.length < 2) { return; } for (i = 1; i <= cnt; i += 1) { item = group[ (current.index + i ) % len ]; href = item.href || $( item ).attr('href') || item; if (item.type === 'image' || F.isImage(href)) { new Image().src = href; } } }, _afterLoad: function () { F.hideLoading(); if (!F.coming || false === F.trigger('afterLoad', F.current)) { F.coming = false; return; } if (F.isOpened) { $('.fancybox-item, .fancybox-nav').remove(); F.wrap.stop(true).removeClass('fancybox-opened'); F.inner.css('overflow', 'hidden'); F.transitions[F.current.prevMethod](); } else { $('.fancybox-wrap').stop().trigger('onReset').remove(); F.trigger('afterClose'); } F.unbindEvents(); F.isOpen = false; F.current = F.coming; //Build the neccessary markup F.wrap = $(F.current.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + F.current.type + ' fancybox-tmp ' + F.current.wrapCSS).appendTo('body'); F.skin = $('.fancybox-skin', F.wrap).css('padding', getValue(F.current.padding)); F.outer = $('.fancybox-outer', F.wrap); F.inner = $('.fancybox-inner', F.wrap); F._setContent(); }, _setContent: function () { var current = F.current, content = current.content, type = current.type, minWidth = current.minWidth, minHeight = current.minHeight, maxWidth = current.maxWidth, maxHeight = current.maxHeight, loadingBay; switch (type) { case 'inline': case 'ajax': case 'html': if (current.selector) { content = $('
    ').html(content).find(current.selector); } else if (content instanceof $) { if (content.parent().hasClass('fancybox-inner')) { content.parents('.fancybox-wrap').unbind('onReset'); } content = content.show().detach(); $(F.wrap).bind('onReset', function () { content.appendTo('body').hide(); }); } if (current.autoSize) { loadingBay = $('
    ') .appendTo('body') .css({ minWidth : getValue(minWidth, 'w'), minHeight : getValue(minHeight, 'h'), maxWidth : getValue(maxWidth, 'w'), maxHeight : getValue(maxHeight, 'h') }) .append(content); current.width = loadingBay.width(); current.height = loadingBay.height(); // Re-check to fix 1px bug in some browsers loadingBay.width( F.current.width ); if (loadingBay.height() > current.height) { loadingBay.width(current.width + 1); current.width = loadingBay.width(); current.height = loadingBay.height(); } content = loadingBay.contents().detach(); loadingBay.remove(); } break; case 'image': content = current.tpl.image.replace('{href}', current.href); current.aspectRatio = true; break; case 'swf': content = current.tpl.swf.replace(/\{width\}/g, current.width).replace(/\{height\}/g, current.height).replace(/\{href\}/g, current.href); break; case 'iframe': content = $(current.tpl.iframe.replace('{rnd}', new Date().getTime()) ) .attr('scrolling', current.scrolling) .attr('src', current.href); current.scrolling = isTouch ? 'scroll' : 'auto'; break; } if (type === 'image' || type === 'swf') { current.autoSize = false; current.scrolling = 'visible'; } if (type === 'iframe' && current.autoSize) { F.showLoading(); F._setDimension(); F.inner.css('overflow', current.scrolling); content.bind({ onCancel : function() { $(this).unbind(); F._afterZoomOut(); }, load : function() { F.hideLoading(); try { if (this.contentWindow.document.location) { F.current.height = $(this).contents().find('body').height(); } } catch (e) { F.current.autoSize = false; } F[ F.isOpen ? '_afterZoomIn' : '_beforeShow'](); } }).appendTo(F.inner); } else { F.inner.append(content); F._beforeShow(); } }, _beforeShow : function() { F.coming = null; //Give a chance for helpers or callbacks to update elements F.trigger('beforeShow'); //Set initial dimensions and hide F._setDimension(); F.wrap.hide().removeClass('fancybox-tmp'); F.bindEvents(); F._preloadImages(); F.transitions[ F.isOpened ? F.current.nextMethod : F.current.openMethod ](); }, _setDimension: function () { var wrap = F.wrap, inner = F.inner, current = F.current, viewport = F.getViewport(), margin = current.margin, padding2 = current.padding * 2, width = current.width, height = current.height, maxWidth = current.maxWidth + padding2, maxHeight = current.maxHeight + padding2, minWidth = current.minWidth + padding2, minHeight = current.minHeight + padding2, ratio, height_; viewport.w -= (margin[1] + margin[3]); viewport.h -= (margin[0] + margin[2]); if (isPercentage(width)) { width = (((viewport.w - padding2) * parseFloat(width)) / 100); } if (isPercentage(height)) { height = (((viewport.h - padding2) * parseFloat(height)) / 100); } ratio = width / height; width += padding2; height += padding2; if (current.fitToView) { maxWidth = Math.min(viewport.w, maxWidth); maxHeight = Math.min(viewport.h, maxHeight); } if (current.aspectRatio) { if (width > maxWidth) { width = maxWidth; height = ((width - padding2) / ratio) + padding2; } if (height > maxHeight) { height = maxHeight; width = ((height - padding2) * ratio) + padding2; } if (width < minWidth) { width = minWidth; height = ((width - padding2) / ratio) + padding2; } if (height < minHeight) { height = minHeight; width = ((height - padding2) * ratio) + padding2; } } else { width = Math.max(minWidth, Math.min(width, maxWidth)); height = Math.max(minHeight, Math.min(height, maxHeight)); } width = Math.round(width); height = Math.round(height); //Reset dimensions $(wrap.add(inner)).width('auto').height('auto'); inner.width(width - padding2).height(height - padding2); wrap.width(width); height_ = wrap.height(); // Real wrap height //Fit wrapper inside if (width > maxWidth || height_ > maxHeight) { while ((width > maxWidth || height_ > maxHeight) && width > minWidth && height_ > minHeight) { height = height - 10; if (current.aspectRatio) { width = Math.round(((height - padding2) * ratio) + padding2); if (width < minWidth) { width = minWidth; height = ((width - padding2) / ratio) + padding2; } } else { width = width - 10; } inner.width(width - padding2).height(height - padding2); wrap.width(width); height_ = wrap.height(); } } current.dim = { width : getValue(width), height : getValue(height_) }; current.canGrow = current.autoSize && height > minHeight && height < maxHeight; current.canShrink = false; current.canExpand = false; if ((width - padding2) < current.width || (height - padding2) < current.height) { current.canExpand = true; } else if ((width > viewport.w || height_ > viewport.h) && width > minWidth && height > minHeight) { current.canShrink = true; } F.innerSpace = height_ - padding2 - inner.height(); }, _getPosition: function (onlyAbsolute) { var current = F.current, viewport = F.getViewport(), margin = current.margin, width = F.wrap.width() + margin[1] + margin[3], height = F.wrap.height() + margin[0] + margin[2], rez = { position: 'absolute', top : margin[0] + viewport.y, left : margin[3] + viewport.x }; if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { rez = { position: 'fixed', top : margin[0], left : margin[3] }; } rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * 0.5))); return rez; }, _afterZoomIn: function () { var current = F.current, scrolling = current ? current.scrolling : 'no'; if (!current) { return; } F.isOpen = F.isOpened = true; F.wrap.addClass('fancybox-opened'); F.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); F.trigger('afterShow'); F.update(); //Assign a click event if (current.closeClick || current.nextClick) { F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { F[ current.closeClick ? 'close' : 'next' ](); } }); } //Create a close button if (current.closeBtn) { $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', F.close); } //Create navigation arrows if (current.arrows && F.group.length > 1) { if (current.loop || current.index > 0) { $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); } if (current.loop || current.index < F.group.length - 1) { $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); } } if (F.opts.autoPlay && !F.player.isActive) { F.opts.autoPlay = false; F.play(); } }, _afterZoomOut: function () { var current = F.current; F.wrap.trigger('onReset').remove(); $.extend(F, { group: {}, opts: {}, current: null, isActive: false, isOpened: false, isOpen: false, wrap: null, skin: null, outer: null, inner: null }); F.trigger('afterClose', current); } }); /* * Default transitions */ F.transitions = { getOrigPosition: function () { var current = F.current, element = current.element, padding = current.padding, orig = $(current.orig), pos = {}, width = 50, height = 50, viewport; if (!orig.length && current.isDom && $(element).is(':visible')) { orig = $(element).find('img:first'); if (!orig.length) { orig = $(element); } } if (orig.length) { pos = orig.offset(); if (orig.is('img')) { width = orig.outerWidth(); height = orig.outerHeight(); } } else { viewport = F.getViewport(); pos.top = viewport.y + (viewport.h - height) * 0.5; pos.left = viewport.x + (viewport.w - width) * 0.5; } pos = { top : getValue(pos.top - padding), left : getValue(pos.left - padding), width : getValue(width + padding * 2), height : getValue(height + padding * 2) }; return pos; }, step: function (now, fx) { var prop = fx.prop, value, ratio; if (prop === 'width' || prop === 'height') { value = Math.ceil(now - (F.current.padding * 2)); if (prop === 'height') { ratio = (now - fx.start) / (fx.end - fx.start); if (fx.start > fx.end) { ratio = 1 - ratio; } value -= F.innerSpace * ratio; } F.inner[prop](value); } }, zoomIn: function () { var wrap = F.wrap, current = F.current, effect = current.openEffect, elastic = effect === 'elastic', dim = current.dim, startPos = $.extend({}, dim, F._getPosition( elastic )), endPos = $.extend({opacity : 1}, startPos); //Remove "position" property that breaks older IE delete endPos.position; if (elastic) { startPos = this.getOrigPosition(); if (current.openOpacity) { startPos.opacity = 0; } F.outer.add(F.inner).width('auto').height('auto'); } else if (effect === 'fade') { startPos.opacity = 0; } wrap.css(startPos) .show() .animate(endPos, { duration : effect === 'none' ? 0 : current.openSpeed, easing : current.openEasing, step : elastic ? this.step : null, complete : F._afterZoomIn }); }, zoomOut: function () { var wrap = F.wrap, current = F.current, effect = current.openEffect, elastic = effect === 'elastic', endPos = {opacity : 0}; if (elastic) { if (wrap.css('position') === 'fixed') { wrap.css(F._getPosition(true)); } endPos = this.getOrigPosition(); if (current.closeOpacity) { endPos.opacity = 0; } } wrap.animate(endPos, { duration : effect === 'none' ? 0 : current.closeSpeed, easing : current.closeEasing, step : elastic ? this.step : null, complete : F._afterZoomOut }); }, changeIn: function () { var wrap = F.wrap, current = F.current, effect = current.nextEffect, elastic = effect === 'elastic', startPos = F._getPosition( elastic ), endPos = { opacity : 1 }; startPos.opacity = 0; if (elastic) { startPos.top = getValue(parseInt(startPos.top, 10) - 200); endPos.top = '+=200px'; } wrap.css(startPos) .show() .animate(endPos, { duration : effect === 'none' ? 0 : current.nextSpeed, easing : current.nextEasing, complete : F._afterZoomIn }); }, changeOut: function () { var wrap = F.wrap, current = F.current, effect = current.prevEffect, endPos = { opacity : 0 }, cleanUp = function () { $(this).trigger('onReset').remove(); }; wrap.removeClass('fancybox-opened'); if (effect === 'elastic') { endPos.top = '+=200px'; } wrap.animate(endPos, { duration : effect === 'none' ? 0 : current.prevSpeed, easing : current.prevEasing, complete : cleanUp }); } }; /* * Overlay helper */ F.helpers.overlay = { overlay: null, update: function () { var width, scrollWidth, offsetWidth; //Reset width/height so it will not mess this.overlay.width('100%').height('100%'); if ($.browser.msie || isTouch) { scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); width = scrollWidth < offsetWidth ? W.width() : scrollWidth; } else { width = D.width(); } this.overlay.width(width).height(D.height()); }, beforeShow: function (opts) { if (this.overlay) { return; } opts = $.extend(true, {}, F.defaults.helpers.overlay, opts); this.overlay = $('
    ').css(opts.css).appendTo('body'); if (opts.closeClick) { this.overlay.bind('click.fb', F.close); } if (F.current.fixed && !isTouch) { this.overlay.addClass('overlay-fixed'); } else { this.update(); this.onUpdate = function () { this.update(); }; } this.overlay.fadeTo(opts.speedIn, opts.opacity); }, afterClose: function (opts) { if (this.overlay) { this.overlay.fadeOut(opts.speedOut || 0, function () { $(this).remove(); }); } this.overlay = null; } }; /* * Title helper */ F.helpers.title = { beforeShow: function (opts) { var title, text = F.current.title; if (text) { title = $('
    ' + text + '
    ').appendTo('body'); if (opts.type === 'float') { //This helps for some browsers title.width(title.width()); title.wrapInner(''); //Increase bottom margin so this title will also fit into viewport F.current.margin[2] += Math.abs(parseInt(title.css('margin-bottom'), 10)); } title.appendTo(opts.type === 'over' ? F.inner : (opts.type === 'outside' ? F.wrap : F.skin)); } } }; // jQuery plugin initialization $.fn.fancybox = function (options) { var that = $(this), selector = this.selector || '', index, run = function(e) { var what = this, idx = index, relType, relVal; if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !$(what).is('.fancybox-wrap')) { e.preventDefault(); relType = options.groupAttr || 'data-fancybox-group'; relVal = $(what).attr(relType); if (!relVal) { relType = 'rel'; relVal = what[ relType ]; } if (relVal && relVal !== '' && relVal !== 'nofollow') { what = selector.length ? $(selector) : that; what = what.filter('[' + relType + '="' + relVal + '"]'); idx = what.index(this); } options.index = idx; F.open(what, options); } }; options = options || {}; index = options.index || 0; if (selector) { D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run); } else { that.unbind('click.fb-start').bind('click.fb-start', run); } return this; }; // Test for fixedPosition needs a body at doc ready $(document).ready(function() { F.defaults.fixed = $.support.fixedPosition || (!($.browser.msie && $.browser.version <= 6) && !isTouch); }); }(window, document, jQuery)); /* sShipping/public/js/scripts.js */ //PRIORITY:190 /* shipping scripts */ function selectShipMethod(purchaseId, shipOptCode, shipPriceQuote) { $.ajax({ type: "POST", url: "module/sShipping/ajax/selectShipMethod.php", data: "purchaseId="+purchaseId+"&shipOptCode="+shipOptCode+"&shipPriceQuote="+shipPriceQuote, success: function(ajaxValues){ //alert(ajaxValues); //document.getElementById('checkoutTotal').innerHTML = ajaxValues; } }); } /* tooltip/public/js/scripts.js */ //PRIORITY:110 /* tooltip */ /** * jquery.simpletip 1.3.1. A simple tooltip plugin * * Copyright (c) 2009 Craig Thompson * http://craigsworks.com * * Licensed under GPLv3 * http://www.opensource.org/licenses/gpl-3.0.html * * Launch : February 2009 * Version : 1.3.1 * Released: February 5, 2009 - 11:04am */ (function($){function Simpletip(elem,conf){var self=this;elem=jQuery(elem);var tooltip=jQuery(document.createElement('div')).addClass(conf.baseClass).addClass((conf.fixed)?conf.fixedClass:'').addClass((conf.persistent)?conf.persistentClass:'').html(conf.content).appendTo(elem);if(!conf.hidden)tooltip.show();else tooltip.hide();if(!conf.persistent){elem.hover(function(event){self.show(event)},function(){self.hide()});if(!conf.fixed){elem.mousemove(function(event){if(tooltip.css('display')!=='none')self.updatePos(event);});};}else {elem.click(function(event){if(event.target===elem.get(0)){if(tooltip.css('display')!=='none')self.hide();else self.show();};});jQuery(window).mousedown(function(event){if(tooltip.css('display')!=='none'){var check=(conf.focus)?jQuery(event.target).parents('.tooltip').andSelf().filter(function(){return this===tooltip.get(0)}).length:0;if(check===0)self.hide();};});};jQuery.extend(self,{getVersion:function(){return[1,2,0];},getParent:function(){return elem;},getTooltip:function(){return tooltip;},getPos:function(){return tooltip.offset();},setPos:function(posX,posY){var elemPos=elem.offset();if(typeof posX=='string')posX=parseInt(posX)+elemPos.left;if(typeof posY=='string')posY=parseInt(posY)+elemPos.top;tooltip.css({left:posX,top:posY});return self;},show:function(event){conf.onBeforeShow.call(self);self.updatePos((conf.fixed)?null:event);switch(conf.showEffect){case'fade':tooltip.fadeIn(conf.showTime);break;case'slide':tooltip.slideDown(conf.showTime,self.updatePos);break;case'custom':conf.showCustom.call(tooltip,conf.showTime);break;default:case'none':tooltip.show();break;};tooltip.addClass(conf.activeClass);conf.onShow.call(self);return self;},hide:function(){conf.onBeforeHide.call(self);switch(conf.hideEffect){case'fade':tooltip.fadeOut(conf.hideTime);break;case'slide':tooltip.slideUp(conf.hideTime);break;case'custom':conf.hideCustom.call(tooltip,conf.hideTime);break;default:case'none':tooltip.hide();break;};tooltip.removeClass(conf.activeClass);conf.onHide.call(self);return self;},update:function(content){tooltip.html(content);conf.content=content;return self;},load:function(uri,data){conf.beforeContentLoad.call(self);tooltip.load(uri,data,function(){conf.onContentLoad.call(self);});return self;},boundryCheck:function(posX,posY){var newX=posX+tooltip.outerWidth();var newY=posY+tooltip.outerHeight();var windowWidth=jQuery(window).width()+jQuery(window).scrollLeft();var windowHeight=jQuery(window).height()+jQuery(window).scrollTop();return[(newX>=windowWidth),(newY>=windowHeight)];},updatePos:function(event){var tooltipWidth=tooltip.outerWidth();var tooltipHeight=tooltip.outerHeight();if(!event&&conf.fixed){if(conf.position.constructor==Array){posX=parseInt(conf.position[0]);posY=parseInt(conf.position[1]);}else if(jQuery(conf.position).attr('nodeType')===1){var offset=jQuery(conf.position).offset();posX=offset.left;posY=offset.top;}else {var elemPos=elem.offset();var elemWidth=elem.outerWidth();var elemHeight=elem.outerHeight();switch(conf.position){case'top':var posX=elemPos.left-(tooltipWidth/2)+(elemWidth/2);var posY=elemPos.top-tooltipHeight;break;case'bottom':var posX=elemPos.left-(tooltipWidth/2)+(elemWidth/2);var posY=elemPos.top+elemHeight;break;case'left':var posX=elemPos.left-tooltipWidth;var posY=elemPos.top-(tooltipHeight/2)+(elemHeight/2);break;case'right':var posX=elemPos.left+elemWidth;var posY=elemPos.top-(tooltipHeight/2)+(elemHeight/2);break;default:case'default':var posX=(elemWidth/2)+elemPos.left+20;var posY=elemPos.top;break;};};}else {var posX=event.pageX;var posY=event.pageY;};if(typeof conf.position!='object'){posX=posX+conf.offset[0];posY=posY+conf.offset[1];if(conf.boundryCheck){var overflow=self.boundryCheck(posX,posY);if(overflow[0])posX=posX-(tooltipWidth/2)-(2*conf.offset[0]);if(overflow[1])posY=posY-(tooltipHeight/2)-(2*conf.offset[1]);}}else {if(typeof conf.position[0]=="string")posX=String(posX);if(typeof conf.position[1]=="string")posY=String(posY);};self.setPos(posX,posY);return self;}});};jQuery.fn.simpletip=function(conf){var api=jQuery(this).eq(typeof conf=='number'?conf:0).data("simpletip");if(api)return api;var defaultConf={content:'A simple tooltip',persistent:false,focus:false,hidden:true,position:'default',offset:[0,0],boundryCheck:true,fixed:true,showEffect:'fade',showTime:150,showCustom:null,hideEffect:'fade',hideTime:150,hideCustom:null,baseClass:'tooltip',activeClass:'active',fixedClass:'fixed',persistentClass:'persistent',focusClass:'focus',onBeforeShow:function(){},onShow:function(){},onBeforeHide:function(){},onHide:function(){},beforeContentLoad:function(){},onContentLoad:function(){}};jQuery.extend(defaultConf,conf);this.each(function(){var el=new Simpletip(jQuery(this),defaultConf);jQuery(this).data("simpletip",el);});return this;};})(); /* sAddress/public/js/scripts.js */ //PRIORITY:200 function addAddress(addressTypeId) { $.ajax({ type: "POST", url: "module/sAddress/ajax/addAddress.php", data: "addressTypeId="+addressTypeId, success: function(ajaxValues){ if(addressTypeId == '1') { window.location='shipping'; } if(addressTypeId == '2') { window.location='payment'; } } }); } function editAddress(addressId) { var addressHolderDiv = document.getElementById('address-'+addressId); $.ajax({ type: "POST", url: "module/sAddress/ajax/displayAddressEditor.php", data: "addressId="+addressId, success: function(ajaxValues){ addressHolderDiv.innerHTML = ajaxValues; } }); } function cancelAddressEdit(addressId) { var addressHolderDiv = document.getElementById('address-'+addressId); $.ajax({ type: "POST", url: "module/sAddress/ajax/displayAddress.php", data: "addressId="+addressId, success: function(ajaxValues){ addressHolderDiv.innerHTML = ajaxValues; } }); } function saveAddressEdit(addressId) { var formData = $('#addressEditForm-'+addressId).serialize(); $.ajax({ type: "POST", url: "module/sAddress/ajax/editAddress.php", data: formData, success: function(ajaxValues){ var ajaxParts = ajaxValues.split("|"); if(ajaxParts[0] > 0) { switch(ajaxParts[0]) { case "1": window.location='shipping'; break; case "2": window.location='payment'; break; } } else { document.getElementById('addressEditorError-'+addressId).innerHTML = ajaxParts[1]; document.getElementById('addressEditorError-'+addressId).style.display = 'block'; } } }); } function selectAddress(addressId) { $.ajax({ type: "POST", url: "module/sAddress/ajax/selectAddress.php", data: "addressId="+addressId, success: function(ajaxValues){ var ajaxParts = ajaxValues.split('|'); if(ajaxParts[0] == '1') { window.location='shipping'; } if(ajaxParts[0] == '2') { window.location='payment'; } } }); } /* sCart/public/js/scripts.js */ //PRIORITY:130 /* Cart Scripts */ var qtyTimeout = null; function addToCart(pageId, qty) { $.ajax({ type: 'POST', url: 'module/sCart/ajax/addToCart.php', data: 'pageId='+pageId+'&qty='+qty, success: function(ajaxValues){ var ajaxParts = ajaxValues.split('|'); if(ajaxParts[0] > 0) { refreshLiteCart(); } else { alert('Out of Stock!'); } if(ajaxParts[1] == 0) { $('#addToCartBtn-'+pageId).css('display', 'none'); } $('#qtyInStock-'+pageId).html(ajaxParts[1]); } }); } function refreshLiteCart() { $.ajax({ type: 'POST', url: 'module/sCart/ajax/refreshLiteCart.php', data: '', success: function(ajaxValues){ var ajaxParts = ajaxValues.split('|'); if(ajaxParts[1] > 0) { $('#cartItemCount').html(ajaxParts[1]); $('#liteCartBtn').css('display', 'block'); $('#liteCart').html(ajaxParts[0]); } } }); } function removeFromCart(ppId) { $.ajax({ type: 'POST', url: 'module/sCart/ajax/removeFromCart.php', data: 'ppId='+ppId, dataType: "json", success: function(ajaxValues){ if(ajaxValues.success == '1') { //This user has permission to remove this item from cart //Remove this PurchaseProduct row $('#cartItemDiv-'+ppId).remove(); //Update grandTotal $('#cartGrandTotal').html(ajaxValues.grandTotal); //Refresh the liteCart refreshLiteCart(); } else { alert(ajaxValues.errorMsg); } } }); } function updateQty(element) { var ppId = $(element).attr('id').substr(4); $(element).css('background-color', '#EEE'); clearTimeout(qtyTimeout); qtyTimeout = setTimeout(function() { $.ajax({ type: 'POST', url: 'module/sCart/ajax/updateQty.php', data: 'ppId='+ppId+'&qty='+$(element).val(), dataType: 'json', success: function(ajaxValues){ if(ajaxValues.success == '1') { //Quantity has been updated successfully //Update the qty input field $('#qty-'+ppId).val(ajaxValues.qty); //Update Item Total $('#cartTotal-'+ppId).html(ajaxValues.total); //Update grandTotal $('#cartGrandTotal').html(ajaxValues.grandTotal); //Refresh the liteCart refreshLiteCart(); } else { //An Invalid qty has been entered //Reset the qty field with the previous valid value $('#qty-'+ppId).val(ajaxValues.qty); } $('#qty-'+ppId).css('background-color', '#FFF'); } }); }, 1000); } function doRegister() { var userEmail = $('#registerEmail').val(); var userPassword = $('#registerPassword').val(); $.ajax({ type: "POST", url: "module/sCart/ajax/register.php", data: "userEmail="+userEmail+"&userPassword="+userPassword, dataType: 'json', success: function(ajaxParts) { if(ajaxParts.success) { window.location = 'cart'; } else { $('#registerError').html(ajaxParts.errorMsg); $('#registerPassword').val(''); $('#registerPassword').focus(); } } }); } /* function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function validateQty(inputBox, minQty) { var tempVal = $(inputBox).val(); $(inputBox).css('background-color', '#EEE'); clearTimeout(qtyTimeout); qtyTimeout = setTimeout(function() { if(! isNumber(tempVal)) { $(inputBox).val(minQty); } else { if(tempVal < minQty) { $(inputBox).val(minQty); } } $(inputBox).css('background-color', '#FFF'); }, 1000); } */ /* sSearch/public/js/scripts.js */ //PRIORITY:120 /* Search */ /* bxslider/public/js/jquery.bxslider.min.js */ /** * BxSlider v4.1.1 - Fully loaded, responsive content slider * http://bxslider.com * * Copyright 2012, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com * Written while drinking Belgian ales and listening to jazz * * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ */ !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('
    '),o.viewport=r.parent(),o.loader=t('
    '),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=t('
    '),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).is("img")&&t(this).attr("src",t(this).attr("src")+"?timestamp="+(new Date).getTime()),t(this).load(function(){setTimeout(function(){++n==s&&i()},0)})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('
    '),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.delegate("a","click",q)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('
    '),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t('
    '),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('
    '+e+"
    ")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){t(this).css("zIndex",50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery); /* sForm/public/js/scripts.js */ //Form Scripts function submitForm(formId) { var formData = $('#form-'+formId).serialize(); $('.fieldErrorMsg').html(''); $.ajax({ type: "POST", url: "module/sForm/ajax/submitForm.php", dataType:"json", data: formData, success: function(data){ console.log(data); if(data.validSubmission) { $('#formHolder-'+formId).html(data.formSuccessText); } else { //Print all error messages to the form for(var i=0; iul") //reference main menu UL $mainmenu.parent().get(0).className=setting.classname || "ddsmoothmenu" var $headers=$mainmenu.find("ul").parent() $headers.hover( function(e){ $(this).children('a:eq(0)').addClass('selected') }, function(e){ $(this).children('a:eq(0)').removeClass('selected') } ) $headers.each(function(i){ //loop through each LI header var $curobj=$(this).css({zIndex: 990-i}) //reference current LI header var $subul=$(this).find('ul:eq(0)').css({display:'block'}) $subul.data('timers', {}) this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()} this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header? $subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0}) $curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append( //add arrow images '' ) if (smoothmenu.shadow.enable && !smoothmenu.css3support){ //if shadows enabled and browser doesn't support CSS3 box shadows this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets if (this.istopheader) $parentshadow=$(document.body) else{ var $parentLi=$curobj.parents("li:eq(0)") $parentshadow=$parentLi.get(0).$shadow } this.$shadow=$('
    ').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'}) //insert shadow DIV and set it to parent node for the next shadow div } $curobj.hover( function(e){ var $targetul=$subul //reference UL to reveal var header=$curobj.get(0) //reference header LI as DOM object clearTimeout($targetul.data('timers').hidetimer) $targetul.data('timers').showtimer=setTimeout(function(){ header._offsets={left:$curobj.offset().left, top:$curobj.offset().top} var menuleft=header.istopheader && setting.orientation!='v'? 0 : header._dimensions.w menuleft=(header._offsets.left+menuleft+header._dimensions.subulw>$(window).width())? (header.istopheader && setting.orientation!='v'? -header._dimensions.subulw+header._dimensions.w : -header._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent if ($targetul.queue().length<=1){ //if 1 or less queued animations $targetul.css({left:menuleft+"px", width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime) if (smoothmenu.shadow.enable && !smoothmenu.css3support){ var shadowleft=header.istopheader? $targetul.offset().left+ddsmoothmenu.shadow.offsetx : menuleft var shadowtop=header.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : header._shadowoffset.y if (!header.istopheader && ddsmoothmenu.detectwebkit){ //in WebKit browsers, restore shadow's opacity to full header.$shadow.css({opacity:.5}) } header.$shadow.css({overflow:'', width:header._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:header._dimensions.subulh+'px'}, ddsmoothmenu.transition.overtime) } } }, ddsmoothmenu.showhidedelay.showdelay) }, function(e){ var $targetul=$subul var header=$curobj.get(0) clearTimeout($targetul.data('timers').showtimer) $targetul.data('timers').hidetimer=setTimeout(function(){ $targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime) if (smoothmenu.shadow.enable && !smoothmenu.css3support){ if (ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them header.$shadow.children('div:eq(0)').css({opacity:0}) } header.$shadow.css({overflow:'hidden'}).animate({height:0}, ddsmoothmenu.transition.outtime) } }, ddsmoothmenu.showhidedelay.hidedelay) } ) //end hover }) //end $headers.each() if (smoothmenu.shadow.enable && smoothmenu.css3support){ //if shadows enabled and browser supports CSS3 shadows var $toplevelul=$('#'+setting.mainmenuid+' ul li ul') var css3shadow=parseInt(smoothmenu.shadow.offsetx)+"px "+parseInt(smoothmenu.shadow.offsety)+"px 5px #000" //construct CSS3 box-shadow value var shadowprop=["boxShadow", "MozBoxShadow", "WebkitBoxShadow", "MsBoxShadow"] //possible vendor specific CSS3 shadow properties for (var i=0; i\n' +mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n' +mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n' +'') } this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow jQuery(document).ready(function($){ //ajax menu? if (typeof setting.contentsource=="object"){ //if external ajax menu ddsmoothmenu.getajaxmenu($, setting) } else{ //else if markup menu ddsmoothmenu.buildmenu($, setting) } }) } } //end ddsmoothmenu variable