baseurl="http://www.yourviews.co.nz/";previous_login_id='';ajaxCommentFlag=0;gMapsZoomLevel=11;function Blink(time,showInterval,hideInterval)
{var timer=window.setInterval(function(){$(".help-arrow").css("opacity","0");window.setTimeout(function(){$(".help-arrow").css("opacity","1");},hideInterval);},showInterval*2);window.setTimeout(function(){clearInterval(timer);},time);}
function CheckVote(id)
{HideArrow();$('#voteUp'+id).replaceWith($("#ajaxloader").clone().css('display','inline').removeAttr("id").attr("id","voteUp"+id)).ready(function()
{$('#voteUp'+id).load("/users_votes/checkLoggedIn/"+id);});}
function checkEmpty(b)
{}
function EditText(id,label)
{}
function DeleteComment(comment_id,item_id)
{$('#ajax-comment'+item_id).load("/comments/delete/"+comment_id,function(){$('#item-comment'+comment_id).hide();});}
function getURLParameter(name)
{return unescape((RegExp(name+'='+'(.+?)(&|$)').exec(location.search)||[,null])[1]);}
function HideAdmin()
{$("#admin-menu").hide();}
function HideArrow()
{$('.help-arrow').hide();}
function HideLogin(id)
{$('#voteUp'+id).load(baseurl+"votes/view/"+id);$('#thumbs-link-'+id).show();return false;}
function recordMapClick()
{$.post("/users/map_click/",function(data){return;});}
function recordVoteClick(id,link,category,action)
{$.post("/items/vote_click/"+id,function(data){try{var myTracker=_gat._getTrackerByName();_gaq.push(['myTracker._trackEvent',' + category + ',' + action + ']);setTimeout('document.location = "'+link.href+'"',100)}catch(err){}});}
function recordClick(link,category,action)
{try{var myTracker=_gat._getTrackerByName();_gaq.push(['myTracker._trackEvent',' + category + ',' + action + ']);setTimeout('document.location = "'+link.href+'"',100)}catch(err){}}
function SlideToggle(id)
{$(id).slideToggle("fast");}
function ShowGoogleMap(markerx,markery)
{}
function ShowLogin(id)
{if(previous_login_id)
{innerhtml='<div id="login-form'+previous_login_id+'"></div>';$("#login-form"+previous_login_id).replaceWith(innerhtml);}
previous_login_id=id;$("#login-form"+id).replaceWith
($("#login-form").clone().show().removeAttr("id").attr("id","login-form"+id));}
function VoteDown()
{}
function WallPost($category,$item,$url)
{FB.Connect.streamPublish('I just voted for '+$item+' on '+$url);}
startingLatitude="-43.52";startingLongitude="172.63";hoverLatitude="-43.52";hoverLongitude="172.73";function initializeGoogleMap()
{if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_canvas"));map.setCenter(new GLatLng(startingLatitude,startingLongitude),11);map.setUIToDefault();geocoder=new GClientGeocoder();}}
function showAddress(address,name,plus_name)
{if(geocoder){geocoder.getLatLng(address,function(point){if(!point){}else{var marker=new GMarker(point);map.addOverlay(marker);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml('<a class="underline1" href="#'+plus_name+'">'+name+'</a>');});}});}}
$(document).ready(function()
{$("#map_canvas").hover(function()
{$("#map_canvas").css('width','540px');$("#map_canvas").css('left','505px');map.setCenter(new GLatLng(startingLatitude,startingLongitude),gMapsZoomLevel);},function()
{$("#map_canvas").css('width','250px');$("#map_canvas").css('left','650px');map.setCenter(new GLatLng(hoverLatitude,hoverLongitude),gMapsZoomLevel);});});function createCookie(name,value,days)
{if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name)
{var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
