<!--script language="JavaScript1.2" type="text/javascript"-->
<!--

function getUrlFromRelativePath(relativePath){

	//get base URL e.g. http://hostname/
	var baseUrlLength = location.href.indexOf(location.host) + location.host.length + 1; 
	var baseUrl = location.href.substr(0,baseUrlLength);
	
	//get app URL e.g. http://hostname/EMOL/
	var appUrlLength = location.href.indexOf("/",baseUrlLength) + 1;
	var appUrl = location.href.substr(0,appUrlLength);
	
	return appUrl + relativePath;

}

function getHostName()
{
    //get base URL e.g. http://hostname/
	var baseUrlLength = location.href.indexOf(location.host) + location.host.length + 1; 
	var baseUrl = location.href.substr(0,baseUrlLength);
	
	return baseUrl.substr(baseUrl.indexOf("//")+2, baseUrl.length - baseUrl.indexOf("//"));
}


/////////////////////////////
//server interfase class 
function SessionControl(){
			
	//constructer     
	var url,xml,xmlhttp;
	
	//properties
	var QueryString;
	
	this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	this.url = getUrlFromRelativePath("Library/SessionControl.aspx");
	this.xml = null;	
	this.QueryString = null;
	
	this.execute = class_execute;
	this.readyStateChangeHandler = class_readyStateChangeHandler;
	this.dispose = class_dispose;
	
	function class_execute(sUserID){		
		this.xmlhttp.open("post", this.url ,false);
		this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlhttp.send(this.QueryString);
		
		this.readyStateChangeHandler();
	}
	
	function class_readyStateChangeHandler(){
	//check document reading status
	if (this.xmlhttp.readyState == 4 && this.xmlhttp.status == 200){
		this.xml = this.xmlhttp.responseText;
		}
	}
	
	function class_dispose(){
		this.xmlhttp = null;
	}
}

function killEnterKey()
{
    if (window.event.keyCode == 13) 
    {
        event.returnValue=false; 
        event.cancel = true;
    }
}

//////////////////////////////////////////////
// Webservice
function initializeService()
{
   service.useService(getUrlFromRelativePath("IncludeLibrary/Services/Master.asmx?WSDL"),"master");
}

-->
<!--/script-->
