function urldecode(str)
{
	var i,temp;
	var result="";
	for(i=0;i<str.length;i++)
	{
		if(str.charAt(i)=="%")
		{
			if(str.charAt(++i)=="u")
			{
				temp=str.charAt(i++) + str.charAt(i++) + str.charAt(i++) + str.charAt(i++) + str.charAt(i);
				result += unescape("%" + temp);
			}
			else
			{
				temp = str.charAt(i++) + str.charAt(i);
				if(eval("0x"+temp)<=160)
				{
					result += unescape("%" + temp);
				}
				else
				{
					temp += str.charAt(++i) + str.charAt(++i) + str.charAt(++i);
					result += Decode_unit("%" + temp);
				}
			}
		}
		else
		{
			result += str.charAt(i);
		}
	}
	return result;
}

function Decode_unit(str)
{
	var p,q = "";
	if(str.GetCount("%")!=2) return str;
	p=eval("0x" + str.split("%")[1]);
	q=eval("0x" + str.split("%")[2]);
	if(p<160 || q<160) return unescape(str);
	str=str.replace(/%/g,"");
	execScript("temp=&H"+str, "vbscript");
	execScript("result=chr("+temp+")", "vbscript");
	return result;
}


String.prototype.GetCount = function(str,mode)
{ 
	return eval("this.match(/("+str+")/g"+(mode?"i":"")+").length"); 
}