var xmlHttp
//invoice_add(document.form1.cid.value,document.form1.invo.value,document.form1.deptno.value,document.form1.catno.value,document.form1.itemno.value,document.form1.itemname.value,document.form1.qty.value,document.form1.price.value);//,deptno,catno,itemno,itemname,qty,price

function key(word)
//function quiz()
{ 


var url="ajaxjob.php?sid=" + Math.random() + "&word=" + word
xmlHttp=GetXmlHttpObject(nnnnq)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnq() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("result").innerHTML=xmlHttp.responseText 
//document.kashi.reset();
//alert("check_online working ok");
} 
}

/////////////////////////

function category(word)
//function quiz()
{ 


var url="ajaxcat.php?sid=" + Math.random() + "&word=" + word
xmlHttp=GetXmlHttpObject(nnnnq)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnq() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("result").innerHTML=xmlHttp.responseText 
//document.kashi.reset();
//alert("check_online working ok");
} 
}



//////////////////////


/////////////////////////

function jobref(word)
//function quiz()
{ 


var url="ajaxref.php?sid=" + Math.random() + "&word=" + word
xmlHttp=GetXmlHttpObject(nnnnq)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnq() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("result").innerHTML=xmlHttp.responseText 
//document.kashi.reset();
//alert("check_online working ok");
} 
}



//////////////////////

function addfee(cid,refno,sdate,edate)
//function quiz()
{ 


var url="ajaxaddfee.php?sid=" + Math.random() + "&cid=" + cid + "&refno=" + refno + "&sdate=" + sdate + "&edate=" + edate
xmlHttp=GetXmlHttpObject(nnnnqq)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnqq() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("showfee").innerHTML=xmlHttp.responseText 
//document.kashi.reset();
//alert("check_online working ok");
} 
}



function img() 
{ 
 
//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("result").innerHTML="<img src='loading.gif'>" +  "   Please Wait...";
//document.kashi.reset();
//alert("check_online working ok");
 
}








function check_students(id)
//function quiz()
{ 


var url="stusearch.php?sid=" + Math.random() + "&id=" + id
xmlHttp=GetXmlHttpObject(nnnnq1)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnq1() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("stu_id").innerHTML=xmlHttp.responseText 
//document.kashi.reset();
//alert("check_online working ok");
} 
}





















function check_fee(id)
{ 


var url="check_fee.php?sid=" + Math.random() + "&id="  + id
xmlHttp=GetXmlHttpObject(nnnnmm)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nnnnmm() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("check_fee").innerHTML=xmlHttp.responseText 

} 
}




function checkusername(user)
{ 


var url="check_username.php?sid=" + Math.random() + "&user=" + user
xmlHttp=GetXmlHttpObject(username)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function username() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("checkusername").innerHTML=xmlHttp.responseText 

} 
}











function subjectsearch(cid)
{ 


var url="ajaxsubject.php?sid=" + Math.random() + "&cid=" + cid
xmlHttp=GetXmlHttpObject(nn)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nn() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("subject").innerHTML=xmlHttp.responseText 

} 
}

function subjectsearch1(cid)
{ 


var url="ajaxsubject1.php?sid=" + Math.random() + "&cid=" + cid
xmlHttp=GetXmlHttpObject(nn)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nn() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("subject").innerHTML=xmlHttp.responseText 

} 
}




function accesscode1(u,a)
{ 


var url="check_accesscode1.php?sid=" + Math.random() + "&user=" + u + "&acode=" + a 
xmlHttp=GetXmlHttpObject(nn1)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function nn1() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

//document.getElementById("khan").innerHTML=xmlHttp.responseText 
document.getElementById("nn1").innerHTML=xmlHttp.responseText 

} 
}






function check_balance(paid,refno,course_id,tot)
{ 


var url="ajaxfeebalance.php?sid=" + Math.random() + "&paid=" + paid + "&refno=" + refno + "&course_id=" + course_id + "&tot=" + tot
xmlHttp=GetXmlHttpObject(fdd)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function fdd() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("balance").innerHTML=xmlHttp.responseText 

} 
}









