function vote() 
{
    with (document.voteForm) 
	{
		  choice="";
		  var check;
	      var c1 = age[0].checked;
		  var c2 = age[1].checked;
		  var c3 = age[2].checked;
          var c4 = age[3].checked;
		  var c5 = age[4].checked;
		  var c6 = age[5].checked;
		  //alert(c1+" "+c2+" "+c3+" "+c4+" "+c5+" "+c6);
		  if (c1==true)
		  {
		       choice = "1";
			   check = true;
		  }
	      if (c2==true)
		  {
		       choice = "2";
			   check = true;
		  }
		  if (c3==true)
		  {
		       choice = "3";
			   check = true;
		  }
		  if (c4==true)
		  {
		       choice = "4";
			   check = true;
		  }
		  if (c5==true)
		  {
		       choice = "5";
			   check = true;
		  }
		  if (c6==true)
		  {
		       choice = "6";
			   check = true;
		  }
		  
		  if (choice=="")
		  {
		       alert("¡ÃØ³ÒàÅ×Í¡ËÑÇ¢éÍâËÇµ¡èÍ¹");
		       check = false;
		  }
		  
		  if (check==true)
		  {
	            openWindow("poll/vote.php?choice="+choice,200,100,1,"vote");
		        return true;
		  }
		  else {
		        return false;
		  }
	     

	}
}

function openWindow(url,width,height,center,windowname)
{
      xpos = 0;
      ypos = 0;
      if ((parseInt(navigator.appVersion)>=4) && (center))
      {
         xpos = (screen.width - width) / 2;
	     ypos = (screen.height - height) / 2;
       }
       arg = "width=" + width + "," + "height=" + height + "," + "location=0," + "status=1,menubar=0," + "scrollbars=1," + "left= " + xpos + "," + "top=" + ypos;
       window.open(url,windowname,arg);  
}

function openWindowNoScroll(url,width,height,center,windowname)
{
      xpos = 0;
      ypos = 0;
      if ((parseInt(navigator.appVersion)>=4) && (center))
      {
         xpos = (screen.width - width) / 2;
	     ypos = (screen.height - height) / 2;
       }
       arg = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "scrollbars=0," + "left= " + xpos + "," + "top=" + ypos;
       window.open(url,windowname,arg);  
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.value = maxlimit - field.value.length;
	}

function openWindow2photo(path_img)
{
	if (null != path_img){
		path = "http://photo.popmx.com/copy_img2buf.php?url="+path_img+"&corp_id=1018";
		window.open( path , '', 'resizable=yes,scrollbars=yes,top=50,left=100,width=500,height=520');
	}
	else
	{
		path = "http://photo.popmx.com/index.php?corp_id=1018";
		window.open( path , '', 'resizable=yes,scrollbars=yes,top=50,left=100,width=500,height=520');
	}
}


