function openPlayer(songValues)
{    
	//soguaForm.songList.value = songValues;
    //var Urls = "http://search.sogua.com/player/player.asp"
	//window.open("http://search.sogua.com/player/start.htm","myPlayer","width=324,height=528");
    //soguaForm.action = Urls;
	//soguaForm.submit();	
	var indexID;
	if (songValues.indexOf("@")>-1)
		indexID = songValues.split("|")[0].split("@")[0];
	else if (songValues.indexOf(",")>-1)
		indexID = songValues.split(",")[0];
	else
	{
		alert("Γ»ΣΠΡ‘ΤρΈθΗϊ£‘");
		return ;
	}
	Urls = "http://music.sogua.com/song/" + indexID + ".html";
	//alert("Urls"+Urls)
	clearCookie(cooikeSong);
	createCookie(cooikeSong,songValues);
	window.open(Urls);
}

function openAlbumPlayer(sid)
{
	var Urls = "http://search.sogua.com/player/player.asp?sid=" + sid;
	window.open(Urls,"myPlayer","width=324,height=528");
}

//Cookie
var cooikeSong = "soguaSong";
function createCookie(name,value)
{
	var setTime = 1000;
	if (setTime)
	{
		var date = new Date();
		date.setTime(date.getTime()+(setTime*60*60*24));
		var expires = "; expires="+date.toGMTString();
	}
	else 
		var expires = "";
		
		//alert("escape"+escape(value));
	document.cookie = name+"="+escape(value)+expires+"; path=/; DOMAIN=sogua.com;";
}

function getCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length));
	}
	return "";	
}

function clearCookie(name)
{
	createCookie(name,"",-1);
}

//
function send_ring(id, name,send_ring_u){
	OpenWin("http://u.sogua.com/send/?type=ring&id=" + id + "&name=" + name + "&u=" + send_ring_u, 500, 480);
}

function send_pic(id, name){
	OpenWin("http://u.sogua.com/send/?type=pic&id=" + id + "&name=" + name + "&u=" + send_ring_u, 500, 480);
}

function OpenWin(gourl, w, h, l, t, win){
	var m_left = ( screen.width  - w  ) / 2;
	var m_top  = ( screen.height - h ) / 2;
    if( l != null && l != '' )m_left= m_left + l / 2;
    if( t != null && t != '' )m_top= m_top + t / 2;
    if( win == null || win == '')win = '';
	param = 'resizable=0, scrollbars=no, width=' + w + ', height=' + h + ', left=' + m_left + '; top=' + m_top;
	window.open ( gourl, win, param );
	try{window.event.returnValue = false;}catch(E){}
}