function subs_hover(el, clsname){
	var l = clsname.length + 3;
	var pos;
	if(el && (pos = el.className.indexOf(clsname + '_na')) != -1){
		el.className = el.className.substring(0, pos) + ' ' + clsname + '_a ' + el.className.substring(pos + l);
	}
}
function subs_unhover(el, clsname){
	var l = clsname.length + 2;
	var pos;
	if(el && (pos = el.className.indexOf(clsname + '_a')) != -1){
		el.className = el.className.substring(0, pos) + ' ' + clsname + '_na ' + el.className.substring(pos + l);
	}
}            	
function f_flyout(d){
	document.getElementById('footer_flyout').style.display = d;
}

function popupi_img(img_url, width, height){
	var pos_x = (screen.width - width) / 2;
	var pos_y = (screen.height - height) / 2;
	window.open('/view.php?f=' + img_url, '', 'width=' + width + ', height=' + height + ', scrollbars=0, menubar=0, status=1, toolbar=0, left=' + pos_x + ', screenX=' + pos_x + ', top=' + pos_y + ', screenY=' + pos_y);
	return false;
}

var _ip_default_answer, _ip_content;
function ip_show_answer(el){
	if(!_ip_content)
		_ip_content = document.getElementById('ip_content');
	if(!_ip_default_answer)
		_ip_default_answer = _ip_content.firstChild.cloneNode(true);
	var cur_answer = el.lastChild.cloneNode(true);
	_ip_content.removeChild(_ip_content.firstChild);
	_ip_content.appendChild(cur_answer);
	_ip_content.lastChild.style.display='block';
}
function ip_default_answer(){
	if(!_ip_content)
		_ip_content = document.getElementById('ip_content');
	if(!_ip_default_answer)
		_ip_default_answer = _ip_content.firstChild.cloneNode(true);
	_ip_content.removeChild(_ip_content.firstChild);
	_ip_content.appendChild(_ip_default_answer);
}