function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function mnumSave(mnum,spath)
{
    // alert(bpath);
    var oHTTPRequest = CreateXmlHttpRequestObject();
    if (oHTTPRequest) {
        oHTTPRequest.onreadystatechange = function() 
            {
                // only if req shows "complete"
                if (oHTTPRequest.readyState == 4)
                {
                    // only if "OK"
                    if (oHTTPRequest.status == 200) 
                    {
			return;
                    }
                }
		// t=setTimeout('mnumSave('+mnum+')', 500);
            };
	}
            
        oHTTPRequest.open("GET", spath + "/bc/MNS.asp?mn=" + mnum, true);
        oHTTPRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
	oHTTPRequest.setRequestHeader("Content-Length", 0);
        oHTTPRequest.send();
}


function dses(spath)
{
    var oHTTPRequest = CreateXmlHttpRequestObject();
    if (oHTTPRequest) {
        oHTTPRequest.onreadystatechange = function() 
            {
                // only if req shows "complete"
                if (oHTTPRequest.readyState == 4)
                {
                    // only if "OK"
                    if (oHTTPRequest.status == 200) 
                    {
			// alert('123');
			return;

                    }
                }
		// t=setTimeout('dses()', 1000);
            };
	}
            
        oHTTPRequest.open("GET", spath + "/bc/DS.asp", true);
	oHTTPRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
        oHTTPRequest.send();
}

function mns(spath, cn)
{
	var objID = document.getElementById(cn);
	if (null != objID )
	{
		var nID = objID.innerHTML;
		if (nID != '')
		{	
			mnumSave(nID, spath);
			return;
		}
	}
	t=setTimeout('mns("' + spath + '", "' + cn + '")', 200);
}
