
var upload_attachments_saved_count=0;var upload_attachments_errored_count=0;var post_id=0;var remove_attachments=new Array();function ajax_forumi_remove_attachment(swf_id,att_id)
{remove_attachments[remove_attachments.length+1]=att_id;new Effect.DropOut($('SWFUpload_0_'+swf_id),{duration:0.3});setTimeout('removeChildren("'+'SWFUpload_0_'+swf_id+'"); $("'+'SWFUpload_0_'+swf_id+'").parentNode.removeChild($("'+'SWFUpload_0_'+swf_id+'"));',300);}
function ajax_forumi_odgovor_submit()
{var odgovor_tema_id=$('forumi_odgovor_tema_id').value;var odgovor_text=xinha_editors['ajax_content_editor_content'].getEditorContent();if(odgovor_text==''||odgovor_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});if(swfu.getStats().in_progress)
new Effect.Shake($$('fieldset.attached_files')[0],{distance:10,sync:false});if(odgovor_text==''||odgovor_text=='<br />'||odgovor_tema_id==''|| swfu.getStats().in_progress)
return false;show_loading(1,'forumi_odgovor_submit',32);var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});remove_attachments.each(function(element){new Ajax.Request("ajax.php?mode=forumi&f=remove_attachment&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{attachments:Object.toJSON(element)}});});var upload_attachments=new Array();if(count_uploaded>0)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title];}});upload_attachments.each(function(element){new Ajax.Request("ajax.php?mode=forumi&f=save_attachment&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{attachments:Object.toJSON(element)},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{var attachment_error_message;if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{_gaq.push(['_trackEvent','Forumi','Upload attachmenta']);upload_attachments_saved_count++;}
else
{upload_attachments_errored_count++;attachment_error_message=(new XMLSerializer()).serializeToString(xmlhttp.responseXML.getElementsByTagName('return')[0])}
var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});if(upload_attachments_saved_count+upload_attachments_errored_count>=count_uploaded)
{if(upload_attachments_errored_count==0)
{ajax_forumi_odgovor_submit_post(1);}
else
{hide_loading('forumi_odgovor_submit');var error_div=document.createElement('div');error_div.style.textAlign="center";error_div.innerHTML=attachment_error_message;clear_popup();popup_title('Greška pri slanju prikačenih fajlova');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(error_div);show_popup();}
upload_attachments_errored_count=0;upload_attachments_saved_count=0;}}}});});}
else
{ajax_forumi_odgovor_submit_post(0);}}
function ajax_forumi_odgovor_submit_post(has_attachments){var odgovor_tema_id=$('forumi_odgovor_tema_id').value;var odgovor_text=xinha_editors['ajax_content_editor_content'].getEditorContent();var upload_attachments=new Array();if(has_attachments)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title];}});}
upload_attachments=Object.toJSON(upload_attachments);if(odgovor_text!=''&&odgovor_text!='<br />'&&odgovor_tema_id!='')
{new Ajax.Request("ajax.php?mode=forumi&f=odgovor&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{tema_id:odgovor_tema_id,text:odgovor_text,has_attachments:has_attachments,attachments:upload_attachments},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{post_id=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Vaš odgovor je uspešno poslat.';clear_popup();popup_title('Odgovor na temu');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = http_host + 'forumi/poruka/' + "+post_id+" + '/'",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Odgovor na temu');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('forumi_odgovor_submit');}});}
else
{if(odgovor_text==''||odgovor_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});}}
function ajax_forumi_izmena_poruke_submit()
{var izmena_poruke_ima_naslov=false;var izmena_poruke_id=$('forumi_izmena_poruke_id').value;if($('forumi_izmena_poruke_naslov'))
{var izmena_poruke_naslov=$('forumi_izmena_poruke_naslov').value;izmena_poruke_ima_naslov=true;}
var izmena_poruke_text=xinha_editors['ajax_content_editor_content'].getEditorContent();if(izmena_poruke_text==''||izmena_poruke_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});if(izmena_poruke_naslov==''&&izmena_poruke_ima_naslov)
new Effect.Shake($('forumi_izmena_poruke_naslov'),{distance:10,sync:false});if(swfu.getStats().in_progress)
new Effect.Shake($$('fieldset.attached_files')[0],{distance:10,sync:false});if(izmena_poruke_text==''||izmena_poruke_text=='<br />'||(izmena_poruke_naslov==''&&izmena_poruke_ima_naslov)||izmena_poruke_id==''|| swfu.getStats().in_progress)
return false;show_loading(1,'forumi_izmena_poruke_submit',32);var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});remove_attachments.each(function(element){new Ajax.Request("ajax.php?mode=forumi&f=remove_attachment&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{attachments:Object.toJSON(element)}});});var upload_attachments=new Array();if(count_uploaded>0)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;var attachment_id='';if(element.getElementsBySelector('input[name="attachment_id[]"]')[0])
attachment_id=element.getElementsBySelector('input[name="attachment_id[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title,attachment_id];}});upload_attachments.each(function(element){new Ajax.Request("ajax.php?mode=forumi&f=save_attachment&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{attachments:Object.toJSON(element)},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{var attachment_error_message;if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{_gaq.push(['_trackEvent','Forumi','Upload attachmenta']);upload_attachments_saved_count++;}
else
{upload_attachments_errored_count++;attachment_error_message=(new XMLSerializer()).serializeToString(xmlhttp.responseXML.getElementsByTagName('return')[0])}
var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});if(upload_attachments_saved_count+upload_attachments_errored_count>=count_uploaded)
{if(upload_attachments_errored_count==0)
{ajax_forumi_izmena_poruke_submit_post(1);}
else
{hide_loading('forumi_izmena_poruke_submit');var error_div=document.createElement('div');error_div.style.textAlign="center";error_div.innerHTML=attachment_error_message;clear_popup();popup_title('Greška pri slanju prikačenih fajlova');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(error_div);show_popup();}
upload_attachments_errored_count=0;upload_attachments_saved_count=0;}}}});});}
else
{ajax_forumi_izmena_poruke_submit_post(0);}}
function ajax_forumi_izmena_poruke_submit_post(has_attachments){var izmena_poruke_ima_naslov=false;var izmena_poruke_id=$('forumi_izmena_poruke_id').value;if($('forumi_izmena_poruke_naslov'))
{var izmena_poruke_naslov=$('forumi_izmena_poruke_naslov').value;izmena_poruke_ima_naslov=true;}
var izmena_poruke_text=xinha_editors['ajax_content_editor_content'].getEditorContent();var upload_attachments=new Array();if(has_attachments)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title];}});}
upload_attachments=Object.toJSON(upload_attachments);if(izmena_poruke_text!=''&&izmena_poruke_text!='<br />'&&(izmena_poruke_naslov!=''|| !izmena_poruke_ima_naslov)&&izmena_poruke_id!='')
{new Ajax.Request("ajax.php?mode=forumi&f=izmena_poruke&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{id:izmena_poruke_id,naslov:izmena_poruke_naslov,text:izmena_poruke_text,has_attachments:has_attachments,attachments:upload_attachments},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{post_id=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Vaša poruka je uspešno izmenjena.';clear_popup();popup_title('Izmena forumske poruke');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = http_host + 'forumi/poruka/' + "+post_id+" + '/'",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Izmena forumske poruke');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('forumi_izmena_poruke_submit');}});}
else
{if(izmena_poruke_text==''||izmena_poruke_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});if(izmena_poruke_naslov==''&&izmena_poruke_ima_naslov)
new Effect.Shake($('forumi_izmena_poruke_naslov'),{distance:10,sync:false});}}
function ajax_forumi_nova_tema_submit()
{nova_tema_forum=$('forumi_nova_tema_forum').value;nova_tema_naslov=$('forumi_nova_tema_naslov').value;nova_tema_text=xinha_editors['ajax_content_editor_content'].getEditorContent();if(nova_tema_text==''||nova_tema_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});if(nova_tema_naslov=='')
new Effect.Shake($('forumi_nova_tema_naslov'),{distance:10,sync:false});if(swfu.getStats().in_progress)
new Effect.Shake($$('fieldset.attached_files')[0],{distance:10,sync:false});if(nova_tema_text==''||nova_tema_text=='<br />'||nova_tema_naslov==''||nova_tema_forum==''|| swfu.getStats().in_progress)
return false;show_loading(1,'forumi_nova_tema_submit',32);var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});var upload_attachments=new Array();if(count_uploaded>0)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title];}});upload_attachments.each(function(element){new Ajax.Request("ajax.php?mode=forumi&f=save_attachment&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{attachments:Object.toJSON(element)},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{var attachment_error_message;if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{_gaq.push(['_trackEvent','Forumi','Upload attachmenta']);upload_attachments_saved_count++;}
else
{upload_attachments_errored_count++;attachment_error_message=(new XMLSerializer()).serializeToString(xmlhttp.responseXML.getElementsByTagName('return')[0])}
var count_uploaded=0;$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
count_uploaded++;});if(upload_attachments_saved_count+upload_attachments_errored_count>=count_uploaded)
{if(upload_attachments_errored_count==0)
{ajax_forumi_nova_tema_submit_post(1);}
else
{hide_loading('forumi_nova_tema_submit');var error_div=document.createElement('div');error_div.style.textAlign="center";error_div.innerHTML=attachment_error_message;clear_popup();popup_title('Greška pri slanju prikačenih fajlova');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(error_div);show_popup();}
upload_attachments_errored_count=0;upload_attachments_saved_count=0;}}}});});}
else
{ajax_forumi_nova_tema_submit_post(0);}}
function ajax_forumi_nova_tema_submit_post(has_attachments){var nova_tema_forum=$('forumi_nova_tema_forum').value;var nova_tema_naslov=$('forumi_nova_tema_naslov').value;var nova_tema_text=xinha_editors['ajax_content_editor_content'].getEditorContent();var upload_attachments=new Array();if(has_attachments)
{$$('#swfUploadProgress .progressWrapper').each(function(element){if(element.style.display!='none')
{var attachment_filename=element.getElementsBySelector('input[name="attachment_filename[]"]')[0].value;var attachment_title=element.getElementsBySelector('input[name="attachment_title[]"]')[0].value;upload_attachments[upload_attachments.length+1]=[attachment_filename,attachment_title];}});}
upload_attachments=Object.toJSON(upload_attachments);if(nova_tema_text!=''&&nova_tema_text!='<br />'&&nova_tema_naslov!=''&&nova_tema_forum!='')
{new Ajax.Request("ajax.php?mode=forumi&f=nova_tema&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{forum:nova_tema_forum,naslov:nova_tema_naslov,text:nova_tema_text,has_attachments:has_attachments,attachments:upload_attachments},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{post_id=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Vaša poruka je uspešno poslata.';clear_popup();popup_title('Nova forumska tema');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = http_host + 'forumi/poruka/' + "+post_id+" + '/'",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Nova forumska tema');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('forumi_nova_tema_submit');}});}
else
{if(nova_tema_text==''||nova_tema_text=='<br />')
new Effect.Shake($$('.htmlarea')[0],{distance:10,sync:false});if(nova_tema_naslov=='')
new Effect.Shake($('forumi_nova_tema_naslov'),{distance:10,sync:false});}}
function ajax_forumi_premestanje_teme()
{var premestanje_teme_id=$('forumi_premestanje_teme_id').value;var premestanje_teme_forum=$('forumi_premestanje_teme_forum').value;show_loading(1,'forumi_premestanje_teme_submit',32);new Ajax.Request("ajax.php?mode=forumi&f=premestanje_teme&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{forum:premestanje_teme_forum,id:premestanje_teme_id},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{tema_id=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Tema je uspešno premeštena.';clear_popup();popup_title('Premeštanje forumske teme');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = http_host + 'forumi/tema/' + "+tema_id+" + '/'",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Premeštanje forumske teme');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('forumi_premestanje_teme_submit');}});}
function ajax_forumi_brisanje_poruke(id)
{show_loading(1,'confirmation_popup_btn1',32);new Ajax.Request("ajax.php?mode=forumi&f=brisanje_poruke&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{id:id},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{location=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Poruka je uspešno izbrisana.';clear_popup();popup_title('Brisanje forumske poruke');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = '"+location+"';",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Brisanje forumske poruke');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('confirmation_popup_btn1');}});}
function ajax_forumi_brisanje_teme(id)
{show_loading(1,'confirmation_popup_btn1',32);new Ajax.Request("ajax.php?mode=forumi&f=brisanje_teme&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{id:id},onComplete:function(xmlhttp){if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{id=xmlhttp.responseXML.getElementsByTagName('return')[0].firstChild.nodeValue;var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='Tema je uspešno izbrisana.';clear_popup();popup_title('Brisanje forumske teme');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();setTimeout("window.location = 'forumi/"+id+"/';",3000);}
else
{var bs_div=document.createElement('div');bs_div.style.textAlign="center";bs_div.innerHTML='<span class="red">Greška.</span><br />'+xmlhttp.responseText;clear_popup();popup_title('Brisanje forumske teme');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(bs_div);show_popup();}}
hide_loading('confirmation_popup_btn1');}});}
function ajax_forumi_tema_anketa_show_results(id,show_thanks)
{show_loading(1,'anketa',32);url=http_host+'ajax.php?mode=anketa&f=show_topic_results&id='+id+'&thanks='+show_thanks+"&RandomKey="+Math.random()*Date.parse(new Date());var xmlhttp=false;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();}try{xmlhttp.onreadystatechange=function()
{try
{if((xmlhttp.readyState==4)&&(xmlhttp.responseText.length>0))
{new Effect.BlindUp($('forumi_tema_anketa_options'),{duration:0.3,afterFinish:function(){$('forumi_tema_anketa_results').innerHTML=xmlhttp.responseText;$('forumi_tema_anketa_show_results').hide();new Effect.BlindDown($('forumi_tema_anketa_results'),{duration:0.3,afterFinish:function(){var re=/<script\b.*?>(.*?)<\//ig;var match;while(match=re.exec($('forumi_tema_anketa_results').innerHTML)){eval(match[1]);}
hide_loading('anketa');}});}});}
else
hide_loading('anketa');}
catch(e)
{alert(e);}};xmlhttp.open("GET",url,true);xmlhttp.send("");}
catch(e)
{setTimeout('ajax_forumi_tema_anketa_show_results('+id+');',2000);}}
function ajax_forumi_tema_anketa_submit(id)
{if($('forumi_tema_anketa_results').style.display!='none')
{new Effect.BlindUp($('forumi_tema_anketa_results'),{duration:0.3,afterFinish:function(){new Effect.BlindDown($('forumi_tema_anketa_options'),{duration:0.3});$('forumi_tema_anketa_show_results').show();}});return;}
url=http_host+'ajax.php?mode=anketa&f=vote&id='+id+'&option='+$$('input:checked[type="radio"][name="anketa_'+id+'"]').pluck('value')+"&RandomKey="+Math.random()*Date.parse(new Date());var xmlhttp=false;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();}try{xmlhttp.onreadystatechange=function()
{try
{if((xmlhttp.readyState==4)&&(xmlhttp.responseText.length>0))
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].childNodes.length>0)
{if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==1)
{hide_popup();clear_popup();ajax_forumi_tema_anketa_show_results(id,1);}
else if(xmlhttp.responseXML.getElementsByTagName('result')[0].firstChild.nodeValue==2)
{var anketa_div=document.createElement('div');anketa_div.style.textAlign="center";anketa_div.innerHTML='Već ste glasali na ovoj anketi.';setTimeout('hide_popup();',6000);clear_popup();popup_title('Greška pri glasanju');$('popup_container').appendChild(document.createElement('br'));$('popup_container').appendChild(anketa_div);show_popup();ajax_forumi_tema_anketa_show_results(id,0);}
hide_loading('forumi_tema_anketa_submit');$('forumi_tema_anketa_submit').hide();}}}
catch(e)
{hide_loading('forumi_tema_anketa_submit');alert(e);}};if(userdata['id']==0)
{popup_title('Login');show_popup('login','&page=forumi&needed_login=1');return;}
if(true)
{show_loading(1,'forumi_tema_anketa_submit',32);xmlhttp.open("GET",url,true);xmlhttp.send("");}
else
new Effect.Shake($('forumi_tema_anketa_options'),{distance:10,sync:false});}
catch(e)
{alert(e);}}
