function goto_page(pgno)
{
	document.frm.javapgno.value=pgno;
	document.frm.javafunctionname.value="Pageclick";
	document.frm.submit();
}

function filterme()
{
	document.frm.javafunctionname.value="filter";
	document.frm.submit();
}

function sortme(sortby,sorttype)
{
	document.frm.javafunctionname.value="sort";
	document.frm.javasortby.value=sortby;
	document.frm.javasorttype.value=sorttype;
	document.frm.submit();
}

function emoticon(text)
{
	if (document.post.message.createTextRange && document.post.message.caretPos)
	{
		var caretPos = document.post.message.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == " " ? text + " " : text;
		document.post.message.focus();
	}
	else
	{
		document.post.message.value  += text;
		document.post.message.focus();
	}
}

function checkName()
{
	if (document.save.search_name.value=="" || document.save.search_name.value=="<search name>")
	{
		alert ("Please Enter Search Name")
		return false
	}
	return true
}

function deleteItem(item_id, page)
{
	if(confirm('"."Are you sure? All member data will be removed"."'))
	{
		document.location.href="main.php?service="+page+"&del_id="+item_id
	}
}

function goBottom()
{
	parent.IM.scrollTo(0,500);
}

window.name = 'my_chat';
var buttonCaption = 'Send';
var buddyListWidth = 200;
var buddyListHeight = 400;

var isRefreshing = false;

var chatWindowWidth = 595;
var chatWindowHeight = 470;
var liveVideoHeight = 100;

function check_room_pwd(form_name, room_id)
{
	if(form_name.room_pswd.value == ""){
alert('Please input password');
}
	else
	{
		var chatWnd = openNewWindow('chat.php?room_id=' + room_id + '&room_pswd=' + form_name.room_pswd.value, 0, 0);
	}
}

function refreshChatWindow(room_id)
{
	isRefreshing = true;
	window.refr.document.location.href = 'refresh_chat.php?room_id='+room_id;
}

function openNewWindow(wnd_link, wnd_width, wnd_height, title, livechat)
{
	width = chatWindowWidth;
	height = chatWindowHeight;
	if(livechat)
	{
		height = height + liveVideoHeight;
	}
	if(title == '')
	{
		title = 'my_chat'
	}
	var left = parseInt(screen.availWidth - wnd_width - 60 - buddyListWidth);
	var top = 50;
	var chatWnd = window.open(wnd_link, title,'scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,width='+595+',height='+470+',left=' + left +',top=' + top + '')
	return chatWnd;
}