/*
 *	Copyright (c) 2010 Two Front Productions
 *	www.twofront.com
 *	
 *	This software is not permitted to be copied, modified, merged, published, 
 *	distributed, sublicensed, or sold by anyone other than the copyright
 *	holder(s).  Use of this software is subject to the following conditions:
 *	
 *	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *	THE SOFTWARE.
 */

var touchDevice=false;function _tfhelperinitialize(){try{document.createEvent("TouchEvent");touchDevice=true}catch(a){touchDevice=false}}_tfhelperinitialize();var touchReplacements={mousedown:"touchstart",mouseup:"touchend",click:"touchend",mousemove:"touchmove"};function TFListener(c,e,f,b){this.add=d;this.remove=a;function d(){if(c.addEventListener){c.addEventListener(e,f,b)}else{if(c.attachEvent){c.attachEvent("on"+e,f)}}}function a(){if(c.addEventListener){c.removeEventListener(e,f,b)}else{if(c.attachEvent){c.detachEvent("on"+e,f)}}}if(typeof(b)=="undefined"){b=false}if(touchDevice&&touchReplacements[e]){e=touchReplacements[e]}d();return this}function TFHttpRequest(a,d,c,f){var e;if(window.XMLHttpRequest){e=new XMLHttpRequest()}else{e=new ActiveXObject("Microsoft.XMLHTTP")}if(a=="POST"){e.open("POST",d,false);for(var b in f){e.setRequestHeader(b,f[b])}e.send("time="+Number(new Date())+"&"+c)}else{e.open("GET",d+"?"+c+"&time="+Number(new Date()),false);for(var b in f){e.setRequestHeader(b,f[b])}e.send("")}return e}function getOffset(b){var a={};a.left=b.offsetLeft;a.top=b.offsetTop;while(b.parentNode.nodeName.toUpperCase()!="BODY"){b=b.parentNode;if(b.nodeName.toUpperCase()!="TD"){a.left+=b.offsetLeft;a.top+=b.offsetTop}}return a}function setCookie(a,d,b){var e=new Date();e.setDate(e.getDate()+b);var c=escape(d)+((b==null)?"":"; expires="+e.toUTCString());document.cookie=a+"="+c};
