﻿        function showcheckresult(obj)
		{
			var res = obj.getElementsByTagName('result');			
			var result = "";
			if (res[0] != null && res[0] != undefined)
			{
				if (res[0].childNodes.length > 1) {
					result = res[0].childNodes[1].nodeValue;
				} else {
					result = res[0].firstChild.nodeValue;    		
				}
			}
			
			if (result == "1")
			{
				if(confirm("您尚未登录，不能投票\n\r请点击右上角“注册”后投票\n\r或点击“确定”登录后投票"))
				{
				  location.href("http://bbs.babyschool.com.cn/login.aspx?reurl=http://www.babyschool.com.cn/photoaction/photolist.aspx");
				  //location.reload();
				}
			}
			else if (result == "3")
			{			   
				alert("同一会员对同一幅照片最多只能投票5次！");
			}
			else if(result == "2")
			{
			  alert("投票成功，感谢参与！");
			  location.reload();
			}			
			else			
			{
			   alert("投票时发生错误");
			}
		}
		
		function vote(pid)
		{
		  //ajaxRead("photoajax.aspx?t=vote&pid=" + escape(pid), "showcheckresult(obj);");
                  alert("照片评选活动已经结束，感谢您的参与");
		}
		function viewphoto(obj,objID)
       {
         document.getElementById(objID).src = "file:///" + obj.value;
       }


