/* jQuery based CSS parser // documentation: http://youngisrael-stl.org/wordpress/2009/01/16/jquery-css-parser/ // Version: 1.5 // Copyright (c) 2011 Daniel Wachsstock // MIT license: // 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.*/ !function($){$.fn.findandfilter=function(e){var t=this.filter(e).add(this.find(e));return t.prevObject=t.prevObject.prevObject,t},$.fn.parsecss=function(e,t){var r=function(t){$.parsecss(t,e)};return this.findandfilter("style").each(function(){r(this.innerHTML)}).end().findandfilter('link[type="text/css"]').each(function(){this.disabled||/^\w+:/.test($(this).attr("href"))||!$.parsecss.mediumApplies(this.media)||$.get(this.href,r)}).end(),t&&$.get(location.pathname+location.search,function(t){styleAttributes(t,e)},"text"),this},$.parsecss=function(e,t){var r={};e=munge(e).replace(/@(([^;`]|`[^b]|`b[^%])*(`b%)?);?/g,function(e,r){return processAtRule($.trim(r),t),""}),$.each(e.split("`b%"),function(e,t){(t=t.split("%b`")).length<2||(t[0]=restore(t[0]),r[t[0]]=$.extend(r[t[0]]||{},parsedeclarations(t[1])))}),t(r)},$.parsecss.mediumApplies=window.media&&window.media.query||function(e){if(!e)return!0;if(e in media)return media[e];var t=$('').appendTo("head");return media[e]=[1==$("body").css("z-index"),t.remove()][0]},$.parsecss.isValidSelector=function(e){var t=$("").appendTo("head")[0];return[t.styleSheet?!/UNKNOWN/i.test(t.styleSheet.cssText):!!t.sheet.cssRules.length,$(t).remove()][0]},$.parsecss.parseArguments=function(str){if(!str)return[];for(var ret=[],mungedArguments=munge(str,!0).split(/\s+/),i=0;i0?t.apply(this,arguments):this.each(function(){var e=$.data(this,r),s=$(this);e?($.removeData(this,r),e.call(s),s.queue(function(){s.data(r,e).dequeue()})):t.call(s)})},$.fn[r]=function(){var t=$.makeArray(arguments),s=t[0];if($.fn[s]){t.shift();var n=$.fn[s]}else $.effects&&$.effects[s]?("object"!=typeof t[1]&&t.splice(1,0,{}),n=_show[e]):n=_show[e];return this.data(r,function(){n.apply(this,t)})}});var RESGMLcomment=//g,REnotATag=/(>)[^<]*/g,REtag=/<(\w+)([^>]*)>/g;function styleAttributes(e,t){var r,s="",n={};munge(e=e.replace(RESGMLcomment,"").replace(REnotATag,"$1")).replace(REtag,function(e,t,i){if(t=t.toLowerCase(),n[t]?++n[t]:n[t]=1,r=/\bstyle\s*=\s*(%s`\d+`s%)/i.exec(i)){var a=/\bid\s*=\s*(\S+)/i.exec(i);a=a?"#"+restore(a[1]).replace(/^['"]|['"]$/g,""):t+":eq("+(n[t]-1)+")",s+=[a,"{",restore(r[1]).replace(/^['"]|['"]$/g,""),"}"].join("")}}),$.parsecss(s,t)}}(jQuery);