var scripts = document.getElementsByTagName('script');
var myScript = scripts[ scripts.length - 1 ];

var queryString = myScript.src.replace(/^[^\?]+\??/,'');

var params = parseQuery( queryString );

function parseQuery ( query ) {
   var Params = new Object ();
   if ( ! query ) return Params; // return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

username = params['username'];
country = params['c'];
username = username.toString();
usernamelength = username.length; 

stroutput = "";
for (i = 0; i < usernamelength; i++) {
	letter = username.substr(i,1);
	if (letter != "_" && letter != "-" && letter != "!" && letter != " ") {
		stroutput = stroutput+"<img src=""http://i.hincity.com/media/license/"+country+"/"+letter+".gif"" border=""0"">";
	}
}

if (country == "us") {
	document.write("<table border=""0"" cellpadding=""0"" cellspacing=""0"" bgcolor=""#CECDD2""><tr><td rowspan=""4""><img src=""http://i.hincity.com/media/license/us/left.gif""></td><td colspan=2 background=""http://i.hincity.com/media/license/us/top.gif""><img src=""http://i.hincity.com/media/license/us/space.gif"" width=""1"" height=""7""></td><td rowspan=""4""><img src=""http://i.hincity.com/media/license/us/right.gif""></td></tr><tr><td align=""center"" colspan=""2""><table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr valign=""top""><td><img src=""http://i.hincity.com/media/license/us/space.gif"" width=""23"" height=""12"" border=""0""></a></td><td align=center><a href=http://hincity.com/"+username+"><img src=""http://i.hincity.com/media/license/us/logo.gif"" border=""0"" alt=""Online Showoff""></td><td align=""right""><img src=""http://i.hincity.com/media/license/us/year.gif"" border=""0""></td></tr></table></td></tr><tr><td colspan=""2"" align=""center""><nobr><a href=""http://hincity.com/"+username+""">"+stroutput+"</a></nobr></td></tr><tr><td colspan=""2"" background=""http://i.hincity.com/media/license/us/bottom.gif""><img src=""http://i.hincity.com/media/license/us/space.gif"" width=""1"" height=""10""></td></tr></table>")
} else {
	document.write("<table height=73 border=0 cellpadding=0 cellspacing=0><tr><td rowspan=4><img src=http://i.hincity.com/media/license/jp/japan_01.gif></td><td colspan=2 background=http://i.hincity.com/media/license/jp/japan_02.gif><img src=http://i.hincity.com/media/license/jp/space.gif width=1 height=5></td><td rowspan=4><img src=http://i.hincity.com/media/license/jp/japan_03.gif></td></tr><tr><td align=center colspan=2 bgcolor=#FFFFFF><a href=http://hincity.com/"+username+"><img src=http://i.hincity.com/media/license/jp/japan_04.gif border=0></a></td></tr><tr><td colspan=2 bgcolor=#FFFFFF><nobr><a href=http://hincity.com/"+username+"><img src=http://i.hincity.com/media/license/jp/space.gif width=7 border=0>" + stroutput + "<img src=http://i.hincity.com/media/license/jp/space.gif border=0></a></nobr></td></tr><tr><td colspan=2 background=http://i.hincity.com/media/license/jp/japan_07.gif><img src=http://i.hincity.com/media/license/jp/space.gif width=1 height=6></td></tr></table>");
}