if(navigator.platform=="Win32"&&navigator.appName=="Microsoft Internet Explorer"&&window.attachEvent){window.onload=fnLoadPngs;}function fnLoadPngs(){var rslt=navigator.appVersion.match(/MSIE (\d+\.\d+)/,'');var itsAllGood=(rslt!=null&&Number(rslt[1])<=6.0);var img=document.images;for(var i=img.length-1;i>=0;i--){if(itsAllGood&&img[i].src.match(/\.png$/i)){var src=img[i].src;img[i].style.width=img[i].width+"px";img[i].style.height=img[i].height+"px";img[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";img[i].src="images/1pix.gif"}}}function getElementPosition(elemId){var elem=elemId;var w=elem.offsetWidth;var h=elem.offsetHeight;var l=0;var t=0;while(elem){l+=elem.offsetLeft;t+=elem.offsetTop;elem=elem.offsetParent}return{"left":l,"top":t,"width":w,"height":h}}function showCityList(elem_pos,list_id){var el=document.getElementById(list_id);var main_inside=document.getElementById('main_inside');if(el.style.display=='none'){var cc_pos=getElementPosition(document.getElementById(elem_pos));el.style.top=(cc_pos.top+0)+'px';(main_inside.offsetWidth>1200)?(el.style.left=(cc_pos.left-((main_inside.offsetWidth-1200)/2))+'px'):(el.style.left=(cc_pos.left)+'px');el.style.display='block'}else{el.style.display='none'}}function setCity(elem_text,elem_pos,val){document.getElementById(elem_text).innerHTML=val;document.getElementById(elem_pos).style.display='none';}function showPrintWin(win_src){window.open(win_src,'popup_win','height=780,width=760,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=1,toolbar=0,zoominherit=0')}function winPrintCenter(){window.moveTo((screen.width/2)-375,(screen.height/2)-425)}function selectSearchRow(id_row,this_checkb){var cur_row=document.getElementById('serres_row_'+id_row);if(cur_row.className=='title'&&this_checkb.checked){cur_row.className='title title_sel'}else{cur_row.className='title'}}

function showChecked(to){    
    var ll='';
    for(var i=1;i<=to;i++)
        if(document.getElementById('row'+i).checked)
            ll=(ll=='' ? '' : ll+',')+document.getElementById('row'+i+'_val').value;
    showPrintWin('printsearchresult.aspx?list='+ll);
}


function $(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); }
function $S(o) { return((typeof(o)=='object'?o:$(o)).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function abPos(o) { var o=(typeof(o)=='object'?o:$(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); }
function XY(e,v) { var o=agent('msie')?{'X':event.clientX+document.body.scrollLeft,'Y':event.clientY+document.body.scrollTop}:{'X':e.pageX,'Y':e.pageY}; return(v?o[v]:o); }

var req,oX,rating=0;
var startY;
star={};

star.mouse=function(e,o) { 
    startY=XY(e).Y;
    if(star.stop || isNaN(star.stop)) { star.stop=0;
	    document.onmousemove=function(e) {	
		    var p=abPos($('star')), x=XY(e), oY=startY-x.Y;
		    oX=x.X-p.X-10;
		    if(oX<1 || oX>160 || (oY<0?-oY:oY)>14) { star.stop=1; star.revert(); }		
		    else $S('starCur').width=oX+'px';
	    };
    }
};

star.update=function(e,o,control_id) {
    var v=Math.round(oX*100/160)/100;
    /*
    req=(window.XMLHttpRequest?new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));	    
	req.open('GET','vote.aspx?tid='+(document.getElementById('taxiID').value)+'&vote='+(v/100),false); 
	req.send(null);
	if(req && req.readyState==4 && req.status==200){
        var s=req.responseText;
        if(s.substring(0,1)!='1') alert('Ви вже голосували!');
        else{
            s=s.substring(2);
            var num=s.substring(0,s.indexOf('#'));
            var rat=s.substring(s.indexOf('#')+1);
            
            document.getElementById('numVotes').innerHTML=num;
            alert('Ваш голос отримано!');
        }
    }else alert('Виникла помилка при відправленні інформації.');*/
    rating=v*100;
    document.getElementById(control_id).value =  v;
};

star.revert=function() { $S('starCur').width=Math.round((rating/100)*160)+'px';document.onmousemove='';};