function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);
	//alert(newstr)
    return newstr;
}


function replace_percent_char(txt) {
		txt=replace(txt,'_','%5F')
		txt=replace(txt,'&','%26')
		txt=replace(txt,'.','%2E')
		txt=replace(txt,'@','%40')
		txt=replace(txt,'-','%2D')
		txt=replace(txt,'/','%2F')
		return txt
	}
function open_profil(val) {
	o_url=location.href
	o_url=replace_percent_char(o_url)
	//alert(o_url);
	url="../show_profil.cfm?user_id="+val+"&page="+o_url
	//alert(location.href)
	profil=window.open(url,"play","toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=no,top=50,left=50,height=620,width=545")
	profil.focus()
}