
var red_voznje_do_index,red_voznje_od_index;function ajax_kursna_lista_convert_from()
{var fi=$('kursna_lista_from_cur').selectedIndex;var ti=$('kursna_lista_to_cur').selectedIndex;if(fi==ti)
$('kursna_lista_to_cur').selectedIndex=kursna_list_from_index;ajax_kursna_lista_convert();}
function ajax_kursna_lista_convert_to()
{var fi=$('kursna_lista_from_cur').selectedIndex;var ti=$('kursna_lista_to_cur').selectedIndex;if(fi==ti)
$('kursna_lista_from_cur').selectedIndex=kursna_list_to_index;ajax_kursna_lista_convert();}
function ajax_kursna_lista_convert()
{var fv=$('kursna_lista_from_val').value;var fc=$('kursna_lista_from_cur').value;var tc=$('kursna_lista_to_cur').value;url=http_host+'ajax.php?mode=kursna_lista&f=convert&fv='+fv+'&fc='+fc+'&tc='+tc+"&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))
{$('kursna_lista_to_val').value=xmlhttp.responseXML.documentElement.getElementsByTagName('val')[0].firstChild.nodeValue;hide_loading('kursna_lista_to_val');}}
catch(e)
{alert(e);}};if(fv!='')
{_gaq.push(['_trackEvent','Kursna lista','Konvertovanje - '+fv+' '+fc+' u '+tc]);show_loading(1,'kursna_lista_to_val',15);xmlhttp.open("GET",url,true);xmlhttp.send("");}}
catch(e)
{setTimeout('ajax_kursna_lista_convert();',2000);}};function kursna_lista_switch()
{var a=$('kursna_lista_from_cur').selectedIndex;$('kursna_lista_from_cur').selectedIndex=$('kursna_lista_to_cur').selectedIndex;$('kursna_lista_to_cur').selectedIndex=a;ajax_kursna_lista_convert();}
function ajax_red_voznje_danas(type)
{show_loading(1,'red_voznje_results',32);new Ajax.Request("ajax.php?mode=red_voznje&f=get_info&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{od:$('red_voznje_od').value,'do':$('red_voznje_do').value},onComplete:function(xmlhttp){$('red_voznje_results').innerHTML=xmlhttp.responseText;hide_loading('red_voznje_results');}});if(type!=1)
_gaq.push(['_trackEvent','Red vožnje - Danas',$('red_voznje_od').value+' - '+$('red_voznje_do').value]);}
function ajax_red_voznje(type)
{show_loading(1,'red_voznje_results',32);new Ajax.Request("ajax.php?mode=red_voznje&f=get_info&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{od:$('red_voznje_od').value,'do':$('red_voznje_do').value,datum_polaska:$('red_voznje_datum_polaska_d').value+'.'+$('red_voznje_datum_polaska_m').value+'.'+$('red_voznje_datum_polaska_y').value,vrsta_prevoza:$('red_voznje_vrsta_prevoza').value},onComplete:function(xmlhttp){$('red_voznje_results').innerHTML=xmlhttp.responseText;hide_loading('red_voznje_results');}});if(type!=1)
_gaq.push(['_trackEvent','Red vožnje',$('red_voznje_od').value+' - '+$('red_voznje_do').value+', '+$('red_voznje_vrsta_prevoza').value]);}
function ajax_red_voznje_od_danas()
{var fi=$('red_voznje_od').selectedIndex;var ti=$('red_voznje_do').selectedIndex;if(fi==ti)
$('red_voznje_do').selectedIndex=red_voznje_od_index;ajax_red_voznje_danas(0);}
function ajax_red_voznje_od()
{var fi=$('red_voznje_od').selectedIndex;var ti=$('red_voznje_do').selectedIndex;if(fi==ti)
$('red_voznje_do').selectedIndex=red_voznje_od_index;ajax_red_voznje(0);}
function ajax_red_voznje_do_danas()
{var fi=$('red_voznje_od').selectedIndex;var ti=$('red_voznje_do').selectedIndex;if(fi==ti)
$('red_voznje_od').selectedIndex=red_voznje_do_index;ajax_red_voznje_danas(0);}
function ajax_red_voznje_do()
{var fi=$('red_voznje_od').selectedIndex;var ti=$('red_voznje_do').selectedIndex;if(fi==ti)
$('red_voznje_od').selectedIndex=red_voznje_do_index;ajax_red_voznje(0);}
function ajax_dezurna_apoteka_save(d)
{show_loading(1,'dezurna_apoteka_'+d,32);new Ajax.Request("ajax.php?mode=servis&f=dezurna_apoteka_save&RandomKey="+Math.random()*Date.parse(new Date()),{method:'post',parameters:{date:d,apoteka:$('dezurna_apoteka_'+d).value},onComplete:function(xmlhttp){hide_loading('dezurna_apoteka_'+d);}});}