﻿jQuery.cookie=function(d,c,a){if(typeof c!="undefined"){a=a||{};if(c===null){c="";a.expires=-1}var h="";if(a.expires&&(typeof a.expires=="number"||a.expires.toUTCString)){var b;if(typeof a.expires=="number"){b=new Date;b.setTime(b.getTime()+a.expires*864e5)}else b=a.expires;h="; expires="+b.toUTCString()}var l=a.path?"; path="+a.path:"",j=a.domain?"; domain="+a.domain:"",k=a.secure?"; secure":"";document.cookie=[d,"=",encodeURIComponent(c),h,l,j,k].join("")}else{var f=null;if(document.cookie&&document.cookie!="")for(var g=document.cookie.split(";"),e=0;e<g.length;e++){var i=jQuery.trim(g[e]);if(i.substring(0,d.length+1)==d+"="){f=decodeURIComponent(i.substring(d.length+1));break}}return f}};(function(a){a.fn.mapslide=function(d){var c={width:a(this).width(),height:a(this).height(),expHeight:a(this).height()*2,expWidth:a(this).width(),zoom:14,color:"",mapOptions:null,lat:0,lng:0},b=a.extend({},c,d);return this.each(function(){$this=a(this);var c=a.fn.mapslide.getStaticMap(b);$this.html(c);$this.find("img").click(function(){$this.find("img").animate({marginTop:0},1e3);$this.children().animate({height:b.expHeight},1e3);$this.animate({height:b.expHeight,width:b.expWidth},1e3,function(){if(b.mapOptions==null)var c=new google.maps.LatLng(b.lat,b.lng),d={zoom:b.zoom,center:c,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:true},e=new google.maps.Map(a(this)[0],d),f=new google.maps.Marker({position:c,map:e,clickable:false});else var e=new google.maps.Map(a(this)[0],b.mapOptions)})})})};a.fn.mapslide.getStaticMap=function(a){var b="http://maps.google.com/maps/api/staticmap?center="+a.lat+","+a.lng+"&zoom="+a.zoom+"&size="+a.expWidth+"x"+a.expHeight+"&maptype=roadmap&markers=color:"+a.color+"|"+a.lat+","+a.lng+"&sensor=false",c="<img style='position:relative;margin-top:"+(a.expHeight-a.height)/-2+"px;z-index:999;' src='"+b+"' />",d="<div style='position:relative;overflow:hidden;width:"+a.width+"px;height:"+a.height+"px;'>"+c+"</div>";return d}})(jQuery);(function(){if(window.google&&google.gears)return;var a=null;if(typeof GearsFactory!="undefined")a=new GearsFactory;else try{a=new ActiveXObject("Gears.Factory");a.getBuildInfo().indexOf("ie_mobile")!=-1&&a.privateSetGlobalObject(this)}catch(b){if(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a);if(a&&typeof a.create=="undefined")a=null}}if(!a)return;if(!window.google)google={};if(!google.gears)google.gears={factory:a}})();
/*!
 * geo-location-javascript v0.4.3
 * http://code.google.com/p/geo-location-javascript/
 *
 * Copyright (c) 2009 Stan Wiechers
 * Licensed under the MIT licenses.
 *
 * Revision: $Rev: 68 $: 
 * Author: $Author: whoisstan $:
 * Date: $Date: 2010-02-15 13:42:19 +0100 (Mon, 15 Feb 2010) $:    
 */
