﻿
var xmlHttp
function showCustomer(id,pn)
{ 
document.getElementById("pl").innerHTML="<img src=images/ajax.gif>"

var url="pl.asp?sid=" + Math.random() + "&q=" + id+ "&pageno=" + pn
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 
function showCustomer1(id,a,b)
 { 
var url="pl1.asp"
xmlHttp=GetXmlHttpObject(stateChanged1);
xmlHttp.open("POST", url , false);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send("sid=" + Math.random()+"&q=" + id+ "&a=" + escape(a)+ "&b=" + b);
showCustomer(id,1);
document.getElementById("s_con").style.display="none";
document.all("content").value="";
}
function showCustomers(id,o_name)
 { 
var url="pls.asp"
xmlHttp=GetXmlHttpObject(stateChangeds);
xmlHttp.open("POST", url , false);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send("sid=" + Math.random()+"&id=" + id+ "&o_name=" + escape(o_name));
}

function showCustomerd(o_name,o_pass)
 { 
 if (o_name=="")
 {
	document.getElementById("error").innerHTML="ཐོ་མིང་ཁྱེར་ཤོག";
	return false;
 }
 if (o_pass=="")
 {
	document.getElementById("error").innerHTML="གསང་གྲངས་ཁྱེར་ཤོག";
	return false;
 }
var url="pll.asp"
xmlHttp=GetXmlHttpObject(stateChangedd);
xmlHttp.open("POST", url , false);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send("sid=" + Math.random()+"&o_name=" + escape(o_name)+ "&o_pass=" + escape(o_pass));
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var a;
a=xmlHttp.responseText;
document.getElementById("pl").innerHTML=a
} 
}
function stateChangeds() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var as;
as=xmlHttp.responseText;
if (as=="error")
{ 
alert('སྔར་ལེགས་འདེམ་བྱས་ཟིན།')
return false;
}
else
{
document.getElementById("up").innerHTML=as
}
} 
}

function stateChangedd() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var ad;
ad=xmlHttp.responseText;
if (ad=="ok")
{ 
window.location.reload(); 

return false;
}
else
{
document.getElementById("error").innerHTML="མིང་ངམ་གསང་གྲངས་ནོར་འདུག";
return false;
}
} 
}


function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
} 
}
function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return; 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"

if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 

