var score=0;var x=0;var id=0;$(document).ready(function(){if($('#minivote').length>0){score=$('#score').width();id=$('#pid').html();$('#minivote').mousemove(function(e){offset=$(this).offset();x=e.pageX-offset.left;if(x<0)x=0;if(x>100)x=100;$('#score').width(x)}).click(function(){$.ajax({url:'/ajax/vote.php',type:'POST',dataType:'json',data:{'id':id,'x':x},success:function(data){$('#vote').html(data.msg);score=data.score;$('#score').animate({width:score});$('#score2').html((score/10).toFixed(1))}})}).mouseleave(function(){$('#score').animate({width:score})})}if($('#social').length>0){var social='<div id="plusone"><g:plusone size="medium"></g:plusone></div>';social+='<div id="facebook"><a name="fb_share"></a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div>';social+='<div id="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none"';if($('#tweettext').length>0){social+=' data-text="'+$('#tweettext').html()+'"'}social+='>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>';$('#social').html(social)}if($('#plaats').length>0){$("#plaats").autocomplete({source:function(req,add){$.getJSON("/autocomplete.php?callback=?",req,function(data){var suggestions=[];$.each(data,function(i,val){suggestions.push(val)});add(suggestions)})},minLength:2,select:function(event,ui){$('input[name=plaats]').val(ui.item.value);$('#provinfo').html(ui.item.info);$('input[name=plaatsid]').val(ui.item.id)}}).data("autocomplete")._renderItem=function(ul,item){return $("<li></li>").data("item.autocomplete",item).append("<a>"+item.value+" - "+item.info+"</a>").appendTo(ul)}}if($('#reviewvotes .star').length>0){$('#reviewvotes .star').mousemove(function(e){id=$(this).attr('id');offset=$(this).offset();x=e.pageX-offset.left-5;if(x<0)x=0;if(x>200)x=200;$('#'+id+'-score').width(x)}).click(function(){id=$(this).attr('id');if(x==0){$('#'+id+'-value').html('nvt')}else{$('#'+id+'-value').html((x/20).toFixed(1))}$('input[name='+id+']').val((x/2).toFixed(0));total=0;cnt=0;$('.voteval').each(function(){tmp=Number($(this).val());if(tmp>0){cnt++;total+=tmp}});if(cnt>0){$('#rate').html((total/cnt/10).toFixed(1));$('#totalscore').animate({width:(total/cnt)})}else{$('#rate').html('&nbsp;');$('#totalscore').animate({width:0})}}).mouseleave(function(){id=$(this).attr('id');x=$('input[name='+id+']').val()*2;$('#'+id+'-score').animate({width:x})})}});var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-2582109-6']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s)})();

