function submit_form()
{
	var frm = document.frm;
	
	if (chkTxbNull(frm.tbxName, "Please enter Name.")) return;
	if (chkTxbNull(frm.tbxEmail, "Please enter E-Mail.")) return;
	if (chkTxbNotEmail(frm.tbxEmail, "Please enter valid E-Mail.")) return;
	if (chkTxbNull(frm.tbxMessage, "Please enter Message.")) return;
	
	frm.submit();
}

function change_gender(sValue)
{
	var frm = document.frm;
	
	window.location.href = "?bid=" + frm.bid.value + "&g=" + sValue;
}

function sort_by(sValue)
{
	var frm = document.frm;
	
	if (sValue == "name")
	{
		window.location.href = "?bid=" + frm.bid.value + "&g=" + frm.g.value + "&sort=name";
	}
	else
	{
		window.location.href = "?bid=" + frm.bid.value + "&g=" + frm.g.value + "&sort=date";
	}
}

function change_language(sValue)
{
	var url = window.location.href;
	
	if (url.lastIndexOf("/th/") != -1)
	{
		if (sValue == "th")
		{
			window.location.href = url.substring(url.lastIndexOf("/") + 1);
		}
		
		if (sValue == "en")
		{
			window.location.href = "../" + url.substring(url.lastIndexOf("/") + 1);
		}
	}
	else
	{
		if (sValue == "th")
		{
			window.location.href = "th/" + url.substring(url.lastIndexOf("/") + 1);
		}
		
		if (sValue == "en")
		{
			window.location.href = url.substring(url.lastIndexOf("/") + 1);
		}
	}
}

function change_year(sValue)
{
	var frm = document.frm;
	
	window.location.href = "?y=" + sValue;
}