var addDOMLoadEvent=(function(){var e=[],t,s,n,i,o,d=document,w=window,r='readyState',c='onreadystatechange',x=function(){n=1;clearInterval(t);while(i=e.shift())i();if(s)s[c]=''};return function(f){if(n)return f();if(!e[0]){d.addEventListener&&d.addEventListener("DOMContentLoaded",x,false);/*@cc_on@*//*@if(@_win32)d.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");s=d.getElementById("__ie_onload");s[c]=function(){s[r]=="complete"&&x()};/*@end@*/if(/WebKit/i.test(navigator.userAgent))t=setInterval(function(){/loaded|complete/.test(d[r])&&x()},10);o=w.onload;w.onload=function(){x();o&&o()}}e.push(f)}})();
function addEvent(obj,type,fn){if(obj.addEventListener)obj.addEventListener(type,fn,false);else if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event)};obj.attachEvent("on"+type,obj[type+fn])}}
function removeEvent(obj,type,fn){if(obj.removeEventListener)obj.removeEventListener(type,fn,false);else if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;obj["e"+type+fn]=null}}
function httpRequest(url,callback,data){var httpObj=false;if(typeof XMLHttpRequest!='undefined'){httpObj=new XMLHttpRequest()}else if(window.ActiveXObject){try{httpObj=new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{httpObj=new ActiveXObject('iMicrosoft.XMLHTTP')}catch(e){}}}if(!httpObj)return;httpObj.onreadystatechange=function(){if(httpObj.readyState==4){callback(httpObj.responseText)}};httpObj.open(data ? 'POST' : 'GET',url,true);httpObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');httpObj.send(data)}
function $(id){if(document.getElementById)return document.getElementById(id)}
function preventDefault(e){e=e||window.event;if(e.preventDefault)e.preventDefault();e.returnValue=false}