function commend(name, id,mid,type,comment_num,yes_comment,alertval,url) {
				$.get("/gift/index.php?act=checksession",null,function(data)
				{
				if(data=="false")
					_alert(lanLogin);
				else{	
					if(yes_comment!=undefined &&yes_comment!='' ){
						if(alertval!=undefined && alertval!='false' ){
							openURL('/passport/index.php?act=recommend&mid='+mid+'&type='+type+'&comment_num='+comment_num+'&url='+url, langPassMsg18,730,280);
						}else{
							window.top.art.dialog({id:"_twalert",title:langPassMsg18, iframe:'/passport/index.php?act=recommend&mid='+mid+'&type='+type+'&comment_num='+comment_num+'&url='+url, width:730, height:280,lock:true});
						}
					}else{
					//window.top.art.dialog({id:"_twalert",title:langPassMsg18, iframe:'/passport/index.php?act=recommend&mid='+mid+'&type='+type+'&comment_num='+comment_num, width:710, height:260,lock:true})
						openURL('/passport/index.php?act=recommend&mid='+mid+'&type='+type+'&comment_num='+comment_num+'&url='+url, langPassMsg18,730,280);
					}
				}
				});
}
//id:才艺比拼的id ，eid：用户参加才艺比拼的ID，name：用户的username，pid:用户的id
function pollfriend(id,eid,name,pid,own) { 
	$.get("/gift/index.php?act=checksession",null,function(data){
		if(data=="false")
			_alert(lanLogin);
		else{
			if(pid=='' || own==1){//为我自己拉票
				$.post("/event/?act=ajaxcheckuser",{eid:id},function(data){
					if(data==1){
						$.post("/event/?act=ajaxcheckuser",{pid:pid,eid:eid},function(data){
							if(data==1)
								_alert("'"+youHavePullBill+"'");
							else
								openURL('/passport/index.php?act=friendemail&id='+id+'&name='+name+'&eid='+eid,pleaseFriend,'730','365');
								//openURL('/passport/index.php?act=pollfriend&id='+id+'&name='+name,'邀请好友来投票','730','365');
						});
					}
					else
						_alert("'"+noEvent+"'");
				});
			}else{//为她拉票
				$.post("/event/?act=ajaxcheckuser",{pid:pid,eid:eid},function(data){
					if(data==1)
						_alert("'"+youHaveHePullBill+"'");
					else
						openURL('/passport/index.php?act=friendemail&name='+name+'&id='+id+'&pid='+pid+'&eid='+eid,'"'+pullHeBill+'"','730','365');
						//openURL('/passport/index.php?act=pollfriend&name='+name+'&id='+id+'&pid='+pid,'为TA拉票');
				});
			}	
		}
	});
}
function choicefriend() {
	var id = "";
	var name = "";
	var str = "";
	$("input[name='lcheck']:checked").each(function() {
		str = $(this).val();
		arr = str.split(";");
		id += arr[0] + ",";
		name += arr[1] + ":";
	});
	name = name.substring("0", name.lastIndexOf(":"));
	$("#sendid").val(id);
	$("#frinds").val(name);
	$('.friend_list').hide();
}

function choicefriendtype()
{

    var id= $("select[name=firendc]").val();
    $.get("/gift/?act=ajaxfriend&cid="+id,null,function(data)
    {
         data = eval("(" + data + ")");
	     var str="";
	     $(".fl_list").html('');
	     var i=0;
	     for(i;i<data.length;i++){
		     str+="<div class='fl_fx'>";
		     str+= "<span class='fr_srkx'><input type='checkbox'  name='lcheck'  value='"+data[i].UserItem.id+";"+data[i].UserItem.nickname+"' /></span>"
		     str+="<span class='fr_tex'>"+data[i].UserItem.nickname+"</span></div>";
	     }
	     $(".fl_list").html(str);
    });
}
function message() {

if ($("#sendid").val() == "")
 {
	
    _alert(langPassMsg27, lanTips);

} else if ($("#content").val() == ""){
	
   _alert(langPassMsg19, lanTips);

}else  if($("#content").val().length>200)
{
	
     _alert(langPassMsg20,lanTips);
}else {
	var urltext=$("#url").val();
	$.post('/passport/myspace/index.php?act=message',{sendid:$("#sendid").val(),content:$("#content").val(),url:urltext},function(data){
			 if(data==0)
			   {
				  _alert(lanRequestError2,lanTips);
			   }else
			   {	
				  
				   var d='';
						if($('#comment_num').val()=='true'){  
						   $.post("/comment/index.php?act=addComment_num",{sort:$('#type').val(), mid:$('#mid').val(),textnum:'par_num'},function(d){
								 window.top.location.reload();
							});
					   }else{
							
						   _alert(lanOperateSuccess,lanTips); 
						   _close();
						  
						   
					 }
			   }
		})
   

}
}
function dopoll(t) {
	var str='';
	$("input[name='friend']:checked").each(function(){
	     str+=$(this).val()+",";
	})

	if (str == ""){
	    _alert("'"+selsectFirend+"'", lanTips);
	}else if ($("#content").val() == ""){
	   _alert(langPassMsg19, lanTips);
	}else  if($("#content").val().length>200){
	     _alert(langPassMsg20,lanTips);
	}else{
		
	    	  // _alert(lanOperateSuccess,lanTips);
	    if("undefined" == typeof t){
		 $.post("/passport/myspace/index.php?act=dopoll", {
	        "content": $("#content").val(),
			"url": $("#url").val(),
			"friend": str,
			"uid": $("#userid").val()
	    },
	    function(data){
	       if(data==0){
	          _alert(lanRequestError2,lanTips);
	       }else if(data==2){
	          _alert("'"+selsectNewEvent+"'");
	       }
	    });
	_close();}else
	    		   window.top.location='/event/myspace/index.php?eid='+t;
	    		   
	    	  
	   
	}
}
function dopollgroup(t) {
	if ($.trim($("#content").val()) == ""){
	   _alert(langPassMsg19, lanTips);
	}else  if($.trim($("#content").val()).length>200){
	     _alert(langPassMsg20,lanTips);
	}else{
		var content=$("#content").val();
		var url=$("#url").val();
		var emaildata=$('#selectedemail').val();
		var namedata=$('#selectedname').val();
		var useriddata=$('#selecteduserid').val();
		
		var uid=$("#userid").val();
		var type=$("#type").val();
		var invitetype=$("#type").val();
	    	  // _alert(lanOperateSuccess,lanTips);
	    if("undefined" == typeof t){
		 $.post("/passport/myspace/index.php?act=dopollnew", {
	        "content": content,
			"url": url,
			"webemail": emaildata,
			"webname": namedata,
			"webinuserid": useriddata,
			"uid":uid,
			"type":invitetype
	    },
	    function(data){
	       if(data==0){
	          _alert(lanRequestError2,lanTips);
	       }else if(data==2){
	          _alert("'"+selsectNewEvent+"'");
	       }else{
				 $.post("/passport/myspace/index.php?act=postpollemail",
						{"content": content,"url": url,"data":data,firendgroup:$('#selectgroup').val()},
						function(){});
				 _alert('"'+pullBillsucc+'"');
				 _close();	
		   }
	    });
		//_close();	
		}else
	    	window.top.location='/event/myspace/index.php?eid='+t; 
	}
}
