function trim(vInString)
{
    var strTemp = "" + vInString + "";
	while(strTemp.charAt(0) == " ")
	{
		strTemp = strTemp.substring(1);
	}
	while(strTemp.charAt(strTemp.length-1) == " ")
	{
		strTemp = strTemp.substring(0,strTemp.length-1);
	}
	return strTemp;
}

function isEmail(vEMail) {
		var regInvalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
		var regValid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
		return (!regInvalid.test(vEMail)&&regValid.test(vEMail));
}

function vMTVSearch() {
	if (trim(document.mtv_search.search_value.value) == "") {
		alert("ÄúÒªËÑÊ²Ã´£¿");
		document.mtv_search.search_value.select();
		return false;
	}
	return true;
}
function vSendSearch() {
	if (trim(document.send_search.send_value.value) == "") {
		alert("ÄúÒªËÑÊ²Ã´£¿");
		document.send_search.send_value.select();
		return false;
	}
	return true;
}

function PlayMTV(id) {
	window.open('/MediaPlayer.asp?id=' + id,'','fullscreen=0,scrollbars=0,width=395,height=363');
}

function PlaySendMTV(id) {
	window.open('/MediaPlayer_1.asp?id=' + id,'','fullscreen=0,scrollbars=0,width=395,height=385');
}

function SendSong(id) {
	window.open("/SendSong.asp?id=" + id,"","width=400, height=290");
	//window.open("/SendSong.asp?id=" + id,"","width=400, height=405");
}

function GetPassword() {
	window.open("/sms/GetPassword.htm","","width=300, height=100");
}
function ChangePassword() {
	window.open("/sms/ChangePassword.htm","","width=300, height=210");
}

function ChooseWords() {
	window.open("/SendSongWords.asp","","width=420, height=300, scrollbars=1");
}