﻿
var xmlHttp
var loadstatustext="<p dir=rtl><FONT face=\"Tahoma\" size=\"2\"> لطفا صبر کنید ... </FONT><img src='images/loading.gif'/></p><br>"

function showHint(str,no)
{
if (str.length==0)
{ 
	document.getElementById("gridHint").innerHTML=""
	return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
	alert ("Browser does not support HTTP Request")
	return
} 
//var url="http://www.sahambarez.com/gethintnerkh.aspx"
var url="../gethintnerkh.aspx"
url=url+"?q="+str+"&n="+no
document.getElementById("gridHint").innerHTML=loadstatustext
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("gridHint").innerHTML=xmlHttp.responseText 
	} 
} 
// ----------------------------------------------------------------------------- //
//function showReportNCH(str,ds,de,cd)
// -------------------------------- //
function showReportNCH(str,params,ds,de,cd)
{

if (str.length==0)
	{ 
		document.getElementById("NerkhChHint").innerHTML=""
		return
	}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
var url = str
if (cd != "")
{
	url= url + "?" + params + "=" + encodeURIComponent(ds)+ "&dateE=" + encodeURIComponent(de) + "&cCode=" + encodeURIComponent(cd)
}
document.getElementById("NerkhChHint").innerHTML = loadstatustext
xmlHttp.onreadystatechange = stateChangedReportCH
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChangedReportCH() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("NerkhChHint").innerHTML = xmlHttp.responseText 
		} 
} 
// ----------------------------------------------------------------------------- //

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
///////////////////////////
function showReport(str,params,cd)
{

if (str.length==0)
{ 
document.getElementById("tableHint").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=str
if (params != "")
{
url = url + "?" + params + "=" + encodeURIComponent(cd)
}
document.getElementById("tableHint").innerHTML=loadstatustext
xmlHttp.onreadystatechange=stateChangedReport 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChangedReport() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("tableHint").innerHTML=xmlHttp.responseText 
} 
}
// ------------------------------------------------------------ // 