﻿// JScript File

var xmlHttp
var str
//var str1
//function showStock1()

//{
////alert("Hello"); 
//  str1 = document.form1.selectto.value;
//    xmlHttp=GetXmlHttpObject();
//    if (xmlHttp==null)
//  {
// 
//  alert ("Your browser does not support AJAX!");
//  return;
//  } 

//var url="location.aspx";
//url=url+"?q1="+str1;
//url=url+"&sid1="+Math.random();
//xmlHttp.onreadystatechange=stateChanged;
//xmlHttp.open("GET",url,true);
//xmlHttp.send(null);
//}
function showStock()
{ 
 
if (document.form1.pinno.value == "")
{
document.getElementById("ag_details").innerHTML = "Please enter area pin code"
return false;
}
if (isNaN(document.form1.pinno.value))
{
document.getElementById("ag_details").innerHTML = "Please enter valid area pin code"
return false;
}

document.getElementById("ag_details").innerHTML = '<img src="../../images/loading[1].gif">';


  str = document.form1.pinno.value;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
  {
 
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="Find_advisor_Disp.aspx";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
//changes
//if(document.getElementById("tcontent2").style.visibility=='visible')
//{
//document.getElementById("add").style.visibility='Hidden';
//document.getElementById("ag_details").style.visibility=='visible'; 
//}
//if(document.getElementById("tcontent1").style.visibility=='visible')
//{
//document.getElementById("add").style.visibility='visible';
//document.getElementById("ag_details").style.visibility=='Hidden'; 
//}

//end changes
//document.getElementById("add").innerHTML=xmlHttp.responseText;
document.getElementById("ag_details").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;
}