function vote(v){
	var day = new Date();
	url="./index.php?route=una/una_s";
	if(getCookie("plist")!=day.getDate()) delCookie("plist");
	if(v && !getCookie("plist")) url="./index.php?route=una/una_s&id="+v;
	if(v && !getCookie("plist")) alert('Vote success');
	if(v &&  getCookie("plist")) alert('Please don\'t repeat vote!');
	if(getCookie("plist")!=day.getDate()) addCookie("plist",day.getDate(),24);
	$.get(url, {Action:"get",Name:"lulu"}, function (data, textStatus){
				this; 
				var foreas=data.split("|");
				var foreas2=foreas[0].split("+");
			
				var study_voteCount=foreas[1];
				var study_votestr="";
					for(i=0;i<foreas2.length-1;i++)
					{
						var foreas3=foreas2[i].split(",");
						var studyplay_present=parseInt(foreas3[1]/study_voteCount*100);
						
						study_votestr +='<dd class="dd"><div class="fl">'+foreas3[0]+'：</div><div class="outbar"><div class="inbar" style="width:'+studyplay_present+'%;background:'+foreas3[2]+';"></div></div> <div class="fl2">'+foreas3[1]+' </div></dd>';
					}
				
				$("#zz").show("slow",function(){
					$(this).find('div').html('<dl id="studyvote">'+study_votestr+'</dl>');
				});
				
		});
							  
	}
function voteh(){
	$("#zz").hide("slow");
	}
	
 function getCookie(objName){
    var arrStr = document.cookie.split("; ");
    for(var i = 0;i < arrStr.length;i ++){
     var temp = arrStr[i].split("=");
     if(temp[0] == objName) return unescape(temp[1]);
    }
}

 function addCookie(objName,objValue,objHours){
    var str = objName + "=" + escape(objValue);
    if(objHours){
     var date = new Date();
     var ms = objHours*3600*1000;
     date.setTime(date.getTime() + ms);
     str += "; expires=" + date.toGMTString();
    }
    document.cookie = str;
   }
  function delCookie(name){
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = name + "=a; expires=" + date.toGMTString();
   }
