/* *From MooTools 1.1* 
	window.ie - is internet explorer (any).
	window.ie6 - is internet explorer 6.
	window.ie7 - is internet explorer 7.
	window.gecko - is Mozilla/Gecko.
	window.webkit - is Safari/Konqueror.
	window.webkit419 - is Safari2 / webkit till version 419.
	window.webkit420 - is Safari3 (Webkit SVN Build) / webkit over version 419.
	window.opera - is set to true by opera itself.
*/
window.xpath = !!(document.evaluate);
if (window.ActiveXObject) window.ie = window[window.XMLHttpRequest ? 'ie7' : 'ie6'] = true;
else if (document.childNodes && !document.all && !navigator.taintEnabled) window.khtml = window.webkit = window[window.xpath ? 'webkit420' : 'webkit419'] = true;
else if (document.getBoxObjectFor != null) window.gecko = true;

/* WS Modules */
if(!window.WS){window.WS={};}

/* WS.classFunctions Version 0.92 - Glenn Baker - includes addClass, removeClass, hasClass, toggleClass and replaceClass */
WS.classFunctions={addClass:function(t, c){var p=new RegExp("(^|)"+c+"(|$)");if(!p.test(t.className)){if(t.className==""){t.className=c;}else{t.className+=" "+c;}}return true;},removeClass:function(t, c){var removedClass=t.className;var p=new RegExp("(^|)"+c+"(|$)");removedClass=removedClass.replace(p, "$1");removedClass=removedClass.replace(/$/, "");t.className=removedClass;return true;},replaceClass:function(t, prec, c){removeClass(t,prec);addClass(t,c);},toggleClass:function(t, c){if(hasClass(t,c)){removeClass(t,c);}else{addClass(t,c);}},hasClass:function(t, c){var p=new RegExp("(^|)"+c+"(|$)");return p.test(t.className);},init:function(){for(n in this){window[n]=this[n]}}};WS.classFunctions.init();

/* WS.addLoadListener Version 0.8 - Glenn Baker */
WS.addLoadListener=function(fn){if(typeof window.addEventListener!='undefined'){window.addEventListener('load',fn,false);}else if(typeof document.addEventListener!='undefined'){document.addEventListener('load',fn,false);}else if(typeof window.attachEvent!='undefined'){ window.attachEvent('onload',fn);}else{var oldfn=window.onload;if(typeof window.onload!='function'){window.onload=fn;}else{window.onload=function(){oldfn();fn();};}}};
WS.addDOMLoadListener=function(fn){if(!window.DOM_FUN){var domload=function(){if(arguments.callee.d){return;}arguments.callee.d=true;if(window.DOM_FUN_TIMEOUT){clearInterval(window.DOM_FUN_TIMEOUT);window.DOM_FUN_TIMEOUT=null}for(var i=0;i<window.DOM_FUN.length;i++){window.DOM_FUN[i]()}window.DOM_FUN=null;};if(document.addEventListener){document.addEventListener("DOMContentLoaded",domload,false);}/*@cc_on @*//*@if (@_win32)document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");var s=document.getElementById("__ie_onload");s.onreadystatechange=function(){if(this.readyState=="complete"){domload();}};/*@end @*/if(/WebKit/i.test(navigator.userAgent)){window.DOM_FUN_TIMEOUT=setInterval(function(){if(/loaded|complete/.test(document.readyState)){domload()}},10)}this.addLoadListener(domload);window.DOM_FUN=[];}window.DOM_FUN.push(fn)};

/* Bind */
WS.bind=function(fn){var args=[];for(var n=1;n<arguments.length;n++){args.push(arguments[n]);}return function(){return fn.apply(this,args);};};
