function setCookie(name, value, expires)
{
	var today = new Date();
	today.setDate( today.getDate() + expires );
	document.cookie = name + '=' + escape( value ) + '; path=/; expires=' + today.toGMTString() + ';';
}

function setListCount(key, value)
{
	setCookie(key, value, 365);
	location.reload();
}

function close_layer_popup(obj)
{
	$('.layer_popup_style').has(obj).remove();
}

function strip_tags(input, allowed) {
	allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
	var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
		 commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
	return input.replace(commentsAndPhpTags, '').replace(tags, function($0, $1){
		return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
	});
}

function sendMessage(id)
{
	showBox('/message/manager/write/send/' + id, 'iframe', 650);
}