function sic_poll(result)
{ 


var url="sic_poll.asp?sid=" + Math.random() + "&result=" + result
xmlHttp=GetXmlHttpObject(poll)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function poll() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("pollresult").innerHTML=xmlHttp.responseText 

} 
}


function dmc(degree)
{ 


var url="kt.asp?sid=" + Math.random() + "&degtype=" + degree
xmlHttp=GetXmlHttpObject(dmcc)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function dmcc() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("dmc").innerHTML=xmlHttp.responseText 

} 
}



















function sic()
{ 


var url="untitled29.asp?sid=" + Math.random() 
xmlHttp=GetXmlHttpObject(sicc)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function sicc() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("sic").innerHTML=xmlHttp.responseText 

} 
}

















//invoice_add(document.form1.cid.value,document.form1.invo.value);

function invoice_add(cid,invo,deptno,catno,itemno,itemname,qty,price,ssid,net)
{ 


var url="invoice_add.php?sid=" + Math.random() + "&cid=" + cid + "&invo=" + invo + "&deptno=" + deptno + "&catno=" + catno + "&itemno=" + itemno + "&itemname=" + itemname + "&qty=" + qty + "&price=" + price + "&ssid=" + ssid + "&net=" + net
xmlHttp=GetXmlHttpObject(invoiceadd)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function invoiceadd() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("invoadd").innerHTML=xmlHttp.responseText 

} 
}

//invo_del(document.form1.id.value)

function invo_del(invoid)
{ 


var url="invoice_del.php?sid=" + Math.random() + "&invoid=" + invoid 
xmlHttp=GetXmlHttpObject(invodel)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function invodel() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("invoadd").innerHTML=xmlHttp.responseText 
//alert("delted");
} 
}





//price_check(this.value,document.form1.cid.value);
function price_check(itemno,cid)
{ 


var url="price_check.php?sid=" + Math.random() + "&itemno=" + itemno + "&cid=" + cid 
xmlHttp=GetXmlHttpObject(pricecheck)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function pricecheck() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("item").innerHTML=xmlHttp.responseText 
} 
}

//---------------------------------------Check Exporter userid-------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------

function dept_insert(str)
{ 


var url="dept_insert.php?sid=" + Math.random() + "&dname=" + str 
xmlHttp=GetXmlHttpObject(dept_ins)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function dept_ins() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 

document.getElementById("deptdiv").innerHTML=xmlHttp.responseText 
} 
}

//-------------------------------------------------------------------------------------------------------------------


//---------------------------------------Check importer userid-------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------

function Checkimpid(str)
{ 
if(str=="")
{
document.getElementById("idcheck").innerHTML = "<span class='remark'>&nbsp;&nbsp;Please choose a Member ID</span>";
form1.username.focus();
}
else
{
var url="ajax_importer.php?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(idChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
} 

function idChanged() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("idcheck").innerHTML=xmlHttp.responseText 
} 
}

//-----------------------------------------------------------------------------------------------------------------delete

function dept_insert(dn)
{ 

var url="dept_insert.php?sid=" + Math.random() + "&dn=" + dn
xmlHttp=GetXmlHttpObject(deptinsert)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function deptinsert() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
document.form1.reset();
} 
}

function dept_update(dno,dn)
{ 

var url="dept_update.php?sid=" + Math.random() + "&dno=" + dno + "&dn=" + dn
xmlHttp=GetXmlHttpObject(deptupdate)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function deptupdate() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Updated Successfully");
document.form1.reset();
} 
}


function dept_del(dno,dn)
{ 

var url="dept_delete.php?sid=" + Math.random() + "&dno=" + dno + "&dn=" + dn
xmlHttp=GetXmlHttpObject(deptdel)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function deptdel() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Deleted Successfully");
document.form1.reset();
} 
}




