var xmlHttp

function getDoc(url, doFunc, id){
    xmlHttp=GetXmlHttpObject();
    xmlHttp.onreadystatechange= function() { 
        if (xmlHttp.readyState==4)
            if (xmlHttp.status==200)
                doFunc(xmlHttp, id);
    }

    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}

function currencyChanged(req, id) {
    document.getElementById(id).innerHTML = req.responseText;
}

function getchange(cid,curate,symbol){
	//url, function, Element id
	getDoc('getrecords.asp?cid='+cid+'&curate='+curate+'&symbol='+symbol, currencyChanged, 'cch');	
	return false;
	
}

function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}


function getrecords(m,d,y){
	
pageurl="getprograms.asp?dt="+m+"/"+d+"/"+y
defaultIframe='<iframe src="about:blank" name="_ddajaxtabsiframe" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" class="tabcontentiframe" style="width:100%; height:360px; min-height: 100px"></iframe>'
document.getElementById("pdetails").innerHTML = defaultIframe;	
window.frames["_ddajaxtabsiframe"].location.replace(pageurl) //load desired page into iframe
}


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;
}
