 function GetXmlHttp(){
	var A=null; 
	try { 
		A=new ActiveXObject("Msxml2.XMLHTTP"); 
	}catch(e){ 
		try{ 
			A=new ActiveXObject("Microsoft.XMLHTTP"); 
		}catch(oc){ 
			A=null;
		}
	} 
	if ( !A && typeof XMLHttpRequest != "undefined" ){ 
		A=new XMLHttpRequest() ;
	} 
	return A ;
}

function MySSOApp(token){
	var Xttp=GetXmlHttp();
	var sURL='api/sso.php?nekot='+token+'&k='+Math.random();
	Xttp.open("GET", sURL, true);
	Xttp.onreadystatechange = function(){
		if (Xttp.readyState == 4 && Xttp.status==200 ){
			if(Xttp.responseText.indexOf("op=logout")>0){
					window.location.reload();
			}else{
				$('umenu').innerHTML=Xttp.responseText;
			}
		}
	};
	Xttp.send(null);
}

function LoadJS( fileUrl ,id) { 
    var scriptTag = document.getElementById( id ); 
    var oHead = document.getElementsByTagName('HEAD').item(0); 
    var oScript= document.createElement("script"); 
    if ( scriptTag  ) oHead.removeChild( scriptTag  ); 
    oScript.id = id; 
    oScript.type = "text/javascript"; 
    oScript.src=fileUrl ; 
    oHead.appendChild( oScript); 

} 