var async=function(){
        var xmlHttp;
        var o;
        var rText=function(){
                if(xmlHttp.readyState==4){
                        if(xmlHttp.status==200){
                                o.innerHTML=xmlHttp.responseText;
                        }
                }
        };
        var rTrn=function(){
                if(xmlHttp.readyState==4){
                        if(xmlHttp.status==200){
                                return xmlHttp;
                        }
                }
        };
        var gXho=function(x){
               	if(window.ActiveXObject){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
               	}else if(window.XMLHttpRequest){
			xmlHttp=new XMLHttpRequest();
		}
		if(x=="return"){
			return xmlHttp;
		}
        };
        return{
		get:function(url,fnc,cb,ob){
			if(fnc=="return"){
				xmlHttp=gXho('return');
				return xmlHttp;
			}else{
				gXho('');
				if(fnc=='text'){
					if(cb!=''){
						o=document.getElementById(cb);
					}
					xmlHttp.onreadystatechange=rText;
				}
				xmlHttp.send(null);
			}
		},
                post:function(url,post){
                        createXMLHttpRequest();
                        xmlHttp.open("POST",url);
                        xmlHttp.onreadystatechange=callback;
                        xmlHttp.send(post);
                }
        };
}();

function getElById(id){
	if(document.getElementById){getElById=function(id){return document.getElementById(id);}
	}else if(document.all){getElById=function(id){return document.all[id];}
	}else if(document.layers){getElById=function(id){return document.layers[id];}
	}else{getElById=function(id){return null;}}
	return getElById(id);
}

function execJS(node){
	var bSaf=(navigator.userAgent.indexOf('Safari') != -1);
	var bOpera=(navigator.userAgent.indexOf('Opera') != -1);
	var bMoz=(navigator.appName=='Netscape');

	if(!node)return;

	/* IE wants it uppercase */
	var st = node.getElementsByTagName('SCRIPT');
	var strExec;

	for(var i=0;i<st.length;i++){
		if(bSaf){
			strExec=st[i].innerHTML;
		st[i].innerHTML="";
			}else if(bOpera){
			strExec=st[i].text;
			st[i].text="";
		}else if(bMoz){
			strExec=st[i].textContent;
			st[i].textContent="";
		}else{
			strExec=st[i].text;
			st[i].text="";
		}

		try {
			var x=document.createElement("script");
			x.type="text/javascript";

			/* In IE we must use .text! */
			if((bSaf)||(bOpera)||(bMoz)){
				x.innerHTML=strExec;
			}else{ x.text=strExec;}
			document.getElementsByTagName("head")[0].appendChild(x);
		}catch(e){
			alert(e);
		}
	}
};

var docOnLoadFunc=[];
function addOnLoad(func) {
	docOnLoadFunc[docOnLoadFunc.length]=func;
}
function docOnLoad(){
	var func=null;
	for(var i=0;i<docOnLoadFunc.length;i++){
		func=docOnLoadFunc[i];
		if(func)func();
	}
}

function docOnLoad_Init(func){
	init();
	if(func)func();
}

function init() {
	if(arguments.callee.done) return;
	arguments.callee.done = true;
	docOnLoad();
}

if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);}

// for Internet Explorer (using conditional comments)
/*@cc_on @*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
    if (this.readyState=="complete") {
        init(); // call the onload handler
    }
};
/*@end @*/

winOnLoad=window.onload;
window.onload=function(){docOnLoad_Init(winOnLoad)};

if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            clearInterval(_timer);
            init(); // call the onload handler
        }
    }, 10);
}

