/* 
jsHub open source tagging
Copyright (c) 2009 jsHub.org
Released under the BSD license, see http://github.com/jshub/jshub-core/raw/master/LICENSE.txt 

This file also contains code supplied by and Copyright (c) 2009, Yahoo! Inc. under the BSD License: http://developer.yahoo.net/yui/license.txt
This file also contains code supplied by and Copyright (c) 2009 John Resig under the MIT License http://docs.jquery.com/License 
*/
"use strict";

// skip debug/debug.js
"use strict";(function(){var c=window,b,a=function(){var h=[],i=[],f={},m=function(n,p){this.token=n;this.callback=p;},l=function(n,q,p){this.type=n;this.timestamp=p||b.safe.getTimestamp();this.data=q;},g=function(){var n={},p=function(q){return n[q]||{"data-capture":[],"data-transport":[]};};this.bind=function(r,t,q,w){var v=p(r);if(!v[q]){q="data-capture";}for(var u=false,s=0;s<v[q].length;s++){if(v[q][s].token===t){v[q][s].callback=w;u=true;break;}}if(!u){v[q].push(new m(t,w));}n[r]=v;};this.listenersFor=function(u){var r=p(u),q=p("*");var x=[],y=[].concat(r["data-capture"]).concat(q["data-capture"]).concat(r["data-transport"]).concat(q["data-transport"]);o:for(var t=0,w=y.length;t<w;t++){for(var s=0,v=x.length;s<v;s++){if(x[s].token===y[t].token){continue o;}}x.push(y[t]);}return x;};},k=new g(),e=function(){var n=function(r,t){r=r.split(",");for(var s=0;s<r.length;s++){if(t===b.util.trim(r[s])){return true;}}return false;},q=function(r,t){var s=b.util.trim(t.event_visibility);if(s===undefined||s===""||s==="*"){return true;}return n(s,r);},p=function(s,t){var r={};b.util.each(t,function(w,v){if(/_visibility$/.test(v)===false){var u=t[v+"_visibility"];if(typeof u!=="string"||u===""||u==="*"||n(u,s)){r[v]=w;}}});return r;};this.dispatch=function(s,x,w,v){var r,u,t;if(q(x.token,w)){u=p(x.token,w);r=new l(s,u,v);t=x.callback(r);if(t){b.util.merge(w,t);}}};},j=new e();this.bind=function(n,p){if(typeof n!=="string"||n===""){return;}if(typeof p!=="object"){return;}if(!p.id||!p.eventHandler){return;}k.bind(n,p.id,p.type,p.eventHandler);};this.trigger=function(q,s,r){s=s||{};var n=new l(q,s,r);i.push(n);var t=k.listenersFor(q);for(var p=0;p<t.length;p++){j.dispatch(q,t[p],s,n.timestamp);}if(q==="plugin-initialization-start"){h.push(s);if(f[s.id]){this.configure(s.id,f[s.id]);}}};this.cachedEvents=function(){var s=[],q;for(q=0;q<i.length;q++){var p=i[q],n={};n.type=p.type;n.timestamp=p.timestamp;n.data={};for(var r in p.data){if(p.data.hasOwnProperty(r)){n.data[r]=p.data[r];}}s.push(n);}return s;};this.getPluginInfo=function(){var s=[],n;for(n=0;n<h.length;n++){var p=h[n],r={};for(var q in p){if(typeof p[q]==="string"||typeof p[q]==="number"){r[q]=p[q];}}s.push(r);}return s;};this.configure=function(v,s){if(typeof v!=="string"){throw new Error("Invalid configuration key");}var r,w,t,x=v.split("."),p=typeof s;w=function(){var y,z=x.slice(1,x.length).join(".");for(y=0;y<h.length;y++){if(r===h[y].id&&typeof h[y].configure==="function"){h[y].configure(z,s);return;}}};r=x[0];t=x[x.length-1];for(var u=f,q=0;q<x.length-1;q++){u[x[q]]=u[x[q]]||{};u=u[x[q]];}if(p==="string"||p==="number"||p==="boolean"){u[t]=s;w();}else{if(s===null){delete u[t];w();}else{if(p==="object"){for(var n in s){if(s.hasOwnProperty(n)){this.configure(v+"."+n,s[n]);}}}else{return u[t];}}}};};b=c.jsHub=new a();b.safe=function(f){var e;if("document"===f){e={location:{hash:document.location.hash,host:document.location.host,hostname:document.location.hostname,href:document.location.href,pathname:document.location.pathname,port:document.location.port,protocol:document.location.protocol,search:document.location.search},title:document.title,referrer:(document.referrer===null)?"":document.referrer,cookies:document.cookies,domain:"Unsafe property"};}else{e={};}return e;};b.safe.getTimestamp=function(){return new Date().getTime();};var d=function(){var e=this;e.trim=function(f){if(typeof f==="string"){f=f.replace(/(&nbsp;|\s)+/g," ").replace(/(^\s+)|(\s+$)/g,"");}return f;};e.isArray=function(f){return Object.prototype.toString.call(f)==="[object Array]";};e.each=function(g,k){if(e.isArray(g)){for(var j=0,f=g.length;j<f;j++){k.call(b,g[j],j);}}else{if(typeof g==="object"){for(var h in g){if(g.hasOwnProperty(h)){k.call(b,g[h],h);}}}}return g;};e.merge=function(f,h){f=f||{};h=h||{};for(var g in h){if(h.hasOwnProperty(g)){f[g]=h[g];}}return f;};};b.util=new d();})();
"use strict";(function(){var a=function(){this.dispatch=function(b,d,j){var l=+new Date(),n=document,m=(/MSIE/).test(navigator.userAgent),f,g="jshub-form-"+l,h,c="jshub-iframe-"+l,i;if(!(/^POST|GET$/i.test(b))||!d||(/^javascript:|file:/i.test(d))){return false;}j=j||{};f=n.createElement("form");f.id=g;f.method=b;f.action=d;f.style.visibility="hidden";f.style.position="absolute";f.style.top=0;f.style.cssClass="jshub-form";while(f.hasChildNodes()){f.removeChild(f.lastChild);}jsHub.util.each(j,function o(q,r){var p,e;if(typeof q==="string"||typeof q==="number"){if(m){e=n.createElement('<input name="'+r+'" />');}else{e=n.createElement("input");e.name=r;}e.type="hidden";e.value=q;f.appendChild(e);}else{if(jsHub.util.isArray(q)){for(p=0;p<q.length;p++){if(typeof q[p]==="string"||typeof q[p]==="number"){o(q[p],r);}}}else{}}});if(m){h=n.createElement('<iframe name="'+c+'" />');}else{h=n.createElement("iframe");h.name=c;}h.id=c;h.src="#";h.style.visibility="hidden";h.style.position="absolute";h.style.top=0;h.style.cssClass="jshub-iframe";if(m){try{if("ActiveXObject" in window){n=new ActiveXObject("htmlfile");n.open();n.write("<html><head></head><body></body></html>");n.body.innerHTML=f.outerHTML+h.outerHTML;n.close();f=n.getElementById(f.id);h=n.getElementById(h.id);}}catch(k){}}else{n.body.appendChild(f);n.body.appendChild(h);}if(!f){}if(!h||typeof(h.nodeType)==="undefined"){}i={doc:n,form:f,url:f.action,iframe:h};h.transportState=0;h.onload=function(){jsHub.trigger("form-transport-complete",i);f.parentNode.removeChild(f);h.parentNode.removeChild(h);};h.onunload=function(){};f.target=h.id;f.submit();jsHub.trigger("form-transport-sent",{method:b,url:d,data:j});return i;};};jsHub.dispatchViaForm=(new a()).dispatch;})();
"use strict";(function(){var a=jsHub.util;a.qualifyHREF=function(b){var l=jsHub.safe("document").location;var c=l.protocol+"//"+l.host;if(/^(\.\/)([^\/]?)/.test(b)){b=b.replace(/^(\.\/)([^\/]?)/,"$2");}if(/^([a-z]+)\:\/\//.test(b)){c=b;}else{if(b.substr(0,1)==="/"){c+=b;}else{if(/^((\.\.\/)+)([^\/].*$)/.test(b)){var h=b.match(/^((\.\.\/)+)([^\/].*$)/);h=h[h.length-1];var m=b.split("../").length-1;var f=l.pathname.split("/");f=f.splice(0,f.length-1);for(var g=0;g<m;g++){f=f.splice(0,f.length-1);}var n="";for(var e=0;e<f.length;e++){if(f[e]!==""){n+="/"+f[e];}}n+="/";n+=h;c+=n;}else{n="";f=l.pathname.split("/");f=f.splice(0,f.length-1);for(var d=0;d<f.length;d++){if(f[d]!==""){n+="/"+f[d];}}n+="/";c+=n+b;}}}return c;};a.parseQueryString=function(c){var f,b={},e,h,d,g;c=c||(location.search?location.search:"");if(c.charAt(0)==="?"){c=c.substring(1);}if(c===""){return{};}c=c.replace(/\+/g," ");f=c.split(/[&;]/g);for(e=0;e<f.length;e++){h=f[e].split("=");d=decodeURIComponent(h[0]);g=decodeURIComponent(h[1]||"");if(!b[d]){b[d]=[];}b[d].push(g);}return b;};})();
(function(){function d(f){return f<10?"0"+f:f;}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(f){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+d(this.getUTCMonth()+1)+"-"+d(this.getUTCDate())+"T"+d(this.getUTCHours())+":"+d(this.getUTCMinutes())+":"+d(this.getUTCSeconds())+"Z":null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(f){return this.valueOf();};}var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,b,j={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;function a(f){g.lastIndex=0;return g.test(f)?'"'+f.replace(g,function(k){var l=j[k];return typeof l==="string"?l:"\\u"+("0000"+k.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+f+'"';}function e(r,o){var m,l,s,f,p=h,n,q=o[r];if(q&&typeof q==="object"&&typeof q.toJSON==="function"){q=q.toJSON(r);}if(typeof i==="function"){q=i.call(o,r,q);}switch(typeof q){case"string":return a(q);case"number":return isFinite(q)?String(q):"null";case"boolean":case"null":return String(q);case"object":if(!q){return"null";}h+=b;n=[];if(Object.prototype.toString.apply(q)==="[object Array]"){f=q.length;for(m=0;m<f;m+=1){n[m]=e(m,q)||"null";}s=n.length===0?"[]":h?"[\n"+h+n.join(",\n"+h)+"\n"+p+"]":"["+n.join(",")+"]";h=p;return s;}if(i&&typeof i==="object"){f=i.length;for(m=0;m<f;m+=1){l=i[m];if(typeof l==="string"){s=e(l,q);if(s){n.push(a(l)+(h?": ":":")+s);}}}}else{for(l in q){if(Object.hasOwnProperty.call(q,l)){s=e(l,q);if(s){n.push(a(l)+(h?": ":":")+s);}}}}s=n.length===0?"{}":h?"{\n"+h+n.join(",\n"+h)+"\n"+p+"}":"{"+n.join(",")+"}";h=p;return s;}}jsHub.json=jsHub.json||{};if(typeof jsHub.json.stringify!=="function"){jsHub.json.stringify=function(m,k,l){var f;h="";b="";if(typeof l==="number"){for(f=0;f<l;f+=1){b+=" ";}}else{if(typeof l==="string"){b=l;}}i=k;if(k&&typeof k!=="function"&&(typeof k!=="object"||typeof k.length!=="number")){throw new Error("JSON.stringify");}return e("",{"":m});};}}());
"use strict";(function(){jsHub.logger=(function(){var e=9;if(e&&e>=1){return window.debug;}else{var c,a={},b=function(){},d=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(c=0;c<d.length;++c){a[d[c]]=function(){return b;}(c);}return a;}})();})();
"use strict";(function(){var c={name:"Technographics Plugin",id:"technographic",version:0.3,vendor:"jsHub.org",type:"data-capture"};var a={"about.com":"terms","alice.com":"qs","alltheweb.com":"q","altavista.com":"q","aol\\.[^\\/]+":["encquery","q","query"],"ask.com":"q","bing.com":"q","cnn.com":"query","google\\.[^\\/]+":"q","lycos.com":"query","mamma.com":"query","msn.com":"q","netscape.com":"query","online.onetcenter.org":"qt","search.com":"q","terra.com":"query","yahoo.com":"p"};jsHub.trigger("plugin-initialization-start",c);c.eventHandler=function b(g){jsHub.trigger("technographic-parse-start",g);var k=window,d=k.document,e=k.screen,i=g.data,h={};h.url=d.location.href;if(!i.url){i.url=h.url;}h.title=d.title;if(!i.title){i["page-title"]=h.title;}h.referrer=d.referrer;if(!i.referrer){i.referrer=h.referrer;}if(i.referrer){var f=i.referrer;var j=function(o,n){var m=new RegExp("^http(s)?:\\/\\/(www\\.)?((.+\\.)?"+n+")\\/"),l=new RegExp("\\?(.+[&;])?"+o+"=([^&;]+)([&;].*)?$");if(m.test(f)&&l.test(f)){jsHub.trigger("nat-search-ref",{"search-keyword":decodeURIComponent(f.match(l)[2].replace("+"," ")),"external-referrer":f,"search-engine":f.match(m)[3]});}};jsHub.util.each(a,function(m,l){if(typeof m==="string"){j(m,l);}else{jsHub.util.each(m,function(n){j(n,l);});}});}i.wW=k.innerWidth;i.wH=k.innerHeight;i.sW=e.width;i.sH=e.height;i.colors=e.colorDepth;i.tzOffset=-(new Date()).getTimezoneOffset();jsHub.trigger("technographic-parse-complete",h);return i;};jsHub.bind("page-view",c);jsHub.trigger("plugin-initialization-complete",c);})();
"use strict";(function(){var k={id:"causata-transport",name:"Causata Transport Plugin",version:"0.4.2",vendor:"Causata Inc",type:"data-transport"},b=["page-view","product-view","authentication","checkout","site-search","nat-search-ref"],h="string",g="number",j="page-",n="product-",c="url",l="referrer",f=/^url|tzOffset|sW|sH|wW|wH|colors|plugins$/,d={server:null,account:null},a=[],m=false,o=function(t,s,r){if(/-source$/.test(s)){return;}var q=typeof r,p;if("string"===q||"number"===q){t.push({name:s,value:r});}else{if(jsHub.util.isArray(r)){for(p=0;p<r.length;p++){o(t,s,r[p]);}}}},i=function(){if(typeof d.server!=="string"){jsHub.trigger("plugin-error",{message:"Server hostname not specified",source:k.id});return;}var s,t,q,v,u,r;var p={sender:k.name+" v"+k.version,event:[]};for(s=0;s<a.length;s++){t=a[s];q={timestamp:t.timestamp,eventType:t.type};if(typeof d.account==="string"){q.organization=d.account;}r=[];for(v in t.data){if(t.data.hasOwnProperty(v)){u=t.data[v];if(f.test(v)){p[v]=u;}else{if(v==="referrer"){if(u===""){u="(direct)";}p.referrer=u;}else{o(r,v,u);}}}}if(r.length>0){q.attributes=r;}p.event.push(jsHub.json.stringify(q));}a=[];var w=(("https:"===jsHub.safe("document").location.protocol)?"https://":"http://");jsHub.dispatchViaForm("POST",w+d.server,p);};jsHub.trigger("plugin-initialization-start",k);k.eventHandler=function e(r){if(r.type==="data-capture-start"){m=true;}if(r.type==="data-capture-complete"){m=false;i();}var q=false;if(""+r.data["custom-event"]==="true"){q="custom";}else{for(var p=0;p<b.length;p++){if(b[p]===r.type){q="standard";break;}}}if(q){a.push(r);if(!m){i();}}};k.configure=function(p,q){d[p]=""+q;};jsHub.bind("*",k);jsHub.trigger("plugin-initialization-complete",k);})();
"use strict";(function(){var c=null,b=document;function a(){if(a.done){return;}a.done=true;if(c){clearInterval(c);}jsHub.trigger("data-capture-start");jsHub.trigger("page-view");jsHub.trigger("data-capture-complete");}if(b.addEventListener){b.addEventListener("DOMContentLoaded",a,false);}else{if(b.attachEvent){b.onreadystatechange=function(){if(/interactive|complete/.test(this.readyState)){a();}};}else{if(/WebKit/i.test(navigator.userAgent)){c=setInterval(function(){if(/loaded|complete/.test(b.readyState)){a();}},50);}}}})();


// Configuration
jsHub.configure("inspector", {
	"Version" : "0.4",
  "Generator" : "http://fiann.local/configurator/tag_configurations/3",
  "Configuration" : "Digital Insight demo (revision 5, debug)"
});
jsHub.configure("causata-transport", {"server":"test.causata.com/rtw"});

