if (navigator.appName != "Netscape") {
	pr_IE = 1;
} else {
	pr_IE = 0;
}
var user_info_arr_nick = new Array();
var user_info_arr_text = new Array();
function user_info_creat(sug) {
	var table = '';
	if (sug.length>0) {
		table = '<table cellspacing="2" cellpadding="2" border="0"><tr valign="top">';
		if (sug[10]!='') table += '<td rowspan="10" width="50"><img src="http://i.sakh.name/user_photos/s/'+sug[10].substr(0,1)+'/'+sug[10].substr(1,1)+'/'+sug[10]+'.jpg" alt="" border=0></td>';
		table += '<td width="50" class="small">Ник:</td><td class="'+sug[3]+'" nowrap>'+sug[2]+'&nbsp;<img src="http://sakhalin.name/i/pol_'+sug[3]+'.gif" border="0"></td>';
		if (sug[0]!='') table += '<td rowspan="10" width="50"><img src="http://i.sakh.name/a/'+sug[9]+'/'+sug[0]+'?nc='+sug[1]+'" alt="Аватара" border=0></td>';
		if (sug[5]!='') table += '<tr><td width="50" class="small">Имя:</td><td nowrap>'+sug[5]+'</td></tr>';
		if (sug[6]!='') table += '<tr><td class="small">Дата<br>рождения:</td><td nowrap>'+sug[6]+'</td></tr>';
		if (sug[7]!='') table += '<tr><td class="small">Город:</td><td nowrap>'+sug[7]+'</td></tr>';
		if (sug[8]!='') table += '<tr><td class="small">Родной город:</td><td nowrap>'+sug[8]+'</td></tr>';
		if (sug[13]!=0) table += '<tr><td class="small">Фотографий:</td><td>'+sug[13]+'</td></tr>';
		if (sug[15]==1) table += '<tr><td class="small">Авто:</td><td>'+sug[14]+'</td></tr>';
		if (sug[15]>1) table += '<tr><td class="small" colspan="2">Мои авто:<br>'+sug[14]+'</td></tr>';
		table += '<tr><td width="50" class="small">Дата<br>регистрации:</td><td nowrap>'+sug[4]+'</td></tr>';
		table += '<tr><td class="small" colspan="2"><hr color="#cccccc" size="1" />Рейтинг:&nbsp;<span class="'+(sug[16]<0?'err':'ok')+'" nowrap>'+(sug[16]>0?'+':'')+sug[16]+'</span>&nbsp;&nbsp;';
		table += 'Репутация:&nbsp;<span class="'+(sug[17]<0?'err':'ok')+'" nowrap>'+(sug[17]>0?'+':'')+sug[17]+'</span></td></tr>';
		table += '</table>';
	} else {
		table = '&nbsp;';
	}
	return table;
}
function load_user_info(nick) {
	var load = true;
	for (i=0;i<user_info_arr_nick.length;i++) {
		if (nick==user_info_arr_nick[i]) {
			load = false;
			document.getElementById('user_info').innerHTML = user_info_arr_text[i];
			break;
		}
	}
	if (load==true) {
		document.getElementById('user_info').innerHTML = '<b>Информация о пользователе</b><br><br><img src="http://i.sakh.com/forum/loading.gif" width="13" height="13"> загрузка...';
		i++;
		var req_info = new JsHttpRequest();  
		req_info.onreadystatechange = function() { 
	        if (req_info.readyState == 4) { 
	        	if (req_info.responseText!='') {
	        		document.getElementById('user_info').innerHTML = req_info.responseText;
	        		user_info_arr_nick[i] = nick;
	        		user_info_arr_text[i] = req_info.responseText;
	        	} else if (req_info.responseJS!='') {
	        		cnt = user_info_creat(eval(req_info.responseJS));
	        		document.getElementById('user_info').innerHTML = cnt;
	        		user_info_arr_nick[i] = nick;
	        		user_info_arr_text[i] = cnt;
	        	}
	        }
	    }
	    req_info.open('GET', 'http://forum.sakh.com/js_user_info.php', true);
	    req_info.send({ q: nick });
	}
	return false;
}
active_u_i = 0;
function ShowUserInfo(el, nick) {
	HideUserInfo();
	active_u_i = 1; 
	if (pr_IE) {
		x = window.event.clientX;
		y = window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	} else {
		x = el.pageX;
		y = el.pageY;
	}
	if (x<270) x=0;
	document.getElementById('user_info').style.left = x+20+'px';
	document.getElementById('user_info').style.top = y+5+'px';
	setTimeout('if(active_u_i==1){document.getElementById(\'user_info\').style.visibility = "visible";}',700);
	load_user_info(nick);
}
function HideUserInfo(){
	active_u_i = 0;
	document.getElementById('user_info').innerHTML = '';
	document.getElementById('user_info').style.visibility = "hidden";
	document.getElementById('user_info').style.left = 0+'px';
	document.getElementById('user_info').style.top = 0+'px';
}