/*	XANJAX Copyright 2007,2008,2009, and Trademark, of David Chapman, openPC Labs.

	XANJAX IS FREE SOFTWARE released under GNU Affero General Public License Version 3.
	Read licence.txt distributed with XANJAX, or xanjax.org/license.html for details.
	IF YOU USE OR DISTRIBUTE OR CONVEY XANJAX YOU ARE LEGALLY BOUND BY ITS LICENCE.

	YOU MUST Comply with Copyright and Trademark Rights. DO NOT REMOVE THIS NOTICE */

var rootPath="";// optional extended path to site-root; usually empty string.

xanWrap("http://"+location.hostname+"/"+rootPath);// prevent non http injection attack

function xanWrap(siteRoot){ // only javascript enabled browsers can apply xanjax wrapper
if(location.href.charAt(siteRoot.length)!="#"){
 var xanPath=siteRoot+"#";
 xanPath+=location.href.split(siteRoot)[1].replace(/\/$/,"/~").replace("?","~").replace("#","!");
 if(navigator.userAgent.match(/webkit/i))
  location.assign(xanPath);			// avoid WebKit location.replace bug
 else location.replace(xanPath);// everyone else works normally
}}
