
//code from http://www.netlobo.com/url_query_string_javascript.html
//additional info from http://www.eggheadcafe.com/articles/20020107.asp

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

if( location.search != null ) {
  var bid_param = gup('bid');
  if (bid_param == "") { bid_param = "aat"; }
  var hurl_param = "http://" + location.host + "/" + bid_param;
	document.getElementById('chref').href = hurl_param + "-c.br" + location.search;
	document.getElementById('fhref').href = hurl_param + "-f.br" + location.search;
	document.getElementById('hhref').href = hurl_param + "-h.br" + location.search;
	document.getElementById('hlogohref').href = hurl_param + "-h.br" + location.search;

}
