	var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

function PlayCount(song_no,song_type,player){
	var theData = "";
	theData = theData + escape("song_no") + "=" + escape(song_no);
	theData = theData + "&" + escape("song_type") + "=" + escape(song_type);
	theData = theData + "&" + escape("player") + "=" + escape(player);
	xmlhttp.open("POST","/blog/PlayCount.asp");
	xmlhttp.onreadystatechange=GetRsp;
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.Send(theData);
}
function GetRsp(){
	if(xmlhttp.readyState==4){
			//alert(xmlhttp.responseText);
		var xmlDom=new ActiveXObject("MSXML2.DOMDocument")
		try {
				xmlDom.loadXML(xmlhttp.responseText)
				if(xmlDom.childNodes(0).childNodes(0).nodeName == 'err'){
					var nd 
					nd = xmlDom.childNodes(0).childNodes(0)
					alert(nd.selectSingleNode("errmsg").text);
				}else if(xmlDom.childNodes(0).childNodes(0).nodeName == 'msg'){
					var nd 
					var obj = window.dialogArguments
					nd = xmlDom.childNodes(0).childNodes(0)
					//alert(nd.selectSingleNode("Message").text);
					//alert(nd.selectSingleNode("Url").text);
				}
		}catch(e){
				alert("errmsg:\n" + xmlhttp.responseText);
		}
	}
}		
//秀出歌曲視窗
var popUpWin=0;	

function GoMMPlayer(sUrl,song_no){
		//PlayCount(song_no,'TS','M');
		window.location = sUrl;
}


function GoPlayer(sSong_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		popUpWin=window.open("/webkara/KaraPlayer/KaraPlayer.aspx?fntype=try&song_no="+ sSong_no ,"Player","width=780px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}
//2007.2.2 增加 接唱的視窗開啟
function GoRYPlayer(sSong_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		popUpWin=window.open("/webkara/KaraPlayer.asp?fntype=ry&song_no="+ sSong_no ,"Player","width=780px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function GoRYPlayer2(sSong_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		popUpWin=window.open("/webkara/KaraPlayer.asp?fntype=ry&ver=5&song_no="+ sSong_no ,"Player","width=780px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function GoLitePlayer(sSong_no,cust_song_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed){
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		
		PlayCount(sSong_no,'TS','K');
		popUpWin=window.open("/webkara/litePlayer.asp?Song_up_no="+ sSong_no ,"Player","width=510px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function GoLitePlayer2(sSong_no,cust_song_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		PlayCount(sSong_no,'TS','K');
		popUpWin=window.open("/webkara/litePlayer.asp?ver=5&Song_up_no="+ sSong_no ,"Player","width=510px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function GoLitePlayerListen(sSong_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		PlayCount(sSong_no,'TS','K');
		popUpWin=window.open("/webkara/litePlayer.asp?src=1&song_no="+ sSong_no ,"Player","width=510px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

//合唱卡拉
function GoLiteRYPlayer(sSong_no,sAlbum_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		PlayCount(sSong_no,'RY','K');
		popUpWin=window.open("/webkara/litePlayer.asp?fntype=ry&album_no=" + sAlbum_no + "&Song_up_no="+ sSong_no ,"Player","width=510px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function GoLiteRYPlayer2(sSong_no,sAlbum_no){
	PlayCount(sSong_no,'RY','K');
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		
		popUpWin=window.open("/webkara/litePlayer.asp?fntype=ry&ver=5&album_no=" + sAlbum_no + "&Song_up_no="+ sSong_no ,"Player","width=510px,height=530px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function MMPlayer(Song_up_no){
	try{
		if(popUpWin){
			if(!popUpWin.closed) {
				popUpWin.goStop();
				popUpWin.close();
			}
		}
		popUpWin=window.open("/blog/MMPlayer.asp?Song_up_no="+ Song_up_no ,"Player","width=400px,height=200px,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
	}catch(e){
		alert("error!");
	}
}

function  subLogin(){
	goSubLogin(self.popUpWin.txtLoginID.value,self.popUpWin.txtPWD.value)
}

function  goSubLogin(loginID,pwd){
	 location.href="/login_p.asp?txtLoginID=" + loginID + "&txtPWD=" +pwd + "&url=" +location.href;
}

