// JavaScript Document

//This can get the querystring paramts
//i.e page.html?Param=1
//QueryString('Param') will return 1
function QueryString(param){

  var begin,end;
  if(self.location.search.length>1)
  {
    begin=self.location.search.indexOf(param) +param.length+1;
    end=self.location.search.indexOf("&",begin);
    if(end==(-1)) end=self.location.search.length;
    return(self.location.search.substring(begin,end));
  }
  else if(self.location.hash.length>1)
  {
    begin=self.location.hash.indexOf(param) +param.length+1;
    end=self.location.hash.indexOf("&",begin);
    if(end==(-1)) end=self.location.hash.length;
    return(self.location.hash.substring(begin,end));
  }
  else return("");

}

//set the Home link image with the right link
function EhorseHomeLink_Aux (is_frame)
{
	var ret='';
	var what = '';
	if (QueryString('New_eHorse')=='1')
	{
		if (is_frame == 1)
		{
			what = 'parent';
		}
		else
		{
			what = 'window';
		}
		ret='<a href="#" onClick="javascript:' + what + '.close();">';
		ret += '<img src="/images/newclose.gif" width="66" height="26" border="0"></a>'
	}
	else
	{
		ret='<a href="/HomeOld.asp" target="_parent">';
		ret += '<img src="/images/Home.gif" width="66" height="26" border="0"></a>'
	}
	
	return ret;
}

function EhorseHomeLink()
{
	return EhorseHomeLink_Aux (0);
}

function EhorseHomeLinkFrame()
{
	return EhorseHomeLink_Aux (1);
}