function css(str)
{ 

var url="cat_search.php?sid=" + Math.random() + "&cname=" + str
xmlHttp=GetXmlHttpObject(iddd)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}


function iddd() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("a2").innerHTML=xmlHttp.responseText 
} 
}
/////////////////de end//////////
function itemsearch(items)
{ 

var url="item_search.php?sid=" + Math.random() + "&itemname=" + items
xmlHttp=GetXmlHttpObject(idms)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}


function idms() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("a3").innerHTML=xmlHttp.responseText 
} 
}

//-----------------------------------------------------------------------------------------------------------------
//-------------------------------------------calling Product's category--------------------------------------------

function item_insert(deptno,cat,itmname,ppric,expense,spric,level)
{ 

//+ "&itemname=" + itemname + "&pp=" + pp + "&sp=" + sp

var url="item_insert.php?sid=" + Math.random() + "&depno=" + deptno + "&cat=" + cat + "&itname=" + itmname + "&pprice=" + ppric + "&expense=" + expense + "&sprice=" + spric + "&level=" + level
xmlHttp=GetXmlHttpObject(insert)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function insert() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("itemd").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
//location.href= 'items.php';
//document.form1.reset();
} 
}

function item_update(deptno,cat,itname,pp,sp,itemno,expense,level)
{ 

//+ "&itemname=" + itemname + "&pp=" + pp + "&sp=" + sp

var url="item_update.php?sid=" + Math.random() + "&depno=" + deptno + "&cat=" + cat + "&itname=" + itname + "&pprice=" + pp + "&sprice=" + sp + "&itemno=" + itemno + "&expense=" + expense + "&level=" + level
xmlHttp=GetXmlHttpObject(iupdate)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function iupdate() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("itemd").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
//location.href= 'items.php';
//document.form1.reset();
} 
}


























function item_delete(deptno,cat,itemno)
{ 

//+ "&itemname=" + itemname + "&pp=" + pp + "&sp=" + sp

var url="item_delete.php?sid=" + Math.random() + "&depno=" + deptno + "&catno=" + cat + "&itemno=" + itemno 
xmlHttp=GetXmlHttpObject(idelete)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function idelete() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("itemd").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
//location.href= 'items.php';
//document.form1.reset();
} 
}







function cat_dept_insert(deptno,catname)
{ 

var url="cat_insert.php?sid=" + Math.random() + "&depno=" + deptno + "&catname=" + catname
xmlHttp=GetXmlHttpObject(catinsert)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function catinsert() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
document.form1.reset();
} 
}

//----------------------------------------------------View Selling 

function cat_dept_update(catno,deptno,catname)
{ 

var url="cat_update.php?sid=" + Math.random() + "&catno=" + catno + "&deptno=" + deptno + "&catname=" + catname
xmlHttp=GetXmlHttpObject(catupdate)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function catupdate() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Saved Successfully");
document.form1.reset();
} 
}

//--------------------------------------------------------------------

function cat_dept_delete(catno,deptno)
{ 

var url="cat_delete.php?sid=" + Math.random() + "&catno=" + catno + "&deptno=" + deptno 
xmlHttp=GetXmlHttpObject(catdelete)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function catdelete() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dept").innerHTML=xmlHttp.responseText 
alert("Record Deleted Successfully");
document.form1.reset();
} 
}
//----------------------


function kashif2()

{ 
var url="add.asp?sid=" + Math.random()
xmlHttp=GetXmlHttpObject(kfff)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
} 

function kfff() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 


document.getElementById("kkk").innerHTML=xmlHttp.responseText 
} 
} 





function cat_search()
{ 

var url="ttt.php?sid=" + Math.random()
xmlHttp=GetXmlHttpObject(ccc)
xmlHttp.open("POST", url , true)
xmlHttp.send(null)
}
 

function ccc() 
{ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("a").innerHTML=xmlHttp.responseText 
//alert("Record Saved Successfully");
//document.form1.reset();
} 
}

//-------------------------------------show CP_product

//--------------------------------------------------------



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
}
} 

