'+ '

'+opts.header+'

'+ (opts.paragraph1 === '' ? '' : '

'+opts.paragraph1+'

')+ (opts.paragraph2 === '' ? '' : '

'+opts.paragraph2+'

'); if (opts.browserShow) { html += ''; } // Close list and #jr_list html += '
'+ // Display close links/message if set (opts.close ? ''+opts.closeLink+''+ '

'+opts.closeMessage+'

' : '')+'
'+ // Close #jr_inner and #jr_wrap '
'; var element = $('
'+html+'
'); // Create element var size = _pageSize(); // Get page size var scroll = _scrollSize(); // Get page scroll // This function handles closing this reject window // When clicked, fadeOut and remove all elements element.bind('closejr', function() { // Make sure the permission to close is granted if (!opts.close) { return false; } // Customized Function if ($.isFunction(opts.beforeClose)) { opts.beforeClose(); } // Remove binding function so it // doesn't get called more than once $(this).unbind('closejr'); // Fade out background and modal wrapper $('#jr_overlay,#jr_wrap').fadeOut(opts.fadeOutTime,function() { $(this).remove(); // Remove element from DOM // afterClose: Customized Function if ($.isFunction(opts.afterClose)) { opts.afterClose(); } }); // Show elements that were hidden for layering issues var elmhide = 'embed.jr_hidden, object.jr_hidden, select.jr_hidden, applet.jr_hidden'; $(elmhide).show().removeClass('jr_hidden'); // Set close cookie for next run if (opts.closeCookie) { _cookie(COOKIE_NAME, 'true'); } return true; }); // Tracks clicks in Google Analytics (category 'External Links') // only if opts.analytics is enabled var analytics = function (url) { if (!opts.analytics) return false; // Get just the hostname var host = url.split(/\/+/g)[1]; // Send external link event to Google Analaytics // Attempts both versions of analytics code. (Newest first) try { // Newest analytics code _gaq.push(['_trackEvent', 'External Links', host, url]); } catch (e) { try { // Older analytics code pageTracker._trackEvent('External Links', host, url); } catch (e) { } } }; // Called onClick for browser links (and icons) // Opens link in new window var openBrowserLinks = function(url) { // Send link to analytics if enabled analytics(url); // Open window, generate random id value window.open(url, 'jr_'+ Math.round(Math.random()*11)); return false; }; /* * Trverse through element DOM and apply JS variables * All CSS elements that do not require JS will be in * css/jquery.jreject.css */ // Creates 'background' (div) element.find('#jr_overlay').css({ width: size[0], height: size[1], background: opts.overlayBgColor, opacity: opts.overlayOpacity }); // Wrapper for our pop-up (div) element.find('#jr_wrap').css({ top: scroll[1]+(size[3]/4), left: scroll[0] }); // Wrapper for inner centered content (div) element.find('#jr_inner').css({ minWidth: displayNum*100, maxWidth: displayNum*140, // min/maxWidth not supported by IE width: $.layout.name == 'trident' ? displayNum*155 : 'auto' }); element.find('#jr_inner li').css({ // Browser list items (li) background: 'transparent url("'+opts.imagePath+'background_browser.gif")'+ 'no-repeat scroll left top' }); element.find('#jr_inner li .jr_icon').each(function() { // Dynamically sets the icon background image var self = $(this); self.css('background','transparent url('+opts.imagePath+'browser_'+ (self.parent('li').attr('id').replace(/jr_/,''))+'.gif)'+ ' no-repeat scroll left top'); // Send link clicks to openBrowserLinks self.click(function () { var url = $(this).next('div').children('a').attr('href'); openBrowserLinks(url); }); }); element.find('#jr_inner li a').click(function() { openBrowserLinks($(this).attr('href')); return false; }); // Bind closing event to trigger closejr // to be consistant with ESC key close function element.find('#jr_close a').click(function() { $(this).trigger('closejr'); // If plain anchor is set, return false so there is no page jump if (opts.closeURL === '#') { return false; } }); // Set focus (fixes ESC key issues with forms and other focus bugs) $('#jr_overlay').focus(); // Hide elements that won't display properly $('embed, object, select, applet').each(function() { if ($(this).is(':visible')) { $(this).hide().addClass('jr_hidden'); } }); // Append element to body of document to display $('body').append(element.hide().fadeIn(opts.fadeInTime)); // Handle window resize/scroll events and update overlay dimensions $(window).bind('resize scroll',function() { var size = _pageSize(); // Get size // Update overlay dimensions based on page size $('#jr_overlay').css({ width: size[0], height: size[1] }); var scroll = _scrollSize(); // Get page scroll // Update modal position based on scroll $('#jr_wrap').css({ top: scroll[1] + (size[3]/4), left: scroll[0] }); }); // Add optional ESC Key functionality if (opts.closeESC) { $(document).bind('keydown',function(event) { // ESC = Keycode 27 if (event.keyCode == 27) { element.trigger('closejr'); } }); } // afterReject: Customized Function if ($.isFunction(opts.afterReject)) { opts.afterReject(); } return true; }; // Based on compatibility data from quirksmode.com var _pageSize = function() { var xScroll = window.innerWidth && window.scrollMaxX ? window.innerWidth + window.scrollMaxX : (document.body.scrollWidth > document.body.offsetWidth ? document.body.scrollWidth : document.body.offsetWidth); var yScroll = window.innerHeight && window.scrollMaxY ? window.innerHeight + window.scrollMaxY : (document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight); var windowWidth = window.innerWidth ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth); var windowHeight = window.innerHeight ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight); return [ xScroll 9.27) ? 'futhark' : 'linear_b'; } r.versionNumber = parseFloat(r.version, 10) || 0; var minorStart = 1; if (r.versionNumber 9) { minorStart = 2; } r.versionX = (r.version !== x) ? r.version.substr(0, minorStart) : x; r.className = r.name + r.versionX; return r; }; a = (/Opera|Navigator|Minefield|KHTML|Chrome|CriOS/.test(a) ? m(a, [ [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''], ['Chrome Safari', 'Chrome'], ['CriOS', 'Chrome'], ['KHTML', 'Konqueror'], ['Minefield', 'Firefox'], ['Navigator', 'Netscape'] ]) : a).toLowerCase(); $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|crios|firefox|netscape|konqueror|lynx|msie|opera|safari)/, [], /(camino|chrome|crios|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/)); $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [ ['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto'] ], /(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/); $.os = { name: (/(win|mac|linux|sunos|solaris|iphone|ipad)/. exec(navigator.platform.toLowerCase()) || [u])[0].replace('sunos', 'solaris') }; if (!z) { $('html').addClass([$.os.name, $.browser.name, $.browser.className, $.layout.name, $.layout.className].join(' ')); } }; $.browserTest(navigator.userAgent); }(jQuery)); /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) ', // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value. typographyStyles = [ 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle', 'letterSpacing', 'textTransform', 'wordSpacing', 'textIndent' ], // to keep track which textarea is being mirrored when adjust() is called. mirrored, // the mirror element, which is used to calculate what size the mirrored element should be. mirror = $(copy).data('autosize', true)[0]; // test that line-height can be accurately copied. mirror.style.lineHeight = '99px'; if ($(mirror).css('lineHeight') === '99px') { typographyStyles.push('lineHeight'); } mirror.style.lineHeight = ''; $.fn.autosize = function (options) { if (!this.length) { return this; } options = $.extend({}, defaults, options || {}); if (mirror.parentNode !== document.body) { $(document.body).append(mirror); } return this.each(function () { var ta = this, $ta = $(ta), maxHeight, minHeight, boxOffset = 0, callback = $.isFunction(options.callback), originalStyles = { height: ta.style.height, overflow: ta.style.overflow, overflowY: ta.style.overflowY, wordWrap: ta.style.wordWrap, resize: ta.style.resize }, timeout, width = $ta.width(); if ($ta.data('autosize')) { // exit if autosize has already been applied, or if the textarea is the mirror element. return; } $ta.data('autosize', true); if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){ boxOffset = $ta.outerHeight() - $ta.height(); } // IE8 and lower return 'auto', which parses to NaN, if no min-height is set. minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height()); $ta.css({ overflow: 'hidden', overflowY: 'hidden', wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal' }); // The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value. function setWidth() { var style, width; if ('getComputedStyle' in window) { style = window.getComputedStyle(ta, null); width = ta.getBoundingClientRect().width; $.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){ width -= parseInt(style[val],10); }); mirror.style.width = width + 'px'; } else { // window.getComputedStyle, getBoundingClientRect returning a width are unsupported and unneeded in IE8 and lower. mirror.style.width = Math.max($ta.width(), 0) + 'px'; } } function initMirror() { var styles = {}; mirrored = ta; mirror.className = options.className; maxHeight = parseInt($ta.css('maxHeight'), 10); // mirror is a duplicate textarea located off-screen that // is automatically updated to contain the same text as the // original textarea. mirror always has a height of 0. // This gives a cross-browser supported way getting the actual // height of the text, through the scrollTop property. $.each(typographyStyles, function(i,val){ styles[val] = $ta.css(val); }); $(mirror).css(styles); setWidth(); // Chrome-specific fix: // When the textarea y-overflow is hidden, Chrome doesn't reflow the text to account for the space // made available by removing the scrollbar. This workaround triggers the reflow for Chrome. if (window.chrome) { var width = ta.style.width; ta.style.width = '0px'; var ignore = ta.offsetWidth; ta.style.width = width; } } // Using mainly bare JS in this function because it is going // to fire very often while typing, and needs to very efficient. function adjust() { var height, original; if (mirrored !== ta) { initMirror(); } else { setWidth(); } mirror.value = ta.value + options.append; mirror.style.overflowY = ta.style.overflowY; original = parseInt(ta.style.height,10); // Setting scrollTop to zero is needed in IE8 and lower for the next step to be accurately applied mirror.scrollTop = 0; mirror.scrollTop = 9e4; // Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding. height = mirror.scrollTop; if (maxHeight && height > maxHeight) { ta.style.overflowY = 'scroll'; height = maxHeight; } else { ta.style.overflowY = 'hidden'; if (height »'), over = function() { var $this = $(this), o = getOptions($this); clearTimeout(o.sfTimer); $this.showSuperfishUl().siblings().hideSuperfishUl(); }, out = function(e) { var $this = $(this), o = getOptions($this); if (e.type === 'click' || sf.ios) { $.proxy(close, $this, o)(); } else { clearTimeout(o.sfTimer); o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); } }, close = function(o) { o.retainPath = ( $.inArray(this[0], o.$path) > -1); this.hideSuperfishUl(); if (!this.parents('.' + o.hoverClass).length) { o.onIdle.call(getMenu(this)); if (o.$path.length) { $.proxy(over, o.$path)(); } } }, getMenu = function($el) { return $el.closest('.' + c.menuClass); }, getOptions = function($el) { return getMenu($el).data('sf-options'); }, applyTouchAction = function($menu) { // needed by MS pointer events $menu.css('ms-touch-action', 'none'); }, applyHandlers = function($menu,o) { var targets = 'li:has(ul)'; if (!o.useClick) { if ($.fn.hoverIntent && !o.disableHI) { $menu.hoverIntent(over, out, targets); } else { $menu .on('mouseenter', targets, over) .on('mouseleave', targets, out); } } var touchstart = 'MSPointerDown'; if (!sf.ios) { touchstart += ' touchstart'; } if (sf.wp7) { touchstart += ' mousedown'; } $menu .on('focusin', 'li', over) .on('focusout', 'li', out) .on('click', 'a', o, clickHandler) .on(touchstart, 'a', touchHandler); }, touchHandler = function(e) { var $this = $(this), $ul = $this.siblings('ul'); if ($ul.length > 0 && $ul.is(':hidden')) { $this.data('follow', false); if (e.type === 'MSPointerDown') { $this.trigger('focus'); return false; } } }, clickHandler = function(e) { var $a = $(this), o = e.data, $submenu = $a.siblings('ul'), follow = ($a.data('follow') === false) ? false : true; if ($submenu.length && (o.useClick || !follow)) { e.preventDefault(); if ($submenu.is(':hidden')) { $.proxy(over, $a.parent('li'))(); } else if (o.useClick && follow) { $.proxy(out, $a.parent('li'), e)(); } } }, setPathToCurrent = function($menu, o) { return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) .addClass(o.hoverClass + ' ' + c.bcClass) .filter(function() { return ($(this).children('ul').hide().show().length); }).removeClass(o.pathClass); }, addArrows = function($li, o) { if (o.autoArrows) { $li.children('a').each(function() { addArrow( $(this) ); }); } }, addArrow = function($a) { $a.addClass(c.anchorClass).append($arrow.clone()); }; sf.getOptions = getOptions; return this.addClass(c.menuClass).each(function() { var $this = $(this), o = $.extend({}, sf.defaults, op), $liHasUl = $this.find('li:has(ul)'); o.$path = setPathToCurrent($this, o); $this.data('sf-options', o); addArrows($liHasUl, o); applyTouchAction($this); applyHandlers($this, o); $liHasUl.not('.' + c.bcClass).hideSuperfishUl(true); o.onInit.call(this); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.c = { bcClass: 'sf-breadcrumb', menuClass: 'sf-js-enabled', anchorClass: 'sf-with-ul', arrowClass: 'sf-sub-indicator' }; sf.defaults = { hoverClass: 'sfHover', pathClass: 'overrideThisToUse', pathLevels: 1, delay: 800, animation: {opacity:'show'}, animationOut: {opacity:'hide'}, speed: 'normal', speedOut: 'fast', autoArrows: true, disableHI: false, // true disables hoverIntent detection useClick: false, onInit: $.noop, // callback functions onBeforeShow: $.noop, onShow: $.noop, onBeforeHide: $.noop, onHide: $.noop, onIdle: $.noop }; sf.ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); sf.wp7 = (function() { var style = document.documentElement.style; return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); })(); $.fn.extend({ hideSuperfishUl: function(instant) { if (this.length) { var $this = this, o = sf.getOptions($this), not = (o.retainPath === true) ? o.$path : '', $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children('ul'), speed = o.speedOut; if (instant) { $ul.show(); speed = 0; } o.retainPath = false; o.onBeforeHide.call($ul); $ul.stop(true, true).animate(o.animationOut, speed, function() { var $this = $(this); o.onHide.call($this); if (o.useClick) { $this.siblings('a').data('follow', false); } }); } return this; }, showSuperfishUl: function() { var o = sf.getOptions(this), $this = this.addClass(o.hoverClass), $ul = $this.children('ul'); o.onBeforeShow.call($ul); $ul.stop(true, true).animate(o.animation, o.speed, function() { o.onShow.call($ul); $this.children('a').data('follow', true); }); return this; } }); if (sf.ios) { // iOS click won't bubble to body, attach to closest possible $(window).load(function() { $('body').children().on('click', $.noop); }); } })(jQuery); //============================================================= //== Stylesheets manipulations //============================================================= function setStateStyleSheet(title, state) { "use strict"; var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { if (a.getAttribute("title") == title) a.disabled = !state; } } } function getStateStyleSheet(title, state) { "use strict"; var i, a, rez=-1; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { if (a.getAttribute("title") == title) { rez = a.disabled ? 0 : 1; break; } } } return rez; } function setActiveStyleSheet(title, disableOther) { "use strict"; var i, a, main; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { if (disableOther) a.disabled = true; if (a.getAttribute("title") == title) a.disabled = false; } } } function getActiveStyleSheet() { "use strict"; var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); } return null; } function getPreferredStyleSheet() { "use strict"; var i, a; for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null; } //============================================================= //== ListBox & ComboBox manipulations //============================================================= function addListBoxItem(box, val, text) { "use strict"; var item = new Option(); item.value = val; item.text = text; box.options.add(item); } function clearListBox(box) { "use strict"; for (var i=box.options.length-1; i>=0; i--) box.options[i] = null; } function delListBoxItemByValue(box, val) { "use strict"; for (var i=0; i temp_opts[y].text) { temp = temp_opts[x]; temp_opts[x] = temp_opts[y]; temp_opts[y] = temp; } } } for(var i=0; i thearray[y]) { tmp = thearray[x]; thearray[x] = thearray[y]; thearray[y] = tmp; } } else { if (thearray[x].toLowerCase() > thearray[y].toLowerCase()) { tmp = thearray[x]; thearray[x] = thearray[y]; thearray[y] = tmp; } } } } } //============================================================= //== String functions //============================================================= function inList(list, str) { "use strict"; var delim = arguments[2] ? arguments[2] : '|'; var icase = arguments[3] ? arguments[3] : true; var retval = false; if (icase) { str = str.toLowerCase(); list = list.toLowerCase(); } var parts = list.split(delim); for (var i=0; i=0; i--) { if (str.substr(i,1)!=' ') { end = i; break; } } } return str.substring(start, end+1); } function ltrim(str) { "use strict"; return alltrim(str, 'l'); } function rtrim(str) { "use strict"; return alltrim(str, 'r'); } function padl(str, len) { "use strict"; var char = arguments[2] ? arguments[2] : ' '; var rez = str.substr(0,len); if (rez.length 0) float--; var ch = num.substr(i,1); if (ch=='.') { if (precision>0) { res += ch; } float = precision; } else if ((ch>=0 && ch0 && float!=0) { if (float==-1) { res += '.'; float = precision; } for (i=float; i>0; i--) res +='0'; } //if (isNaN(res)) res = clearNumber(defa, precision, defa); return res; } function dec2hex(n) { "use strict"; return Number(n).toString(16); } function hex2dec(hex) { "use strict"; return parseInt(hex,16); } function roundNumber(num) { "use strict"; var precision = arguments[1] ? arguments[1] : 0; var p = Math.pow(10,precision); return Math.round(num*p)/p; } //============================================================= //== Color manipulations //============================================================= function rgb2hex(color) { "use strict"; var aRGB; color = color.replace(/\s/g,"").toLowerCase(); if (color=='rgba(0,0,0,0)' || color=='rgba(0%,0%,0%,0%)') color = 'transparent'; if (color.indexOf('rgba(')==0) aRGB = color.match(/^rgba\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i); else aRGB = color.match(/^rgb\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i); if(aRGB) { color = ''; for (var i=1; i'; for (var i=0; i0 ? '' : '') + ''; tbl += ' '; } tbl += '' + '' + '' + '' + '' + '' + '' + '' + '' + ''; //tbl += ''; jQuery(document.createElement("div")) .attr("id", id) .css('display','none') .html(tbl) .appendTo("body") .addClass("iColorPickerTable") .on('mouseover', 'thead td', function(){ "use strict"; var aaa=rgb2hex(jQuery(this).css('background-color')); jQuery('#'+id+'_colorPreview').css('background',aaa); jQuery('#'+id+'_colorPreview input').val(aaa); }) .on('keypress', '#'+id+'_colorPreview input', function(key){ "use strict"; var aaa=jQuery(this).val() if (aaa.length=48 && key.which=97 && key.which0) { aaa = aaa.substring(0, aaa.length-1); } else if (key.which===13 && (aaa.length===4 || aaa.length===7)) { var fld = jQuery('#'+id).data('field'); var func = jQuery('#'+id).data('func'); if (func!=null && func!='undefined') { func(fld, aaa); } else { fld.val(aaa).css('backgroundColor', aaa).trigger('change'); } jQuery('#'+id+'_Bg').fadeOut(500); jQuery('#'+id).fadeOut(500); } else { key.preventDefault(); return false; } if (aaa.substr(0,1)==='#' && (aaa.length===4 || aaa.length===7)) { jQuery('#'+id+'_colorPreview').css('background',aaa); } }) .on('click', 'thead td', function(e){ "use strict"; var fld = jQuery('#'+id).data('field'); var func = jQuery('#'+id).data('func'); var aaa = rgb2hex(jQuery(this).css('background-color')); if (func!=null && func!='undefined') { func(fld, aaa); } else { fld.val(aaa).css('backgroundColor', aaa).trigger('change'); } jQuery('#'+id+'_Bg').fadeOut(500); jQuery('#'+id).fadeOut(500); e.preventDefault(); return false; }) .on('click', 'tbody .iColorPicker_moreColors', function(e){ "use strict"; var thead = jQuery(this).parents('table').find('thead'); var out = ''; if (thead.hasClass('more_colors')) { for (var i=0; i0 ? '' : '') + ''; out += ' '; } thead.removeClass('more_colors').empty().html(out+''); jQuery('#'+id+'_colorPreview').attr('colspan', 8); jQuery('#'+id+'_colorOriginal').attr('colspan', 8); } else { var rgb=[0,0,0], i=0, j=-1; // Set j=-1 or j=0 - show 2 different colors layouts while (rgb[0]0 ? '' : '') + ''; i++; out += ' '; rgb[2]+=3; if (rgb[2]>0xF) { rgb[1]+=3; if (rgb[1]>(j===0 ? 6 : 0xF)) { rgb[0]+=3; if (rgb[0]>0xF) { if (j===0) { j=1; rgb[0]=0; rgb[1]=9; rgb[2]=0; } else { break; } } else { rgb[1]=(j  '); jQuery('#'+id+'_colorPreview').attr('colspan', 9); jQuery('#'+id+'_colorOriginal').attr('colspan', 9); } e.preventDefault(); return false; }); jQuery(document.createElement("div")) .attr("id", id+"_Bg") .click(function(e) { "use strict"; jQuery("#"+id+"_Bg").fadeOut(500); jQuery("#"+id).fadeOut(500); e.preventDefault(); return false; }) .appendTo("body"); jQuery('#'+id+' table.colorPickerTable') .css({'border-collapse':'collapse'}); jQuery('#'+id+'_colorPreview') .css({'height':'50px'}); return id; } function iColorShow(id, fld, func) { "use strict"; if (id===null || id==='') { id = jQuery('.iColorPickerTable').attr('id'); } var eICP = fld.offset(); var w = jQuery('#'+id).width(); var h = jQuery('#'+id).height(); var l = eICP.left + w 0) rez += (rez!='' ? ' ' : '') + days + ' day' + (days > 1 ? 's' : ''); if ((!short || rez=='') && hours > 0) rez += (rez!='' ? ' ' : '') + hours + ' hour' + (hours > 1 ? 's' : ''); if ((!short || rez=='') && minutes > 0) rez += (rez!='' ? ' ' : '') + minutes + ' minute' + (minutes > 1 ? 's' : ''); if (sec || rez=='') rez += rez!='' || sec ? (' ' + diff + ' second' + (diff > 1 ? 's' : '')) : 'less then minute'; return rez; } //============================================================= //== Form validation //============================================================= function formValidate(form, opt) { "use strict"; var error_msg = ''; form.find(":input").each(function() { "use strict"; if (error_msg!='' && opt.exit_after_first_error) return; for (var i = 0; i 0 && val.length ' + (typeof(opt.rules[i].min_length.message)!='undefined' ? opt.rules[i].min_length.message : opt.error_message_text ) + '' error = true; } } if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].max_length) == 'object') { if (opt.rules[i].max_length.value > 0 && val.length > opt.rules[i].max_length.value) { if (error_msg=='') jQuery(this).get(0).focus(); error_msg += '

