var usersongid;
function checkLogin(root,songid){
  usersongid = songid;
  $.ajax({
  	type: "GET",
		url: root+"servlet/CheckLoginServlet",
		data: "",
		dataType: "html",
		success:function(result){
			if(result == 1){
		alert("请先登录!");
	}else{
	
	  window.location="/playlist/playlistinfo.action?userSong.id=" + usersongid;
	}
	}
			
  });}
  
  
  
  /*
	var myAjax = new Ajax.Request(
	                    url,
	                    {method: 'post', postBody:"i=1" , onComplete: addUserSong , onFailure:showFailed}
	                    );
}
function addUserSong(request){
    var doc=request.responseXML.documentElement;
	var node=doc.getElementsByTagName('result');
	var result = node[0].firstChild.nodeValue;
	if(result == 1){
		alert("请先登录!");
	}else{
	
	  window.location="/playlist/playlistinfo.action?userSong.id=" + usersongid;
	}
}

function showFailed(request){
	alert("链接失败!");	
}
*/