(function($,window){'$:nomunge';var undefined,aps=Array.prototype.slice,decode=decodeURIComponent,jq_param=$.param,jq_param_fragment,jq_deparam,jq_deparam_fragment,jq_bbq=$.bbq=$.bbq||{},jq_bbq_pushState,jq_bbq_getState,jq_elemUrlAttr,jq_event_special=$.event.special,str_hashchange='hashchange',str_querystring='querystring',str_fragment='fragment',str_elemUrlAttr='elemUrlAttr',str_location='location',str_href='href',str_src='src',re_trim_querystring=/^.*\?|#.*$/g,re_trim_fragment=/^.*\#/,re_no_escape,elemUrlAttr_cache={};function is_string(arg){return typeof arg==='string';};function curry(func){var args=aps.call(arguments,1);return function(){return func.apply(this,args.concat(aps.call(arguments)));};};function get_fragment(url){return url.replace(/^[^#]*#?(.*)$/,'$1');};function get_querystring(url){return url.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,'$1');};function jq_param_sub(is_fragment,get_func,url,params,merge_mode){var result,qs,matches,url_params,hash;if(params!==undefined){matches=url.match(is_fragment?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);hash=matches[3]||'';if(merge_mode===2&&is_string(params)){qs=params.replace(is_fragment?re_trim_fragment:re_trim_querystring,'');}else{url_params=jq_deparam(matches[2]);params=is_string(params)?jq_deparam[is_fragment?str_fragment:str_querystring](params):params;qs=merge_mode===2?params:merge_mode===1?$.extend({},params,url_params):$.extend({},url_params,params);qs=jq_param(qs);if(is_fragment){qs=qs.replace(re_no_escape,decode);}}result=matches[1]+(is_fragment?'#':qs||!matches[1]?'?':'')+qs+hash;}else{result=get_func(url!==undefined?url:window[str_location][str_href]);}return result;};jq_param[str_querystring]=curry(jq_param_sub,0,get_querystring);jq_param[str_fragment]=jq_param_fragment=curry(jq_param_sub,1,get_fragment);jq_param_fragment.noEscape=function(chars){chars=chars||'';var arr=$.map(chars.split(''),encodeURIComponent);re_no_escape=new RegExp(arr.join('|'),'g');};jq_param_fragment.noEscape(',/');$.deparam=jq_deparam=function(params,coerce){var obj={},coerce_types={'true':!0,'false':!1,'null':null};$.each(params.replace(/\+/g,' ').split('&'),function(j,v){var param=v.split('='),key=decode(param[0]),val,cur=obj,i=0,keys=key.split(']['),keys_last=keys.length-1;if(/\[/.test(keys[0])&&/\]$/.test(keys[keys_last])){keys[keys_last]=keys[keys_last].replace(/\]$/,'');keys=keys.shift().split('[').concat(keys);keys_last=keys.length-1;}else{keys_last=0;}if(param.length===2){val=decode(param[1]);if(coerce){val=val&&!isNaN(val)?+val:val==='undefined'?undefined:coerce_types[val]!==undefined?coerce_types[val]:val;}if(keys_last){for(;i<=keys_last;i++){key=keys[i]===''?cur.length:keys[i];cur=cur[key]=i').hide().insertAfter('body')[0].contentWindow;get_history=function(){return get_fragment(iframe.document[str_location][str_href]);};set_history=function(hash,history_hash){if(hash!==history_hash){var doc=iframe.document;doc.open().close();doc[str_location].hash='#'+hash;}};set_history(get_fragment());}};self.start=function(){if(timeout_id){return;}var last_hash=get_fragment();set_history||init();(function loopy(){var hash=get_fragment(),history_hash=get_history(last_hash);if(hash!==last_hash){set_history(last_hash=hash,history_hash);$(window).trigger(str_hashchange);}else if(history_hash!==last_hash){window[str_location][str_href]=window[str_location][str_href].replace(/#.*/,'')+'#'+history_hash;}timeout_id=setTimeout(loopy,$[str_hashchange+'Delay']);})();};self.stop=function(){if(!iframe){timeout_id&&clearTimeout(timeout_id);timeout_id=0;}};return self;})();})(jQuery,this);