' + (typeof(opt.rules[i].max_length.message)!='undefined' ? opt.rules[i].max_length.message : opt.error_message_text ) + '

' error = true; } } if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].mask) == 'object') { if (opt.rules[i].mask.value != '') { var regexp = new RegExp(opt.rules[i].mask.value); if (!regexp.test(val)) { if (error_msg=='') jQuery(this).get(0).focus(); error_msg += '

' + (typeof(opt.rules[i].mask.message)!='undefined' ? opt.rules[i].mask.message : opt.error_message_text ) + '

' error = true; } } } if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].equal_to) == 'object') { if (opt.rules[i].equal_to.value != '' && val!=jQuery(jQuery(this).get(0).form[opt.rules[i].equal_to.value]).val()) { if (error_msg=='') jQuery(this).get(0).focus(); error_msg += '

' + (typeof(opt.rules[i].equal_to.message)!='undefined' ? opt.rules[i].equal_to.message : opt.error_message_text ) + '

' error = true; } } if (opt.error_fields_class != '') jQuery(this).toggleClass(opt.error_fields_class, error); } } }); if (error_msg!='' && opt.error_message_show) { THEMEREX_error_msg_box = form.find(".sc_result"); if (THEMEREX_error_msg_box.length == 0) { form.append('
'); THEMEREX_error_msg_box = form.find(".sc_result"); } if (opt.error_message_class) THEMEREX_error_msg_box.toggleClass(opt.error_message_class, true); THEMEREX_error_msg_box.html(error_msg).fadeIn(); setTimeout(function() { THEMEREX_error_msg_box.fadeOut(); }, opt.error_message_time); } return error_msg!=''; } //============================================================= //== File functions //============================================================= function getFileName(path) { path = path.replace(/\\/g, '/'); var pos = path.lastIndexOf('/'); if (pos >= 0) path = path.substr(pos+1); return path; } function getFileExt(path) { var pos = path.lastIndexOf('.'); path = pos >= 0 ? path.substr(pos+1) : ''; return path; } //============================================================= //== PHP-style functions //============================================================= function isset(obj) { return obj != undefined; } function empty(obj) { return obj == undefined || (typeof(obj)=='object' && obj == null) || (typeof(obj)=='array' && obj.length == 0) || (typeof(obj)=='string' && alltrim(obj)==''); } function is_array(obj) { "use strict"; return typeof(obj)=='array'; } function is_object(obj) { "use strict"; return typeof(obj)=='object'; } function in_array(val, thearray) { "use strict"; var rez = false; for (var x=0; x0) { dispStr += (obj===null ? "null" : typeof(obj)) + (html ? "\n
" : "\n"); addStr = replicate(html ? ' ' : ' ', level*2); } if (obj!==null) { for (var prop in obj) { if (!showMethods && typeof(obj[prop])=='function') // || prop=='innerHTML' || prop=='outerHTML' || prop=='innerText' || prop=='outerText') continue; if (recursive && (typeof(obj[prop])=='object' || typeof(obj[prop])=='array') && obj[prop]!=obj) dispStr += addStr + (html ? "" : "")+prop+(html ? "" : "")+'='+objDisplay(obj[prop], html, recursive, showMethods, level+1); else dispStr += addStr + (html ? "" : "")+prop+(html ? "" : "")+'='+(typeof(obj[prop])=='string' ? '"' : '')+obj[prop]+(typeof(obj[prop])=='string' ? '"' : '')+(html ? "\n
" : "\n"); } } return dispStr; } //============================================================= //== smartresize //============================================================= (function($,sr){ var debounce = function (func, threshold, execAsap) { var timeout; return function debounced () { var obj = this, args = arguments; function delayed () { if (!execAsap) func.apply(obj, args); timeout = null; }; if (timeout) clearTimeout(timeout); else if (execAsap) func.apply(obj, args); timeout = setTimeout(delayed, threshold || 200); }; } // smartresize jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; })(jQuery,'smartresize'); // global jQuery:false var THEMEREX_ADMIN_MODE = false; var THEMEREX_error_msg_box = null; var THEMEREX_VIEWMORE_BUSY = false; var THEMEREX_REMEMBERSCROLL = 0; var THEMEREX_isotopeInitCounter = 0; var THEMEREX_isotopeMemoryID = ''; var THEMEREX_isotopeFilter = '*'; jQuery(document).ready(function() { "use strict"; timelineResponsive() ready(); itemPageFull(); scrollAction(); fullSlider(); }); jQuery(window).resize(function() { "use strict"; itemPageFull(); timelineResponsive(); fullSlider(); scrollAction(); }); jQuery(window).smartresize(function() { mobileMenuShow(); }); jQuery(window).scroll(function() { "use strict"; scrollAction(); }); jQuery(window).load(function() { jQuery('.sc_blogger.style_image .sc_scroll.sc_scroll_horizontal .sc_scroll_wrapper').css('display', 'flex'); jQuery('.sc_blogger.style_image .thumb').each(function() { var x = jQuery(this).width(); jQuery(this).height(x); var image_X = jQuery(this).find('img').width(); var image_Y = jQuery(this).find('img').height(); if (image_Y a').attr('href'); jQuery(this).find('.button.add_to_cart_button').html('read details'); jQuery(this).find('.button.add_to_cart_button').attr('href', href); jQuery(this).find('.button.add_to_cart_button .added_to_cart').hide(); jQuery(this).find('.button.add_to_cart_button').click(function(){ window.location = href; }); jQuery(this).find('.button.add_to_cart_button').removeClass('add_to_cart_button'); }); }); function ready() { "use strict"; //textarea Autosize if (jQuery('textarea.textAreaSize').length > 0) { jQuery('textarea.textAreaSize').autosize({ append: "\n" }); } // Share button if (jQuery('ul.shareDrop').length > 0) { jQuery(document).click(function(e) { "use strict"; jQuery('ul.shareDrop').slideUp().siblings('a.shareDrop').removeClass('selected'); }); jQuery('li.share a').click(function(e) { "use strict"; if (jQuery(this).hasClass('selected')) { jQuery(this).removeClass('selected').siblings('ul.shareDrop').slideUp(); } else { jQuery(this).addClass('selected').siblings('ul.shareDrop').slideDown(); } e.preventDefault(); return false; }); jQuery('li.share li a').click(function(e) { jQuery(this).parents('ul.shareDrop').slideUp().siblings('a.shareDrop').removeClass('selected'); e.preventDefault(); return false; }); } // Like button jQuery('.postSharing,.masonryMore').on('click', '.likeButton a', function(e) { var button = jQuery(this).parent(); var inc = button.hasClass('like') ? 1 : -1; var post_id = button.data('postid'); var likes = Number(button.data('likes')) + inc; var grecko_likes = jQuery.cookie('grecko_likes'); if (grecko_likes === undefined) grecko_likes = ''; jQuery.post(THEMEREX_ajax_url, { action: 'post_counter', nonce: THEMEREX_ajax_nonce, post_id: post_id, likes: likes }).done(function(response) { var rez = JSON.parse(response); if (rez.error === '') { if (inc == 1) { var title = button.data('title-dislike'); button.removeClass('like').addClass('likeActive'); grecko_likes += (grecko_likes.substr(-1) != ',' ? ',' : '') + post_id + ','; } else { var title = button.data('title-like'); button.removeClass('likeActive').addClass('like'); grecko_likes = grecko_likes.replace(',' + post_id + ',', ','); } button.data('likes', likes).find('a').attr('title', title).find('.likePost').html(likes); jQuery.cookie('grecko_likes', grecko_likes, { expires: 365, path: '/' }); } else { themerex_message_warning(THEMEREX_MESSAGE_ERROR_LIKE); } }); e.preventDefault(); return false; }); //hoverZoom img effect jQuery('.hoverIncrease').each(function() { "use strict"; var img = jQuery(this).data('image'); var title = jQuery(this).data('title'); if (img) { jQuery(this).append(''); } }); // ====== isotope ===================================================================== if (jQuery('.isotopeWrap').length > 0) { jQuery('.isotopeWrap').each(function() { isotopeFilterClass('*'); var isotopeWrap = jQuery(this); var isotopeItem = isotopeWrap.find('.isotopeItem'); var isotopeWrapWidth = isotopeWrap.width(); var isotopeWrapFoliosize = isotopeWrap.data('foliosize'); if (jQuery(isotopeWrap).hasClass('portfolio_big')) isotopeWrapFoliosize = 3; if (jQuery(isotopeWrap).hasClass('portfolio_medium')) isotopeWrapFoliosize = 4; if (jQuery(isotopeWrap).hasClass('portfolio_mini')) isotopeWrapFoliosize = 6; if (jQuery(isotopeWrap).data('columns') != '0' && jQuery(isotopeWrap).data('columns')) isotopeWrapFoliosize = parseInt(jQuery(isotopeWrap).data('columns')); var isotopeItemIncw = '1'; var isotopeItemInch = '1'; //indent var indent = false; if (jQuery(isotopeWrap).hasClass('isotopeIndent')) { indent = true; isotopeWrapWidth = jQuery(isotopeWrap).parents('.masonryWrap').width(); jQuery(isotopeWrap).width(isotopeWrapWidth); } isotopeItem.each(function() { var isotopeItemIncw = jQuery(this).data('incw'); var isotopeItemInch = jQuery(this).data('inch'); // if (jQuery(window).width() 600) { titleSize = 30; excerptSize = 14; } if (isotopeSize[0] 0) { if (jQuery.rsCSS3Easing != undefined && jQuery.rsCSS3Easing != null) { jQuery.rsCSS3Easing.easeOutBack = 'cubic-bezier(0.175, 0.885, 0.320, 1.275)'; } jQuery('.sliderHeader').addClass('hsInit'); initShortcodes(jQuery(this)); } // ==================================================================================== // Page Navigation jQuery(document).click(function() { "use strict"; jQuery('.pageFocusBlock').slideUp(); }); jQuery('.pageFocusBlock').click(function(e) { "use strict"; e.preventDefault(); return false; }); jQuery('.navInput').click(function(e) { "use strict"; jQuery('.pageFocusBlock').slideDown(); e.preventDefault(); return false; }); //related links jQuery('.postBoxItem').click(function() { "use strict"; var link = jQuery(this).find('h5 a').attr('href'); if (link != '') { window.location.href = link; } }) // topMenu DROP superfish jQuery('.topMenu ul, .usermenuArea ul').superfish({ delay: 500, animation: { opacity: 'show', height: 'show' }, animationOut: { opacity: 'hide', height: 'hide' }, speed: 'fast', autoArrows: false, dropShadows: false }); // top menu animation jQuery(document).click(function() { "use strict"; jQuery('.hideMenuDisplay #header').removeClass('topMenuShow'); }); jQuery('.hideMenuDisplay .wrapTopMenu').click(function(e) { "use strict"; e.stopPropagation(); }); jQuery('.hideMenuDisplay .openTopMenu').click(function(e) { "use strict"; e.stopPropagation(); jQuery(this).parent().toggleClass('topMenuShow'); return false; }); // Sidemenu DROP jQuery('.sidemenu_area > ul > li.dropMenu ').click(function(e) { "use strict"; e.preventDefault(); return false; }); jQuery('.sidemenu_area > ul > li.dropMenu, .sidemenu_area > ul > li.dropMenu li').click(function(e) { "use strict"; initScroll('sidemenu_scroll'); jQuery(this).toggleClass('dropOpen'); jQuery(this).find('ul').first().slideToggle(); e.preventDefault(); return false; }); jQuery('#sidemenu_scroll a').click(function(e) { "use strict"; initScroll('sidemenu_scroll'); jQuery('#sidemenu_scroll').mCustomScrollbar("update"); e.preventDefault(); return false; }); jQuery(document).click(function(e) { "use strict"; jQuery('body').removeClass('openMenuFixRight openMenuFix'); jQuery('.sidemenu_overflow').fadeOut(400); jQuery('body').attr('style', '');; }); jQuery('.sidemenu_wrap.swpLeftPos, .swpRightPos, .openRightMenu').click(function(e) { "use strict"; e.preventDefault(); return false; }); jQuery('.sidemenu_wrap .sidemenu_button').click(function(e) { "use strict"; jQuery('body').addClass('openMenuFix'); if (jQuery('.sidemenu_overflow').length == 0) { jQuery('body').append('
') } jQuery('.sidemenu_overflow').fadeIn(400); jQuery('body').css('overflow', 'hidden'); e.preventDefault(); return false; }); jQuery('.openRightMenu').click(function(e) { "use strict"; jQuery('body').addClass('openMenuFixRight'); if (jQuery('.sidemenu_overflow').length == 0) { jQuery('body').append('
') } jQuery('.sidemenu_overflow').fadeIn(400); jQuery('body').css('overflow', 'hidden'); e.preventDefault(); return false; }); //Hover DIR jQuery(' .portfolio > .isotopeItem > .hoverDirShow').each(function() { "use strict"; jQuery(this).hoverdir(); }); //Portfolio item Description if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { jQuery('.toggleButton').show(); jQuery('.itemDescriptionWrap,.toggleButton').click(function(e) { "use strict"; jQuery(this).toggleClass('descriptionShow'); jQuery(this).find('.toggleDescription').slideToggle(); e.preventDefault(); return false; }); } else { jQuery('.itemDescriptionWrap').hover(function() { "use strict"; jQuery(this).toggleClass('descriptionShow'); jQuery(this).find('.toggleDescription').slideToggle(); }) } jQuery('input[type="text"], input[type="password"], input[type="search"], textarea').focus(function() { "use strict"; jQuery(this).attr('data-placeholder', jQuery(this).attr('placeholder')).attr('placeholder', '') jQuery(this).parent('li').addClass('iconFocus'); }) .blur(function() { "use strict"; jQuery(this).attr('placeholder', jQuery(this).attr('data-placeholder')) jQuery(this).parent('li').removeClass('iconFocus'); }); //responsive Show menu jQuery('.openMobileMenu').click(function(e) { "use strict"; var ul = jQuery('.wrapTopMenu .topMenu > ul'); ul.slideToggle(); jQuery(this).parents('.menuFixedWrap').toggleClass('menuMobileShow'); e.preventDefault(); return false; }); // IFRAME width and height constrain proportions if (jQuery('iframe').length > 0) { jQuery(window).resize(function() { "use strict"; videoDimensions(); }); videoDimensions(); } // Hide empty pagination if (jQuery('#nav_pages > ul > li').length 0) posts_container = posts_container.find('section.isotopeWrap').eq(0); if (posts_container.hasClass('isotopeWrap')) { posts_container.append(rez.data); THEMEREX_isotopeInitCounter = 0; initAppendedIsotope(posts_container, rez.filters); } else { jQuery('.ajaxContainer').append(rez.data); } initPostFormats(); THEMEREX_VIEWMORE_PAGE++; if (rez.no_more_data == 1) { jQuery('#viewmore_link').hide(); } if (jQuery('#nav_pages ul li').length >= THEMEREX_VIEWMORE_PAGE) { jQuery('#nav_pages ul li').eq(THEMEREX_VIEWMORE_PAGE).toggleClass('pager_current', true); } } }); } e.preventDefault(); return false; }); // Infinite pagination if (jQuery('#viewmore_link.pagination_infinite').length > 0) { jQuery(window).scroll(infiniteScroll); } //custom panel scroll if (jQuery('#custom_options').length > 0) { jQuery('#custom_options .sc_scroll').css('height', jQuery('#custom_options').height() - 46); } // Scroll to top jQuery('.buttonScrollUp').click(function(e) { "use strict"; jQuery('html,body').animate({ scrollTop: 0 }, 'slow'); e.preventDefault(); return false; }); jQuery('.sc_blogger.style_regular').each(function() { var isotopeWrapFoliosize = jQuery(this).data('columns'); var isotopeWrap = jQuery(this); var isotopeItem = jQuery(this).find('.sc_columns_item'); beforeIsotopeItemResize('regular', isotopeWrap, isotopeItem, isotopeWrapFoliosize); jQuery(window).resize(function() { beforeIsotopeItemResize('regular', isotopeWrap, isotopeItem, isotopeWrapFoliosize); }); }); initPostFormats(); }; //end ready // Fit video frame to document width function videoDimensions() { jQuery('iframe').each(function() { "use strict"; var iframe = jQuery(this).eq(0); var w_attr = iframe.attr('width'); var h_attr = iframe.attr('height'); if (!w_attr || !h_attr) { return; } var w_real = iframe.width(); if (w_real != w_attr) { var h_real = Math.round(w_real / w_attr * h_attr); iframe.height(h_real); } }); } function initPostFormats() { "use strict"; // MediaElement init if (THEMEREX_useMediaElement) { if (jQuery('audio').length > 0) { jQuery('audio').each(function() { if (jQuery(this).hasClass('inited')) return; jQuery(this).addClass('inited').mediaelementplayer({ audioWidth: '100%', // width of audio player audioHeight: 30, // height of audio player success: function(mediaElement, domObject) { jQuery(domObject).parents('.sc_audio').addClass('sc_audio_show'); }, }); }); } jQuery('video').each(function() { if (jQuery(this).hasClass('inited')) return; jQuery(this).addClass('inited').mediaelementplayer({ videoWidth: -1, // if set, overrides