var bb_successCallback,bb_errorCallback,bb_blackberryTimeout_id=-1;function handleBlackBerryLocationTimeout(){bb_blackberryTimeout_id!=-1&&bb_errorCallback({message:"Timeout error",code:3})}function handleBlackBerryLocation(){clearTimeout(bb_blackberryTimeout_id);bb_blackberryTimeout_id=-1;if(bb_successCallback&&bb_errorCallback){if(blackberry.location.latitude==0&&blackberry.location.longitude==0)bb_errorCallback({message:"Position unavailable",code:2});else{var a=null;if(blackberry.location.timestamp)a=new Date(blackberry.location.timestamp);bb_successCallback({timestamp:a,coords:{latitude:blackberry.location.latitude,longitude:blackberry.location.longitude}})}bb_successCallback=null;bb_errorCallback=null}}var geo_position_js=function(){var b={},a=null;b.getCurrentPosition=function(b,c,d){a.getCurrentPosition(b,c,d)};b.init=function(){try{if(typeof geo_position_js_simulator!="undefined")a=geo_position_js_simulator;else if(typeof bondi!="undefined"&&typeof bondi.geolocation!="undefined")a=bondi.geolocation;else if(typeof navigator.geolocation!="undefined"){a=navigator.geolocation;b.getCurrentPosition=function(b,d,e){function c(a){if(typeof a.latitude!="undefined")b({timestamp:a.timestamp,coords:{latitude:a.latitude,longitude:a.longitude}});else b(a)}a.getCurrentPosition(c,d,e)}}else if(typeof window.google!="undefined"&&typeof google.gears!="undefined")a=google.gears.factory.create("beta.geolocation");else if(typeof Mojo!="undefined"&&typeof Mojo.Service.Request!="Mojo.Service.Request"){a=true;b.getCurrentPosition=function(c,b,a){parameters={};if(a){if(a.enableHighAccuracy&&a.enableHighAccuracy==true)parameters.accuracy=1;if(a.maximumAge)parameters.maximumAge=a.maximumAge;if(a.responseTime)if(a.responseTime<5)parameters.responseTime=1;else if(a.responseTime<20)parameters.responseTime=2;else parameters.timeout=3}r=new Mojo.Service.Request("palm://com.palm.location",{method:"getCurrentPosition",parameters:parameters,onSuccess:function(a){c({timestamp:a.timestamp,coords:{latitude:a.latitude,longitude:a.longitude,heading:a.heading}})},onFailure:function(a){if(a.errorCode==1)b({code:3,message:"Timeout"});else if(a.errorCode==2)b({code:2,message:"Position Unavailable"});else b({code:0,message:"Unknown Error: webOS-code"+errorCode})}})}}else if(typeof device!="undefined"&&typeof device.getServiceObject!="undefined"){a=device.getServiceObject("Service.Location","ILocation");b.getCurrentPosition=function(c,d){function e(e,b,a){if(b==4)d({message:"Position unavailable",code:2});else c({timestamp:null,coords:{latitude:a.ReturnValue.Latitude,longitude:a.ReturnValue.Longitude,altitude:a.ReturnValue.Altitude,heading:a.ReturnValue.Heading}})}var b={};b.LocationInformationClass="BasicLocationInformation";a.ILocation.GetLocation(b,e)}}else if(typeof window.blackberry!="undefined"&&blackberry.location.GPSSupported){if(typeof blackberry.location.setAidMode=="undefined")return false;blackberry.location.setAidMode(2);b.getCurrentPosition=function(b,c,a){bb_successCallback=b;bb_errorCallback=c;if(a.timeout)bb_blackberryTimeout_id=setTimeout("handleBlackBerryLocationTimeout()",a.timeout);else bb_blackberryTimeout_id=setTimeout("handleBlackBerryLocationTimeout()",6e4);blackberry.location.onLocationUpdate("handleBlackBerryLocation()");blackberry.location.refreshLocation()};a=blackberry.location}}catch(c){alert("error="+c);typeof console!="undefined"&&console.log(c);return false}return a!=null};return b}();function VenuePage(f,b,a){var g=f,d=b,e=a;function c(){var a=new google.maps.LatLng(d,e),b={zoom:14,center:a,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:true},c=new google.maps.Map($("#venueMap")[0],b),f=new google.maps.Marker({position:a,map:c,clickable:false})}$(document).ready(function(){c()})}function CityPage(f,j){var b=j,i=f,c,a,d=true;function h(){c=new google.maps.Geocoder;c.geocode({address:i},function(b,c){c==google.maps.GeocoderStatus.OK&&a.setCenter(b[0].geometry.location)});var b={zoom:14,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:false};a=new google.maps.Map($("#map")[0],b);zoomChangeBoundsListener=google.maps.event.addListener(a,"bounds_changed",function(){if(d){this.setZoom(14);d=false}google.maps.event.removeListener(zoomChangeBoundsListener)});e()}function e(){if(b!=null&&b.length>0){for(var d=new google.maps.LatLngBounds,c=0;c<b.length;c++){var e=new google.maps.LatLng(b[c].Lat,b[c].Lng);g(b[c],e);d.extend(e)}a.fitBounds(d);a.setZoom(1)}}function g(b,e){var c=new google.maps.Marker({map:a,title:b.Title,position:e}),d=new google.maps.InfoWindow({content:"<h3>"+b.Title+"</h3><p>at "+b.Description+"<br /><a href='"+b.Link+"'>view gig</a></p>"});google.maps.event.addListener(c,"click",function(){a.setCenter(new google.maps.LatLng(b.Lat,b.Lng));d.open(a,c)});google.maps.event.addListener(c,"mouseover",function(){$("#g"+b.ID).addClass("highlight");setTimeout(function(){$("#g"+b.ID).removeClass("highlight")},2e3)})}$(document).ready(function(){h()})}function GigPage(a,b){$(document).ready(function(){var c={lat:a,lng:b,color:"0xd70d41",expHeight:500};$("#mapslide").mapslide(c)})}function Global(){function a(){if($.cookie("setLocation")==null)geo_position_js.init()&&geo_position_js.getCurrentPosition(function(a){var c=a.coords.latitude,b=a.coords.longitude;$.ajax({url:"/location/set",data:{lat:c,lng:b},success:function(a){if(a.FoundCity){$("#wrap").prepend("<div id='notification' style='display:none'>We have updated your location, find gigs near <a href='"+a.Link+"'>"+a.City+", "+a.CountryCode+"</a><a id='closeNotification'>X</a></div>");$("#notification").slideDown();$("#closeNotification").click(function(){$("#notification").slideUp()})}},dataType:"json",type:"POST"})},function(){})}$(function(){a()})}var global=new Global
