$(document).ready(function(){
	$("#main_foto").click(function(){
		window.location = $(this).find("a").attr("href");
	});
});

function fvote(action,qid) {
	var aid = 0;
    var s='';
    if ((a=document.getElementById('answ_own')) && (t=document.getElementById('answ_text')) && a.checked) {
	 if (t.value=='') {
      alert('Не указан текст ответа!');
	  return false;
     } else {
	   s+='&ua='+encodeURIComponent(t.value);
	 }
	}
    if (action == "vote") {
      for (var i=0; i<document.vote.answer.length; ++i) {
		if(document.vote.answer[i].checked) aid = document.vote.answer[i].value;
      }
      if (aid == 0) {
        alert('Не указан ответ!');
        return false;
      } else {
        s+='&aid='+aid;
      }
    }
    //var height = 212 + (37 * document.vote.aid.length);
    var height = 600;
    w = window.open('/voting/vote.html?qid='+qid+s,'w','width=400, height='+height+', scrollbars=NO, resizable=YES, dependent=YES');
    return false;
}
function own_item() {
 if ((a=document.getElementById('answ_own')) && (t=document.getElementById('answ_text'))) {
   t.style.display = a.checked ? 'block' : 'none';
 }
}
