;/*7P1RCD3H9R0M*/var I10C;(function(I10C){ I10C.ScriptBegin || (I10C.ScriptBegin = function(){}); I10C.ScriptEnd || (I10C.ScriptEnd = function(){});I10C.PostMessage || (I10C.PostMessage = function(){ return this.postMessage.apply(this, arguments); });I10C.Location || (I10C.Location = function i10cloc(ba$e, isWrite, op){ var locat1onPresent = Object.getOwnPropertyNames(ba$e).indexOf('locat1on') !== -1; return (!isWrite) ? ( locat1onPresent ? ba$e.locat1on : (ba$e.location || ba$e.locat1on)) : (locat1onPresent ? {set href(v) {ba$e.locat1on.href = v;}, get href() {return i10cloc(ba$e,false,op);}} : {set href(v) {ba$e.location = v;}, get href() {return i10cloc(ba$e,false,op);}});});})(I10C || (I10C = {}));I10C.ScriptBegin();var wpcom_mobile_user_agent_info = { PLATFORM_WINDOWS : 'windows', PLATFORM_IPHONE : 'iphone', PLATFORM_IPOD : 'ipod', PLATFORM_IPAD : 'ipad', PLATFORM_BLACKBERRY : 'blackberry', PLATFORM_BLACKBERRY_10 : 'blackberry_10', PLATFORM_SYMBIAN : 'symbian_series60', PLATFORM_SYMBIAN_S40 : 'symbian_series40', PLATFORM_J2ME_MIDP : 'j2me_midp', PLATFORM_ANDROID : 'android', PLATFORM_ANDROID_TABLET : 'android_tablet', PLATFORM_FIREFOX_OS : 'firefoxOS', PLATFORM_MOBILE_GENERIC : 'mobile_generic', userAgent : false, //Shortcut to the browser User Agent String matchedPlatformName : false, //Matched platform name. False otherwise. matchedUserAgentName : false, //Matched UA String. False otherwise. init: function() { var t = this; try{ t.userAgent = navigator.userAgent.toLowerCase(); t.getPlatformName(); t.getMobileUserAgentName(); } catch(e){ console.error(e); } }, initForTest: function(userAgent) { var t = this; t.matchedPlatformName = false; t.matchedUserAgentName = false; try{ t.userAgent = userAgent.toLowerCase(); t.getPlatformName(); t.getMobileUserAgentName(); } catch(e){ console.error(e); } }, /** * This method detects the mobile User Agent name. * * @return string The matched User Agent name, false otherwise. */ getMobileUserAgentName : function() { var t = this; if ( false !== t.matchedUserAgentName ) return t.matchedUserAgentName; if ( false === t.userAgent ) return false; if( t.isChromeForIOS() ) t.matchedUserAgentName = 'chrome-for-ios'; else if( t.isTwitterForIpad() ) t.matchedUserAgentName = 'twitter-for-ipad'; else if( t.isTwitterForIphone() ) t.matchedUserAgentName = 'twitter-for-iphone'; else if( t.isIPhoneOrIPod() ) t.matchedUserAgentName = 'iphone'; else if ( t.isIPad() ) t.matchedUserAgentName = 'ipad'; else if( t.isAndroidTablet() ) t.matchedUserAgentName = 'android_tablet'; else if( t.isAndroid() ) t.matchedUserAgentName = 'android'; else if( t.isBlackberry10() ) t.matchedUserAgentName = 'blackberry_10'; else if( t.userAgent.indexOf('blackberry') != -1 ) t.matchedUserAgentName = 'blackberry'; else if( t.isBlackberryTablet() ) t.matchedUserAgentName = 'blackberry_tablet'; else if( t.isWindowsPhone7() ) t.matchedUserAgentName = 'win7'; else if( t.isWindowsPhone8() ) t.matchedUserAgentName = 'winphone8'; else if( t.isOperaMini() ) t.matchedUserAgentName = 'opera-mini'; else if( t.isOperaMobile() ) t.matchedUserAgentName = 'opera-mobi'; else if( t.isKindleFire() ) t.matchedUserAgentName = 'kindle-fire'; else if( t.isSymbianPlatform() ) t.matchedUserAgentName = 'series60'; else if( t.isFirefoxMobile() ) t.matchedUserAgentName = 'firefox_mobile'; else if( t.isFirefoxOS() ) t.matchedUserAgentName = 'firefoxOS'; else if( t.isFacebookForIphone() ) t.matchedUserAgentName = 'facebook-for-iphone'; else if( t.isFacebookForIpad() ) t.matchedUserAgentName = 'facebook-for-ipad'; else if( t.isWordPressForIos()) t.matchedUserAgentName = 'ios-app'; else if( t.userAgent.indexOf('iphone') != -1 ) t.matchedUserAgentName = 'iphone-unknown'; else if( t.userAgent.indexOf('ipad') != -1 ) t.matchedUserAgentName = 'ipad-unknown'; return t.matchedUserAgentName ; }, getPlatformName : function() { var t = this; if ( false !== t.matchedPlatformName ) return t.matchedPlatformName; if ( false === t.userAgent ) return false; if( t.userAgent.indexOf('windows ce') != -1 || t.userAgent.indexOf('windows phone') != -1) { t.matchedPlatformName = t.PLATFORM_WINDOWS; } else if( t.userAgent.indexOf('ipad') != -1 ) { t.matchedPlatformName = t.PLATFORM_IPAD; } else if( t.userAgent.indexOf('ipod') != -1 ) { t.matchedPlatformName = t.PLATFORM_IPOD; } else if( t.userAgent.indexOf('iphone') != -1 ) { t.matchedPlatformName = t.PLATFORM_IPHONE; } else if( t.userAgent.indexOf('android') != -1 ) { if ( t.isAndroidTablet() ) t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; else t.matchedPlatformName = t.PLATFORM_ANDROID; } else if( t.isKindleFire() ) { t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; } else if( t.isBlackberry10() ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY_10; } else if( t.userAgent.indexOf('blackberry') != -1 ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY; } else if( t.isBlackberryTablet() ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY; } else if( t.isSymbianPlatform() ) { t.matchedPlatformName = t.PLATFORM_SYMBIAN; } else if( t.isSymbianS40Platform() ) { t.matchedPlatformName = t.PLATFORM_SYMBIAN_S40; } else if( t.isJ2MEPlatform() ) { t.matchedPlatformName = t.PLATFORM_J2ME_MIDP; } else if (t.isFirefoxOS()) { t.matchedPlatformName = t.PLATFORM_FIREFOX_OS; } else if (t.isFirefoxMobile()) { t.matchedPlatformName = t.PLATFORM_MOBILE_GENERIC; } return t.matchedPlatformName; }, /** * Detect the blackBerry OS version. * * Note: This is for smartphones only. Do not work on BB tablets. * */ getBlackBerryOSVersion : function() { var t = this; if ( false === t.userAgent ) return false; if( t.isBlackberry10() ) return '10'; if( t.userAgent.indexOf('blackberry') == -1) return false; var rv = -1; // Return value assumes failure. if ( t.userAgent.indexOf('webkit') != -1 ) { //detecting the BB OS version for devices running OS 6.0 or higher var re = new RegExp(/Version\/([\d\.]+)/i); } else { //blackberry devices <= 5.XX //BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179 var re = new RegExp(/BlackBerry\w+\/([\d\.]+)/i); } if (re.exec(t.userAgent) != null) rv = RegExp.$1.toString(); if( -1 == rv ) return false; return rv; }, /** * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser. */ isIPhoneOrIPod : function() { var t = this; if ( false === t.userAgent ) return false; var isIphone = ( t.userAgent.indexOf('iphone') != -1 || t.userAgent.indexOf('ipod') != -1 ); var isSafari = ( t.userAgent.indexOf('safari') != -1 ); return( isIphone && isSafari ); }, /** * Detects if the current device is an iPad. */ isIPad : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('ipad') != -1 && t.userAgent.indexOf('safari') != -1); }, /** * Detects if the current UA is Chrome for iOS * */ isChromeForIOS : function() { var t = this; if ( false === t.userAgent ) return false; return( t.isIPhoneOrIPod() && t.userAgent.indexOf('crios/') != -1); }, /** * Detects if the current browser is the Native Android browser. * @return boolean true if the browser is Android otherwise false */ isAndroid : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('android') != -1 ) { if ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ) return false; else return true; } return false; }, /** * Detects if the current browser is the Native Android Tablet browser. * Assumes 'Android' should be in the user agent, but not 'mobile' * * @return boolean true if the browser is Android and not 'mobile' otherwise false */ isAndroidTablet : function() { var t = this; if ( false === t.userAgent ) return false; if( t.userAgent.indexOf('android') != -1 && t.userAgent.indexOf('mobile') == -1) { if ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ) return false; else return true; } return false; }, /** * Detects if the current browser is Opera Mobile * * What is the difference between Opera Mobile and Opera Mini? * - Opera Mobile is a full Internet browser for mobile devices. * - Opera Mini always uses a transcoder to convert the page for a small display. * (it uses Opera advanced server compression technology to compress web content before it gets to a device. * The rendering engine is on Opera's server.) * * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" */ isOperaMobile : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('opera') != -1 && t.userAgent.indexOf('mobi') != -1); }, /** * Detects if the current browser is Opera Mini * * Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr) * Opera/9.80 (Android;Opera Mini/6.0.24212/24.746 U;en) Presto/2.5.25 Version/10.5454 * Opera/9.80 (iPhone; Opera Mini/5.0.019802/18.738; U; en) Presto/2.4.15 * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 * Opera/9.80 (J2ME/iPhone;Opera Mini/5.0.019802/886; U; ja) Presto/2.4.15 * Opera/9.80 (Series 60; Opera Mini/5.1.22783/23.334; U; en) Presto/2.5.25 Version/10.54 * Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54 * */ isOperaMini : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('opera') != -1 && t.userAgent.indexOf('mini') != -1); }, /** * isBlackberry10() can be used to check the User Agent for a BlackBerry 10 device. */ isBlackberry10 : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('bb10') != -1 && t.userAgent.indexOf('mobile') != -1); }, /** * isBlackberryTablet() can be used to check the User Agent for a RIM blackberry tablet * The user agent of the BlackBerry® Tablet OS follows a format similar to the following: * Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+ * */ isBlackberryTablet : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('playbook') != -1 && t.userAgent.indexOf('rim tablet') != -1); }, /** * Detects if the current browser is a Windows Phone 7 device. * ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910) */ isWindowsPhone7 : function () { var t = this; if ( false === t.userAgent ) return false; return ( t.userAgent.indexOf('windows phone os 7') != -1 ); }, /** * Detects if the current browser is a Windows Phone 8 device. * ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; ; [;]) */ isWindowsPhone8 : function () { var t = this; if ( false === t.userAgent ) return false; return ( t.userAgent.indexOf('windows phone 8') != -1 ); }, /** * * Detects if the device platform is J2ME. * */ isJ2MEPlatform : function () { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('j2me/midp') != -1 ) return true; if ( t.userAgent.indexOf('midp') != -1 && t.userAgent.indexOf('cldc') != -1 ) return true; return false; }, /** * * Detects if the device platform is the Symbian Series 40. * Nokia Browser for Series 40 is a proxy based browser, previously known as Ovi Browser. * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'. * */ isSymbianS40Platform : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('series40') != -1 ) { if ( t.userAgent.indexOf('nokia') != -1 || t.userAgent.indexOf('ovibrowser') != -1 || t.userAgent.indexOf('nokiabrowser') != -1) return true; } return false; }, /** * * Detects if the device platform is the Symbian Series 60. * */ isSymbianPlatform : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('webkit') != -1 ) { //First, test for WebKit, then make sure it's either Symbian or S60. if ( t.userAgent.indexOf('symbian') != -1 || t.userAgent.indexOf('series60') != -1 ) return true; else return false; } else if ( t.userAgent.indexOf('symbianos') != -1 && t.userAgent.indexOf('series60') != -1 ) { return true; } else if ( t.userAgent.indexOf('nokia') != -1 && t.userAgent.indexOf('series60') != -1 ) { return true; } else if ( t.userAgent.indexOf('opera mini') != -1) { if( t.userAgent.indexOf('symbianos') != -1 || t.userAgent.indexOf('symbos') != -1 || t.userAgent.indexOf('series 60') != -1 ) return true; } return false; }, /** * Detects if the current browser is the Kindle Fire Native browser. * * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-84) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false * * @return boolean true if the browser is Kindle Fire Native browser otherwise false */ isKindleFire : function() { var t = this; if ( false === t.userAgent ) return false; return( t.userAgent.indexOf('silk/') != -1 && t.userAgent.indexOf('silk-accelerated=') != -1); }, /** * Detects if the current browser is Firefox Mobile (Fennec) * * http://www.userAgentstring.com/pages/Fennec/ * Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1 */ isFirefoxMobile : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('fennec') != -1 ) return true; return false; }, /** * Detects if the current browser is the native FirefoxOS browser * * Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0 * */ isFirefoxOS : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('mozilla') != -1 && t.userAgent.indexOf('mobile') != -1 && t.userAgent.indexOf('gecko') != -1 && t.userAgent.indexOf('firefox') != -1 ) return true; return false; }, /** * Detects if the current UA is Facebook for iPad * - Facebook 4020.0 (iPad; iPhone OS 5.0.1; en_US) * - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0] * - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US] */ isFacebookForIpad : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('ipad') == -1 ) return false; if ( t.userAgent.indexOf('facebook') != -1 || t.userAgent.indexOf('fbforiphone') != -1 || t.userAgent.indexOf('fban/fbios;') != -1 ) return true; return false; }, /** * Detects if the current UA is Facebook for iPhone * - Facebook 4020.0 (iPhone; iPhone OS 5.0.1; fr_FR) * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0] * - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US] */ isFacebookForIphone : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('iphone') == -1 ) return false; if ( t.userAgent.indexOf('facebook') != -1 && t.userAgent.indexOf('ipad') == -1 ) return true; else if ( t.userAgent.indexOf('fbforiphone') != -1 && t.userAgent.indexOf('tablet') == -1 ) return true; else if ( t.userAgent.indexOf('fban/fbios;') != -1 && t.userAgent.indexOf('tablet') == -1 ) //FB app v5.0 or higher return true; return false; }, /** * Detects if the current UA is Twitter for iPhone * * Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone * Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone */ isTwitterForIphone : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('ipad') != -1 ) return false; if ( t.userAgent.indexOf('twitter for iphone') != -1 ) return true; return false; }, /** * Detects if the current UA is Twitter for iPad * * Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad * Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone */ isTwitterForIpad : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('twitter for ipad') != -1 ) return true; if ( t.userAgent.indexOf('ipad') != -1 && t.userAgent.indexOf('twitter for iphone') != -1 ) return true; return false; }, /** * Detects if the current UA is WordPress for iOS */ isWordPressForIos : function() { var t = this; if ( false === t.userAgent ) return false; if ( t.userAgent.indexOf('wp-iphone') != -1 ) return true; return false; } };; /** The MIT License Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **/ var NO_JQUERY = {}; (function(window, $, undefined) { if (!("console" in window)) { var c = window.console = {}; c.log = c.warn = c.error = c.debug = function(){}; } if ($ === NO_JQUERY) { // jQuery is optional $ = { fn: {}, extend: function() { var a = arguments[0]; for (var i=1,len=arguments.length; i= 0 && element.offsetHeight >= 0 && element.style.display != "none" && elementOffset.top + elementSize.height > viewportOffset.top && elementOffset.top < viewportOffset.top + viewportSize.height && elementOffset.left + elementSize.width > viewportOffset.left && elementOffset.left < viewportOffset.left + viewportSize.width) { visiblePartX = (viewportOffset.left > elementOffset.left ? 'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ? 'left' : 'both'); visiblePartY = (viewportOffset.top > elementOffset.top ? 'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ? 'top' : 'both'); visiblePartsMerged = visiblePartX + "-" + visiblePartY; if (!inView || inView !== visiblePartsMerged) { $element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]); } } else if (inView) { $element.data('inview', false).trigger('inview', [false]); } } } } $(w).bind("scroll resize", function() { viewportSize = viewportOffset = null; }); // IE < 9 scrolls to focused elements without firing the "scroll" event if (!documentElement.addEventListener && documentElement.attachEvent) { documentElement.attachEvent("onfocusin", function() { viewportOffset = null; }); } // Use setInterval in order to also make sure this captures elements within // "overflow:scroll" elements or elements that appeared in the dom tree due to // dom manipulation and reflow // old: $(window).scroll(checkInView); // // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays // intervals while the user scrolls. Therefore the inview event might fire a bit late there setInterval(checkInView, 250); })(jQuery);; /* global Jetpack */ /** * Resizeable Iframes. * * Start listening to resize postMessage events for selected iframes: * $( selector ).Jetpack( 'resizeable' ); * - OR - * Jetpack.resizeable( 'on', context ); * * Resize selected iframes: * $( selector ).Jetpack( 'resizeable', 'resize', { width: 100, height: 200 } ); * - OR - * Jetpack.resizeable( 'resize', { width: 100, height: 200 }, context ); * * Stop listening to resize postMessage events for selected iframes: * $( selector ).Jetpack( 'resizeable', 'off' ); * - OR - * Jetpack.resizeable( 'off', context ); * * Stop listening to all resize postMessage events: * Jetpack.resizeable( 'off' ); */ (function($) { var listening = false, // Are we listening for resize postMessage events sourceOrigins = [], // What origins are allowed to send resize postMessage events $sources = false, // What iframe elements are we tracking resize postMessage events from URLtoOrigin, // Utility to convert URLs into origins setupListener, // Binds global resize postMessage event handler destroyListener, // Unbinds global resize postMessage event handler methods; // Jetpack.resizeable methods // Setup the Jetpack global if ( 'undefined' === typeof window.Jetpack ) { window.Jetpack = { /** * Handles the two different calling methods: * $( selector ).Jetpack( 'namespace', 'method', context ) // here, context is optional and is used to filter the collection * - vs. - * Jetpack.namespace( 'method', context ) // here context defines the collection * * @internal * * Call as: Jetpack.getTarget.call( this, context ) * * @param string context: jQuery selector * @return jQuery|undefined object on which to perform operations or undefined when context cannot be determined */ getTarget: function( context ) { if ( this instanceof jQuery ) { return context ? this.filter( context ) : this; } return context ? $( context ) : context; } }; } // Setup the Jetpack jQuery method if ( 'undefined' === typeof $.fn.Jetpack ) { /** * Dispatches calls to the correct namespace * * @param string namespace * @param ... * @return mixed|jQuery (chainable) */ $.fn.Jetpack = function( namespace ) { if ( 'function' === typeof Jetpack[namespace] ) { // Send the call to the correct Jetpack.namespace return Jetpack[namespace].apply( this, Array.prototype.slice.call( arguments, 1 ) ); } else { $.error( 'Namespace "' + namespace + '" does not exist on jQuery.Jetpack' ); } }; } // Define Jetpack.resizeable() namespace to just always bail if no postMessage if ( 'function' !== typeof window.postMessage ) { $.extend( window.Jetpack, { /** * Defines the Jetpack.resizeable() namespace. * See below for non-trivial definition for browsers with postMessage. */ resizeable: function() { $.error( 'Browser does not support window.postMessage' ); } } ); return; } /** * Utility to convert URLs into origins * * http://example.com:port/path?query#fragment -> http://example.com:port * * @param string URL * @return string origin */ URLtoOrigin = function( URL ) { if ( ! URL.match( /^https?:\/\// ) ) { URL = I10C.Location(document, false, 0).href; } return URL.split( '/' ).slice( 0, 3 ).join( '/' ); }; /** * Binds global resize postMessage event handler */ setupListener = function() { listening = true; $( window ).on( 'message.JetpackResizeableIframe', function( e ) { var event = e.originalEvent, data; // Ensure origin is allowed if ( -1 === $.inArray( event.origin, sourceOrigins ) ) { return; } // Some browsers send structured data, some send JSON strings if ( 'object' === typeof event.data ) { data = event.data.data; } else { try { data = JSON.parse( event.data ); } catch ( err ) { data = false; } } if ( !data.data ) { return; } // Un-nest data = data.data; // Is it a resize event? if ( 'undefined' === typeof data.action || 'resize' !== data.action ) { return; } // Find the correct iframe and resize it $sources.filter( function() { if ( 'undefined' !== typeof data.name ) { return this.name === data.name; } else { return event.source === this.contentWindow; } } ).first().Jetpack( 'resizeable', 'resize', data ); } ); }; /** * Unbinds global resize postMessage event handler */ destroyListener = function() { listening = false; $( window ).off( 'message.JetpackResizeableIframe' ); sourceOrigins = []; $( '.jetpack-resizeable' ).removeClass( 'jetpack-resizeable' ); $sources = false; }; // Methods for Jetpack.resizeable() namespace methods = { /** * Start listening for resize postMessage events on the given iframes * * Call statically as: Jetpack.resizeable( 'on', context ) * Call as: $( selector ).Jetpack( 'resizeable', 'on', context ) // context optional: used to filter the collectino * * @param string context jQuery selector. * @return jQuery (chainable) */ on: function( context ) { var target = Jetpack.getTarget.call( this, context ); if ( ! listening ) { setupListener(); } target.each( function() { sourceOrigins.push( URLtoOrigin( $( this ).attr( 'src' ) ) ); } ).addClass( 'jetpack-resizeable' ); $sources = $( '.jetpack-resizeable' ); return target; }, /** * Stop listening for resize postMessage events on the given iframes * * Call statically as: Jetpack.resizeable( 'off', context ) * Call as: $( selector ).Jetpack( 'resizeable', 'off', context ) // context optional: used to filter the collectino * * @param string context jQuery selector * @return jQuery (chainable) */ off: function( context ) { var target = Jetpack.getTarget.call( this, context ); if ( 'undefined' === typeof target ) { destroyListener(); return target; } target.each( function() { var origin = URLtoOrigin( $( this ).attr( 'src' ) ), pos = $.inArray( origin, sourceOrigins ); if ( -1 !== pos ) { sourceOrigins.splice( pos, 1 ); } } ).removeClass( 'jetpack-resizeable' ); $sources = $( '.jetpack-resizeable' ); return target; }, /** * Resize the given iframes * * Call statically as: Jetpack.resizeable( 'resize', dimensions, context ) * Call as: $( selector ).Jetpack( 'resizeable', 'resize', dimensions, context ) // context optional: used to filter the collectino * * @param object dimensions in pixels: { width: (int), height: (int) } * @param string context jQuery selector * @return jQuery (chainable) */ resize: function( dimensions, context ) { var target = Jetpack.getTarget.call( this, context ); $.each( [ 'width', 'height' ], function( i, variable ) { var value = 0, container; if ( 'undefined' !== typeof dimensions[variable] ) { value = parseInt( dimensions[variable], 10 ); } if ( 0 !== value ) { target[variable]( value ); container = target.parent(); if ( container.hasClass( 'slim-likes-widget' ) ) { container[variable]( value ); } } } ); return target; } }; // Define Jetpack.resizeable() namespace $.extend( window.Jetpack, { /** * Defines the Jetpack.resizeable() namespace. * See above for trivial definition for browsers with no postMessage. * * @param string method * @param ... * @return mixed|jQuery (chainable) */ resizeable: function( method ) { if ( methods[method] ) { // Send the call to the correct Jetpack.resizeable() method return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) ); } else if ( ! method ) { // By default, send to Jetpack.resizeable( 'on' ), which isn't useful in that form but is when called as // jQuery( selector ).Jetpack( 'resizeable' ) return methods.on.apply( this ); } else { $.error( 'Method ' + method + ' does not exist on Jetpack.resizeable' ); } } } ); })(jQuery); ; /*! * jquery.qtip. The jQuery tooltip plugin * * Copyright (c) 2009 Craig Thompson * http://craigsworks.com * * Licensed under MIT * http://www.opensource.org/licenses/mit-license.php * * Launch : February 2009 * Version : 1.0.0-rc3 * Released: Tuesday 12th May, 2009 - 00:00 * Debug: jquery.qtip.debug.js */ (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
"}D=F.getDimensions().width-(Math.max(t,B)*2);y='
';w='
'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='