/**
 *  jQuery.observeHashChange (Version: 1.0)
 *
 *  http://finnlabs.github.com/jquery.observehashchange/
 *
 *  Copyright (c) 2009, Gregor Schmidt, Finn GmbH
 *
 *  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.
 *
 **/

(function(n){n.fn.hashchange=function(a){n(window).bind("jQuery.hashchange",a);return this;};n.observeHashChange=function(b){var a=n.extend({},n.observeHashChange.defaults,b);if(l()){p();}else{j(a);}};var m=null;var o=null;var q=0;n.observeHashChange.defaults={interval:500};function l(){return typeof window.onhashchange!=="undefined"&&!($.browser.msie&&parseInt($.browser.version)==7);}function p(){m=document.location.hash;window.onhashchange=k;}function k(b,c){var a=m;m=document.location.hash;n(window).trigger("jQuery.hashchange",{before:a,after:m});}function j(a){if(m==null){m=document.location.hash;}if(o!=null){clearInterval(o);}if(q!=a.interval){o=setInterval(r,a.interval);q=a.interval;}}function r(){if(m!=document.location.hash){var a=m;m=document.location.hash;n(window).trigger("jQuery.hashchange",{before:a,after:m});}}n.observeHashChange();})(jQuery);

/* ===========================================================================
 *
 * JQuery URL Parser
 * Version 1.0
 * Parses URLs and provides easy access to information within them.
 *
 * Author: Mark Perkins
 * Author email: mark@allmarkedup.com
 *
 * For full documentation and more go to http://projects.allmarkedup.com/jquery_url_parser/
 *
 * ---------------------------------------------------------------------------
 *
 * CREDITS:
 *
 * Parser based on the Regex-based URI parser by Steven Levithan.
 * For more information (including a detailed explaination of the differences
 * between the 'loose' and 'strict' pasing modes) visit http://blog.stevenlevithan.com/archives/parseuri
 *
 * ---------------------------------------------------------------------------
 *
 * LICENCE:
 *
 * Released under a MIT Licence. See licence.txt that should have been supplied with this file,
 * or visit http://projects.allmarkedup.com/jquery_url_parser/licence.txt
 *
 * ---------------------------------------------------------------------------
 * 
 * EXAMPLES OF USE:
 *
 * Get the domain name (host) from the current page URL
 * jQuery.url.attr("host")
 *
 * Get the query string value for 'item' for the current page
 * jQuery.url.param("item") // null if it doesn't exist
 *
 * Get the second segment of the URI of the current page
 * jQuery.url.segment(2) // null if it doesn't exist
 *
 * Get the protocol of a manually passed in URL
 * jQuery.url.setUrl("http://allmarkedup.com/").attr("protocol") // returns 'http'
 *
 */

jQuery.url=function(){var e={};var b={};var d={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var c=function(){str=decodeURI(d.url);var j=d.parser[d.strictMode?"strict":"loose"].exec(str);var l={};var k=14;while(k--){l[d.key[k]]=j[k]||"";}l[d.q.name]={};l[d.key[12]].replace(d.q.parser,function(m,i,n){if(i){l[d.q.name][i]=n;}});return l;};var f=function(i){if(!b.length){a();}if(i=="base"){if(b.port!==null&&b.port!==""){return b.protocol+"://"+b.host+":"+b.port+"/";}else{return b.protocol+"://"+b.host+"/";}}return(b[i]==="")?null:b[i];};var h=function(i){if(!b.length){a();}return(b.queryKey[i]===null)?null:b.queryKey[i];};var a=function(){b=c();g();};var g=function(){var i=b.path;e=[];e=b.path.length==1?{}:(i.charAt(i.length-1)=="/"?i.substring(1,i.length-1):path=i.substring(1)).split("/");};return{setMode:function(i){strictMode=i=="strict"?true:false;return this;},setUrl:function(i){d.url=i===undefined?window.location:i;a();return this;},segment:function(i){if(!b.length){a();}if(i===undefined){return e.length;}return(e[i]===""||e[i]===undefined)?null:e[i];},attr:f,param:h};}();
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1;}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000));}else{f=m.expires;}e="; expires="+f.toUTCString();}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("");}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break;}}}return d;}};