proccessRouteSearchClass.prototype.proccess1Stop=function(div,data){div.html('прямые: ')
for(var i=0;i<data.length;i++){var row=String(data[i]).split(' ')
id=row[0];number=row[1]
div.append('<a href="javascript:void(0)" id="'+id+'">'+number+'</a> ')}
if(data.length==0){div.append('ничего не найдено')}
var obj=this;div.find('a').click(function(){ajax_load()
div.find('a').css('color','white')
$(this).css('color','orange')
mapView.reset(true)
poly.getRouteWaypoints($(this).attr('id'))
$("#left_panel").html('');poly.getInfo();ajax_finished()});}
proccessRouteSearchClass.prototype.proccess2Stop=function(div,data){div.append('<br />с пересадкой: ')
for(var i=0;i<data.length;i++){var row1=String(data[i][0]).split(' ')
if(data[i][1]==null)continue;var row2=String(data[i][1]).split(' ')
div.append('<a href="javascript:void(0)" class="2routes" id="'+i+'">'
+String(row1[1]).split(' ')+'-'+String(row2[1]).split(' ')+'</a> ')}
var obj=this;div.find("a.2routes").click(function(){ajax_load()
mapView.reset(true)
div.find("a").css('color','white')
$(this).css('color','orange')
i=$(this).attr('id')
var id1=String(data[i][0]).split(' ')[0]
var id2=String(data[i][1]).split(' ')[0]
poly.getRouteWaypoints(id1)
poly2.getRouteWaypoints(id2)
$("#left_panel").html('');poly.getInfo();$("#left_panel").append('<br /><br />');poly2.getInfo();ajax_finished()})}
function proccessRouteSearchClass(parsed){this.proccess1Stop($("#info_panel"),parsed[0])
if(parsed[1].length>0){this.proccess2Stop($("#info_panel"),parsed[1])}
$("#info_panel a:first").click()
if(!$("#busSearchToggable").is(':visible')){$(".soortkiezer").not("#busSearchToggable").not("#left_panel").hide(600);$("#busSearchToggable").show(600);}
ajax_finished()}
function proccessRouteSearch(parsed){new proccessRouteSearchClass(parsed)}
if(typeof(google.maps.Polyline.prototype.runEdit)==="undefined"){google.maps.Polyline.prototype.runEdit=function(flag){if(!flag){flag=true;}
var self=this;if(flag){var imgGhostVertex=new google.maps.MarkerImage('css/ghostVertex.png',new google.maps.Size(11,11),new google.maps.Point(0,0),new google.maps.Point(6,6));var imgGhostVertexOver=new google.maps.MarkerImage('css/ghostVertexOver.png',new google.maps.Size(11,11),new google.maps.Point(0,0),new google.maps.Point(6,6));var ghostPath=new google.maps.Polyline({map:this.getMap(),strokeColor:this.strokeColor,strokeOpacity:0.2,strokeWeight:this.strokeWeight});var vertexGhostMouseOver=function(){this.setIcon(imgGhostVertexOver);};var vertexGhostMouseOut=function(){this.setIcon(imgGhostVertex);};var vertexGhostDrag=function(){if(ghostPath.getPath().getLength()===0){ghostPath.setPath([this.marker.getPosition(),this.getPosition(),self.getPath().getAt(this.marker.inex+1)]);}
ghostPath.getPath().setAt(1,this.getPosition());};var moveGhostMarkers=function(marker){var Vertex=self.getPath().getAt(marker.inex);var prevVertex=self.getPath().getAt(marker.inex-1);if((typeof(Vertex)!=="undefined")&&(typeof(Vertex.ghostMarker)!=="undefined")){if(typeof(google.maps.geometry)==="undefined"){Vertex.ghostMarker.setPosition(new google.maps.LatLng(Vertex.lat()+0.5*(self.getPath().getAt(marker.inex+1).lat()-Vertex.lat()),Vertex.lng()+0.5*(self.getPath().getAt(marker.inex+1).lng()-Vertex.lng())));}else{Vertex.ghostMarker.setPosition(google.maps.geometry.spherical.interpolate(Vertex,self.getPath().getAt(marker.inex+1),0.5));}}
if((typeof(prevVertex)!=="undefined")&&(typeof(prevVertex.ghostMarker)!=="undefined")){if(typeof(google.maps.geometry)==="undefined"){prevVertex.ghostMarker.setPosition(new google.maps.LatLng(prevVertex.lat()+0.5*(marker.getPosition().lat()-prevVertex.lat()),prevVertex.lng()+0.5*(marker.getPosition().lng()-prevVertex.lng())));}else{prevVertex.ghostMarker.setPosition(google.maps.geometry.spherical.interpolate(prevVertex,marker.getPosition(),0.5));}}};var vertexGhostDragEnd=function(){ghostPath.getPath().forEach(function(){ghostPath.getPath().pop();});self.getPath().insertAt(this.marker.inex+1,this.getPosition());createMarkerVertex(self.getPath().getAt(this.marker.inex+1)).inex=this.marker.inex+1;moveGhostMarkers(this.marker);createGhostMarkerVertex(self.getPath().getAt(this.marker.inex+1));self.getPath().forEach(function(vertex,inex){if(vertex.marker){vertex.marker.inex=inex;}});};var createGhostMarkerVertex=function(point){if(point.marker.inex<self.getPath().getLength()-1){var markerGhostVertex=new google.maps.Marker({position:(typeof(google.maps.geometry)==="undefined")?new google.maps.LatLng(point.lat()+0.5*(self.getPath().getAt(point.marker.inex+1).lat()-point.lat()),point.lng()+0.5*(self.getPath().getAt(point.marker.inex+1).lng()-point.lng())):google.maps.geometry.spherical.interpolate(point,self.getPath().getAt(point.marker.inex+1),0.5),map:self.getMap(),icon:imgGhostVertex,draggable:true,raiseOnDrag:false});google.maps.event.addListener(markerGhostVertex,"mouseover",vertexGhostMouseOver);google.maps.event.addListener(markerGhostVertex,"mouseout",vertexGhostMouseOut);google.maps.event.addListener(markerGhostVertex,"drag",vertexGhostDrag);google.maps.event.addListener(markerGhostVertex,"dragend",vertexGhostDragEnd);point.ghostMarker=markerGhostVertex;markerGhostVertex.marker=point.marker;return markerGhostVertex;}
return null;};}
var imgVertex=new google.maps.MarkerImage('css/vertex.png',new google.maps.Size(11,11),new google.maps.Point(0,0),new google.maps.Point(6,6));var imgVertexOver=new google.maps.MarkerImage('css/vertexOver.png',new google.maps.Size(11,11),new google.maps.Point(0,0),new google.maps.Point(6,6));var vertexMouseOver=function(){this.setIcon(imgVertexOver);};var vertexMouseOut=function(){this.setIcon(imgVertex);};var vertexDrag=function(){var movedVertex=this.getPosition();movedVertex.marker=this;movedVertex.ghostMarker=self.getPath().getAt(this.inex).ghostMarker;self.getPath().setAt(this.inex,movedVertex);if(flag){moveGhostMarkers(this);}};var vertexRightClick=function(){if(flag){var Vertex=self.getPath().getAt(this.inex);var prevVertex=self.getPath().getAt(this.inex-1);if(typeof(Vertex.ghostMarker)!=="undefined"){Vertex.ghostMarker.setMap(null);}
self.getPath().removeAt(this.inex);if(typeof(prevVertex)!=="undefined"){if(this.inex<self.getPath().getLength()){moveGhostMarkers(prevVertex.marker);}
else{prevVertex.ghostMarker.setMap(null);prevVertex.ghostMarker=undefined;}}}
else{self.getPath().removeAt(this.inex);}
this.setMap(null);self.getPath().forEach(function(vertex,inex){if(vertex.marker){vertex.marker.inex=inex;}});if(self.getPath().getLength()===1){self.getPath().pop().marker.setMap(null);}};var createMarkerVertex=function(point){var markerVertex=new google.maps.Marker({position:point,map:self.getMap(),icon:imgVertex,draggable:true,raiseOnDrag:false});google.maps.event.addListener(markerVertex,"mouseover",vertexMouseOver);google.maps.event.addListener(markerVertex,"mouseout",vertexMouseOut);google.maps.event.addListener(markerVertex,"drag",vertexDrag);google.maps.event.addListener(markerVertex,"rightclick",vertexRightClick);point.marker=markerVertex;return markerVertex;};this.getPath().forEach(function(vertex,inex){createMarkerVertex(vertex).inex=inex;if(flag){createGhostMarkerVertex(vertex);}});};}
if(typeof(google.maps.Polyline.prototype.stopEdit)==="undefined"){google.maps.Polyline.prototype.stopEdit=function(){this.getPath().forEach(function(vertex,inex){if(vertex.marker){vertex.marker.setMap(null);vertex.marker=undefined;}
if(vertex.ghostMarker){vertex.ghostMarker.setMap(null);vertex.ghostMarker=undefined;}});};}
google.maps.Map.prototype.markers=new Array();google.maps.Map.prototype.getMarkers=function(){return this.markers};google.maps.Map.prototype.clearMarkers=function(){for(var i=0;i<this.markers.length;i++){if(this.markers[i]){this.markers[i].setMap(null);}}
this.markers=new Array();};google.maps.Marker.prototype._setMap=google.maps.Marker.prototype.setMap;google.maps.Marker.prototype.setMap=function(map){if(map){map.markers[map.markers.length]=this;}
this._setMap(map);}
google.maps.Polyline.prototype.getPosition=function(){return this.position;}
google.maps.Polyline.prototype.drawMarker=function(number){centerIndex=Math.round(this.getPath().length/2)
latlng=this.getPath().getAt(centerIndex);var marker=new MarkerWithLabel({map:map,position:latlng,draggable:false,labelContent:number,labelAnchor:new google.maps.Point(22,0),labelClass:"labels",labelStyle:{opacity:0.75}});}
google.maps.Polyline.prototype.setPosition=function(position){this.position=position;}
google.maps.Polyline.prototype.setRouteId=function(route_id){this.route_id=route_id;}
google.maps.Polyline.prototype.getRouteId=function(){return this.route_id;}
google.maps.Polyline.prototype.getRouteWaypoints=function(id){var poly=this;poly.setRouteId(id)
$.ajax({url:'/route/get_routewaypoints/id/'+id,dataType:"json",async:true,success:function(data){poly.setroute(data);}});}
google.maps.Polyline.prototype.setroute=function(os)
{var path=this.getPath();for(var i=0;i<os.length;i++){waypoint=os[i]['Waypoint']
var latlng=new google.maps.LatLng(waypoint['lat'],waypoint['lng'])
path.push(latlng);}}
google.maps.Polyline.prototype.setrouteArray=function(os)
{var tmp;var lat;var lng;var path=this.getPath();for(var i=0;i<os.length;i++){waypoint=os[i];tmp=new Array();for(var j in waypoint){tmp.push(waypoint[j]);}
lat=tmp[0];lng=tmp[1];var latlng=new google.maps.LatLng(lat,lng);path.push(latlng);}}
google.maps.Polyline.prototype.getInfo=function(){var poly=this;proccessFunction=function(data){$("#left_panel").append(data)
$("#left_panel").show(600)
$("#left_panel").find('a#polyEditLink'+poly.getRouteId()).each(function(){$(this).click(function(){mapView.editRoute(poly);})})}
$.ajax({url:'/route/get_route/id/'+poly.getRouteId(),cache:true,dataType:"html",async:false,success:proccessFunction});}
google.maps.Polyline.prototype._isEditing=false;google.maps.Polyline.prototype._runEdit=google.maps.Polyline.prototype.runEdit;google.maps.Polyline.prototype.runEdit=function(flag){this._isEditing=true;this._runEdit(flag);}
google.maps.Polyline.prototype._stopEdit=google.maps.Polyline.prototype.stopEdit;google.maps.Polyline.prototype.stopEdit=function(){this._isEditing=false;this._stopEdit();}
google.maps.Polyline.prototype.isEditing=function(){return this._isEditing}
google.maps.Polyline.prototype.save=function(type_id,number){this.stopEdit();var markers=[]
for(var i=0;i<this.getPath().getLength();i++){latlng=this.getPath().getAt(i)
markers.push([latlng,'waypoint'])}
var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/update');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('&path='+JSON.stringify(this.getPath())+'&city_id='+city_id+'&type_id='+type_id+'&id='+this.route_id)
jax.onreadystatechange=function(){if(jax.readyState==4){if(jax.responseText.indexOf('bien')+1)alert('Updated');else alert(jax.responseText)}}}
google.maps.Polyline.prototype.addMarker=function(latlng,drawPoly){var spoly=this;if(isDeleting==true)return;var path=spoly.getPath();var marker=null;for(var j=0;j<map.markers.length;j++){if(map.markers[j]&&map.markers[j].getPosition()&&map.markers[j].getPosition().lat()==latlng.lat()){marker=map.markers[j]}}
if(marker==null){marker=new google.maps.Marker({position:latlng,title:'#'+path.getLength(),draggable:true,map:map,icon:waypointIcon});}
if(drawPoly)path.push(latlng);contentNode=document.getElementById('infoWindowNode').cloneNode(true)
var infowindow=new google.maps.InfoWindow({content:contentNode});$(contentNode).find('#deleteMarker').click(function(){if(drawPoly){(function(marker){isDeleting=true;path.removeAt(marker.index)
marker.setMap(null)
map.getMarkers()[marker.index]=null;setTimeout("isDeleting = false",1000)})(marker);}else{(function(marker){isDeleting=true;marker.setMap(null)
map.getMarkers()[marker.index]=null;deleteStop(marker.getPosition())
infowindow.close()
setTimeout("isDeleting = false",1000)})(marker);}})
$(contentNode).find('#changeMarkerType').click(function(){(function(marker){if(marker.getIcon()==waypointIcon){marker.setIcon(stopOverIcon)
changeMarkerType(marker.getPosition(),1)}else{marker.setIcon(waypointIcon)
changeMarkerType(marker.getPosition(),0)}
isDeleting=true;infowindow.close()
setTimeout("isDeleting = false",1000)})(marker);})
$(contentNode).find('#continueRoute').click(function(){(function(marker){addMarker(marker.getPosition(),true,poly)})(marker);isDeleting=true;infowindow.close()
setTimeout("isDeleting = false",1000)})
marker.index=path.getLength()-1
google.maps.event.addListener(marker,'drag',function(event){if(drawPoly){path.removeAt(marker.index)
path.insertAt(marker.index,event.latLng)}});google.maps.event.addListener(marker,'dragstart',function(event){marker.startPosition=marker.getPosition()});google.maps.event.addListener(marker,'dragend',function(event){markerMove(marker.startPosition,event.latLng)});google.maps.event.addListener(marker,'click',function(event){addMarker(marker.getPosition(),true,poly)});return marker}
function newPoly(color,map){var polyOptions={strokeColor:color,strokeOpacity:0.5,strokeWeight:5}
var poly=new google.maps.Polyline(polyOptions);poly.setMap(map);return poly}
CircleMarker.prototype.setVisible=function(visible){if(this.visible==visible)return;this.visible=visible;this.marker.setVisible(visible);if(visible){this.bindCircle();}else{this.circle.setMap(null);}}
CircleMarker.prototype.bindCircle=function(){this.circle=new google.maps.Circle({map:map,radius:350});this.circle.bindTo('center',this.marker,'position');}
CircleMarker.prototype.getPosition=function(){return this.marker.getPosition()}
CircleMarker.prototype.setPosition=function(latlng){return this.marker.setPosition(latlng)}
function CircleMarker(map,latlng,icon){this.visible=true;this.marker=new google.maps.Marker({map:map,position:latlng,draggable:true,icon:icon});this.bindCircle();}
GeoLocationObjectList.prototype.isDataLoaded=false;GeoLocationObjectList.prototype.objects=new Array();GeoLocationObjectList.prototype.url="/object";GeoLocationObjectList.prototype.noclear=false;GeoLocationObjectList.prototype.setNoClearDiv=function(noclear){this.noclear=noclear;}
GeoLocationObjectList.prototype.proccessJSON=function(data,div){if(this.noclear==false){div.html('');if(data.length==0)div.html('ничего не найдено');this.objects=new Array();}
var list=this;$(data).each(function(i,item){var icon=markerIconList[item.type_id]
if(!list.searchById(item.id)){var index=list.add(item.id,new google.maps.LatLng(item.lat,item.lng),icon,item);}});this.show(div)}
GeoLocationObjectList.prototype.searchById=function(id){for(var i=0;i<this.objects.length;i++){if(this.objects[i].id==id){return true;}}
return false;}
GeoLocationObjectList.prototype.show=function(div){var list=this
$(this.objects).each(function(i){item=this.getData();div.append('<p class="right_menu_item">\
      <a href="javascript:void(0)" index="'+i+'"><b><u>'+item.title+"</u></b></a><br />"+item.address+"</p>")})
div.find('a').click(function(){$.colorbox.close()
$(this).parent().css('background','#339900');div.find('a').not($(this)).each(function(){$(this).parent().css('background','none');});var object=list.get($(this).attr('index'));map.panTo(object.getLatLng())
object.showInfo()})}
GeoLocationObjectList.prototype.displayObjects=function(div){if(div==undefined)div=this.div
var list=this;if(this.isDataLoaded==true){mapView.reset()
for(var i=0;i<this.objects.length;i++){this.get(i).placeMarkerOnMap(this.gMap)}
return;}
this.objects=new Array();$.ajax({url:this.url+'/getNotApproved',cache:true,dataType:"json",success:function(data){list.proccessJSON(data,div)
list.isDataLoaded=true;}});}
GeoLocationObjectList.prototype.add=function(id,latlng,icon,data){title=data?data.title:''
var geoObject=new GeoLocationObject(id,latlng,icon,this.url,title);geoObject.placeMarkerOnMap(this.gMap);geoObject.setData(data);this.objects.push(geoObject);}
GeoLocationObjectList.prototype.get=function(index){return this.objects[index]}
GeoLocationObjectList.prototype.getAddMarker=function(){return this.markerAdd;}
GeoLocationObjectList.prototype.showAddForm=function(mapView,latlng,url){mapView.reset()
this.displayObjects(this.div)
this.markerAdd=new google.maps.Marker({map:mapView.map,position:latlng,draggable:true,icon:"http://maps.google.com/mapfiles/marker.png"});var projection=mapView.overlay.getProjection();var pixel=projection.fromLatLngToContainerPixel(latlng)
pixel.x+=470
var whereToCenter=projection.fromContainerPixelToLatLng(pixel);mapView.map.panTo(whereToCenter);$.colorbox({href:url+"/ajaxFirstLoad/true/city_id/"+city_id,});GeoLocationObjectList.geoObjectAdddedId=null;var geoObjectList=this;$(document).unbind('cbox_cleanup');$(document).bind('cbox_cleanup',function(){mapView.reset()
geoObjectList.displayObjects(this.div)
if(GeoLocationObjectList.geoObjectAdddedId!=null){geoObjectList.add(GeoLocationObjectList.geoObjectAdddedId,latlng)}
geoObjectList.onAddFormClose();});}
GeoLocationObjectList.prototype.onAddFormClose=null;function GeoLocationObjectList(gMap,div){this.gMap=gMap
this.div=div}
GeoLocationObject.prototype.data=null;GeoLocationObject.prototype.getData=function(){return this.data}
GeoLocationObject.prototype.setData=function(data){this.data=data;}
GeoLocationObject.prototype.getLatLng=function(){return this.latlng;}
GeoLocationObject.prototype.placeMarkerOnMap=function(gMap){if(!this.icon){var icon="http://maps.google.com/mapfiles/marker.png"}else{var icon="/uploads/icons/thumbnail/"+this.icon;}
var marker=new google.maps.Marker({map:map,position:this.latlng,draggable:false,icon:icon,title:this.title});var geoObject=this;google.maps.event.addListener(marker,'click',function(event){geoObject.showInfo()});}
GeoLocationObject.prototype.showInfoVersion=function(version){$.ajax({url:this.url+"/showVersion/object_id/"+this.id+"/version/"+version,cache:true,dataType:"html",success:function(data){$("#left_panel").html(data)
$("#left_panel").show(600)}});}
GeoLocationObject.prototype.showInfo=function(urlLoading){var object=this;$.ajax({url:this.url+"/show/id/"+this.id,cache:true,dataType:"html",success:function(data){$("#left_panel").html(data)
$("#left_panel").show(600);if(urlLoading){object.latlng=tmpLatLng;object.icon=markerIconList[tmpIcon];object.title=tmpTitle
object.placeMarkerOnMap(mapView.map)
mapView.map.panTo(object.getLatLng())}else{}}});}
function GeoLocationObject(id,latlng,icon,url,title){this.id=id;this.latlng=latlng;this.url=url;this.title=title
this.icon=icon;}
function GeoLocationObjectListLostAndFound(gMap,div){this.gMap=gMap
this.div=div}
extend(GeoLocationObjectListLostAndFound,GeoLocationObjectList)
GeoLocationObjectListLostAndFound.prototype.show=function(div){var list=this
$(this.objects).each(function(i){item=this.getData();if(item.preview){var img='<img src="/uploads/objects/thumbnail/'+item.preview+'" height="48" align="left" hspace="4" />'}else{var img=''}
div.append('<p class="right_menu_item" style="height:48px">'+img+'\
      <a href="javascript:void(0)" index="'+i+'"><b><u>'+item.title+'</u></b></p>')})
div.find('a').click(function(){$.colorbox.close()
$(this).parent().css('background','#339900');div.find('a').not($(this)).each(function(){$(this).parent().css('background','none');});var object=list.get($(this).attr('index'));map.panTo(object.getLatLng())
object.showInfo()})}
RouteControl.prototype.options=null;RouteControl.prototype.options2=null;RouteControl.prototype.addOption=function(id,value){this.options.push(new Array(id,value))}
RouteControl.prototype.addOption2=function(id,id2,value){this.options2.push(new Array(id,id2,value))}
RouteControl.prototype.redraw=function(){var options='';for(var i=0;i<this.options.length;i++){options+='<option type="1" id="'+this.options[i][0]+'">'+this.options[i][1]+'</option>';}
for(var i=0;i<this.options2.length;i++){options+='<option type="2" id2="'+this.options2[i][1]+'" id="'+this.options2[i][0]+'">'+this.options2[i][2]+'</option>';}
this.goHomeText.innerHTML='<select id="selectRoute">'+options+'</select>';$(this.goHomeText).find('select').change(function(){loadSelectedRoutes($(this).find('option:selected'))});loadSelectedRoutes($(this.goHomeText).find('select').find('option:selected'))
this.options=new Array();this.options2=new Array();}
function RouteControl(map,div){this.options=new Array();this.options2=new Array();var controlDiv=div;var control=this;controlDiv.style.padding='5px';var goHomeUI=document.createElement('DIV');goHomeUI.title='';controlDiv.appendChild(goHomeUI);this.goHomeText=document.createElement('DIV');this.goHomeText.innerHTML='<select id="selectRoute"></select>';goHomeUI.appendChild(this.goHomeText);}
var gYellowIcon=new google.maps.MarkerImage("http://labs.google.com/ridefinder/images/mm_20_yellow.png",new google.maps.Size(12,20),new google.maps.Point(0,0),new google.maps.Point(6,20));var gRedIcon=new google.maps.MarkerImage("http://labs.google.com/ridefinder/images/mm_20_red.png",new google.maps.Size(12,20),new google.maps.Point(0,0),new google.maps.Point(6,20));var gSmallShadow=new google.maps.MarkerImage("http://labs.google.com/ridefinder/images/mm_20_shadow.png",new google.maps.Size(22,20),new google.maps.Point(0,0),new google.maps.Point(6,20));function LocalResult(result){var me=this;me.result_=result;me.resultNode_=me.node();me.marker_=me.marker();google.maps.event.addDomListener(me.resultNode_,'mouseover',function(){me.highlight(true);});google.maps.event.addDomListener(me.resultNode_,'mouseout',function(){if(!me.selected_)me.highlight(false);});google.maps.event.addDomListener(me.resultNode_,'click',function(){me.select();});document.getElementById("searchwell").appendChild(me.resultNode_);}
LocalResult.prototype.node=function(){if(this.resultNode_)return this.resultNode_;return this.html();};LocalResult.prototype.marker=function(){var me=this;if(me.marker_)return me.marker_;var marker=me.marker_=new google.maps.Marker({position:new google.maps.LatLng(parseFloat(me.result_.lat),parseFloat(me.result_.lng)),icon:gYellowIcon,shadow:gSmallShadow,map:map});google.maps.event.addListener(marker,"click",function(){me.select();});return marker;};LocalResult.prototype.select=function(){unselectMarkers();this.selected_=true;this.highlight(true);gInfoWindow.setContent(this.html(true));gInfoWindow.open(map,this.marker());};LocalResult.prototype.isSelected=function(){return this.selected_;};LocalResult.prototype.unselect=function(){this.selected_=false;this.highlight(false);};LocalResult.prototype.html=function(){var me=this;var container=document.createElement("div");container.className="unselected";var p=document.createElement("p");p.innerHTML=me.result_.title+"<br />"+me.result_.streetAddress;container.appendChild(p);return container;}
LocalResult.prototype.highlight=function(highlight){this.marker().setOptions({icon:highlight?gRedIcon:gYellowIcon});this.node().className="unselected"+(highlight?" red":"");}
Map.prototype.polyList=new Array();Map.prototype.reset=function(init)
{if(init==null){mapView.markersSetVisible(false)}
if(poly)poly.setMap(null)
if(poly2)poly2.setMap(null)
for(var i=0;i<this.polyList.length;i++){this.polyList[i].setMap(null);}
this.polyList=new Array();this.map.clearMarkers()
poly=this.addPoly('#003DF5')
poly2=this.addPoly('#B88A00')}
Map.prototype.newRoute=function(){this.reset(true);$.ajax({url:'/route/new/ajaxFirstLoad/true',dataType:"html",async:true,success:function(html){$("#left_panel").html(html);$("#left_panel").show(600);}});var x=this.map.getCenter();var y=new google.maps.LatLng(this.map.getCenter().lat(),this.map.getCenter().lng()+0.025);this.newRoutePoly=this.addPoly('#003DF5');this.newRoutePoly.getPath().push(x);this.newRoutePoly.getPath().push(y);this.newRoutePoly.runEdit(true);}
Map.prototype.editRoute=function(poly){$.ajax({url:'/route/edit/ajaxFirstLoad/true/id/'+poly.getRouteId(),dataType:"html",async:true,success:function(html){$("#left_panel").html(html);$("#left_panel").show(600);}});poly.runEdit(true);this.newRoutePoly=poly}
Map.prototype.getNewRoute=function(){return this.newRoutePoly}
Map.prototype.addPoly=function(color)
{var poly=newPoly(color,this.map)
this.polyList.push(poly)
return poly}
Map.prototype.search=function(map){var mapView=this;return function(event){ajax_load()
mapView.reset(true)
var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/search');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('marker='+JSON.stringify(map.fromMarker.getPosition())+'&marker2='+JSON.stringify(map.toMarker.getPosition())+'&city_id='+city_id)
jax.onreadystatechange=function(){if(jax.readyState==4){Map.onSearchDataLoaded(JSON.parse(jax.responseText))}}}}
Map.prototype.setCityId=function(id){city_id=id}
Map.onSearchDataLoaded=null;Map.prototype.initializeMarkers=function(myLatA,myLngA,myLat,myLng){if(Map.onSearchDataLoaded==null){alert('Define Map.onSearchDataLoaded callback function(data) {}')
return;}
this.reset(true)
this.fromMarker=new CircleMarker(this.map,new google.maps.LatLng(myLatA,myLngA),"http://maps.google.com/mapfiles/marker"+String.fromCharCode(65)+".png");google.maps.event.addListener(this.fromMarker.marker,'dragend',this.search(this));this.toMarker=new CircleMarker(this.map,new google.maps.LatLng(myLat,myLng),"http://maps.google.com/mapfiles/marker"+String.fromCharCode(66)+".png");google.maps.event.addListener(this.toMarker.marker,'dragend',this.search(this));this.map.markers=new Array();gInfoWindow=new google.maps.InfoWindow;google.maps.event.addListener(gInfoWindow,'closeclick',function(){unselectMarkers();});google.maps.event.addListener(gInfoWindow,'closeclick',function(){unselectMarkers();});}
Map.prototype.OnLocalSearch=function(){if(!gLocalSearch.results)return;var searchWell=document.getElementById("searchwell");searchWell.innerHTML="";for(var i=0;i<gCurrentResults.length;i++){gCurrentResults[i].marker().setMap(null);}
gInfoWindow.close();gCurrentResults=[];for(var i=0;i<gLocalSearch.results.length;i++){gCurrentResults.push(new LocalResult(gLocalSearch.results[i]));}
var attribution=gLocalSearch.getAttribution();if(attribution){document.getElementById("searchwell").appendChild(attribution);}
var first=gLocalSearch.results[0];if(first){map.setCenter(new google.maps.LatLng(parseFloat(first.lat),parseFloat(first.lng)));}}
Map.prototype.markersSetVisible=function(visible){this.fromMarker.setVisible(visible);this.toMarker.setVisible(visible);}
function Map(myLatA,myLngA,myLat,myLng){var myLatlng=new google.maps.LatLng(myLat,myLng);var myOptions={zoom:13,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM}}
this.map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);map=this.map;this.initializeMarkers(myLatA,myLngA,myLat,myLng);var toMarker=this.toMarker;this.overlay=new google.maps.OverlayView();this.overlay.draw=function(){};this.overlay.setMap(map);this.markersSetVisible(false);}
var routeControl=null;function MapWidget(myLatA,myLngA,myLat,myLng){var myLatlng=new google.maps.LatLng(myLat,myLng);var myOptions={zoom:13,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:true}
map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);var routeControlDiv=document.createElement('DIV');routeControl=new RouteControl(map,routeControlDiv);routeControlDiv.index=1;map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);this.initializeMarkers(myLatA,myLngA,myLat,myLng);}
extend(MapWidget,Map)
function proccessSearchMapWidget(parsed){for(var i=0;i<parsed[0].length;i++){var row=String(parsed[0][i]).split(' ')
id=row[0];number=row[1]
routeControl.addOption(id,number);}
if(parsed[1].length>0){for(var i=0;i<parsed[1].length;i++){var row1=String(parsed[1][i][0]).split(' ')
if(parsed[1][i][1]==null)continue;var row2=String(parsed[1][i][1]).split(' ')
routeControl.addOption2(String(row1[0]).split(' '),String(row2[0]).split(' '),String(row1[1]).split(' ')+'-'+String(row2[1]).split(' '));}}
routeControl.redraw()}
MapWidget.prototype.search=function(event){ajax_load()
this.reset()
var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/search');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('marker='+JSON.stringify(this.marker.getPosition())+'&marker2='+JSON.stringify(this.marker2.getPosition())+'&city_id='+city_id)
jax.onreadystatechange=function(){if(jax.readyState==4){proccessSearchMapWidget(JSON.parse(jax.responseText))
ajax_finished()}}}
Dict.prototype.get=function(key){for(var i=0;i<this.dict.length;i++){if(this.dict[i][0]==key){return this.dict[i][1]}}}
Dict.prototype.set=function(key,value){for(var i=0;i<this.dict.length;i++){if(this.dict[i][0]==key){this.dict[i][1]=value;return;}}
this.dict.push(new Array(key,value));}
function Dict(){this.dict=new Array();}
URIWorker.prototype.parseURL=function(){var uri=window.location.href
var end=uri.indexOf('#')==-1?uri.length:uri.indexOf('#');var params=uri.substring(end+2).split('/');var dict=new Dict()
dict.set('city',params[0]);dict.set('module',params[1]);dict.set('id',params[2]);dict.set('title',params[3]);return dict;}
URIWorker.prototype.set=function(key,value){URIWorker.values.set(key,value)}
URIWorker.prototype.rewriteURI=function(){var dict=URIWorker.values;paramsString=city_id+'/'+dict.get('module')+'/'+dict.get('id')+'/'+dict.get('title');var uri=window.location.href
var end=uri.indexOf('#')==-1?uri.length:uri.indexOf('#');url=uri.substring(0,end)+'#!';url+=paramsString
window.location=url}
function URIWorker(){}
URIWorker.values=new Dict();
Array.prototype.remove=function(value){for(var i=0;i<this.length;i++){if(this[i]==value)this.splice(i,1)}};
(function(d){function l(b,a,c){a="("+c.replace(m,"\\$1")+")";return b.replace(new RegExp(a,"gi"),"<strong>$1</strong>")}function i(b,a){this.el=d(b);this.el.attr("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.val();this.intervalId=0;this.cachedResponse=[];this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=a.serviceUrl;this.isLocal=false;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0,width:0,highlight:true,params:{},fnFormatResult:l,delimiter:null,zIndex:9999};this.initialize();this.setOptions(a)}var m=new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","g");d.fn.autocomplete=function(b){return new i(this.get(0)||d("<input />"),b)};i.prototype={killerFn:null,initialize:function(){var b,a,c;b=this;a=Math.floor(Math.random()*1048576).toString(16);c="Autocomplete_"+a;this.killerFn=function(e){if(d(e.target).parents(".autocomplete").size()===0){b.killSuggestions();b.disableKillerFn()}};if(!this.options.width)this.options.width=this.el.width();this.mainContainerId="AutocompleteContainter_"+a;d('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="'+c+'" style="display:none; width:300px;"></div></div></div>').appendTo("body");this.container=d("#"+c);this.fixPosition();window.opera?this.el.keypress(function(e){b.onKeyPress(e)}):this.el.keydown(function(e){b.onKeyPress(e)});this.el.keyup(function(e){b.onKeyUp(e)});this.el.blur(function(){b.enableKillerFn()});this.el.focus(function(){b.fixPosition()})},setOptions:function(b){var a=this.options;d.extend(a,b);if(a.lookup){this.isLocal=true;if(d.isArray(a.lookup))a.lookup={suggestions:a.lookup,data:[]}}d("#"+this.mainContainerId).css({zIndex:a.zIndex});this.container.css({maxHeight:a.maxHeight+"px",width:a.width})},clearCache:function(){this.cachedResponse=[];this.badQueries=[]},disable:function(){this.disabled=true},enable:function(){this.disabled=false},fixPosition:function(){var b=this.el.offset();d("#"+this.mainContainerId).css({top:b.top+this.el.innerHeight()+"px",left:b.left+"px"})},enableKillerFn:function(){d(document).bind("click",this.killerFn)},disableKillerFn:function(){d(document).unbind("click",this.killerFn)},killSuggestions:function(){var b=this;this.stopKillSuggestions();this.intervalId=window.setInterval(function(){b.hide();b.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(b){if(!(this.disabled||!this.enabled)){switch(b.keyCode){case 27:this.el.val(this.currentValue);this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(b.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}b.stopImmediatePropagation();b.preventDefault()}},onKeyUp:function(b){if(!this.disabled){switch(b.keyCode){case 38:case 40:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val())if(this.options.deferRequestBy>0){var a=this;this.onChangeInterval=setInterval(function(){a.onValueChange()},this.options.deferRequestBy)}else this.onValueChange()}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.val();var b=this.getQuery(this.currentValue);this.selectedIndex=-1;if(this.ignoreValueChange)this.ignoreValueChange=false;else b===""||b.length<this.options.minChars?this.hide():this.getSuggestions(b)},getQuery:function(b){var a;a=this.options.delimiter;if(!a)return d.trim(b);b=b.split(a);return d.trim(b[b.length-1])},getSuggestionsLocal:function(b){var a,c,e,g,f;c=this.options.lookup;e=c.suggestions.length;a={suggestions:[],data:[]};b=b.toLowerCase();for(f=0;f<e;f++){g=c.suggestions[f];if(g.toLowerCase().indexOf(b)===0){a.suggestions.push(g);a.data.push(c.data[f])}}return a},getSuggestions:function(b){var a,c;if((a=this.isLocal?this.getSuggestionsLocal(b):this.cachedResponse[b])&&d.isArray(a.suggestions)){this.suggestions=a.suggestions;this.data=a.data;this.suggest()}else if(!this.isBadQuery(b)){c=this;c.options.params.query=b;d.get(this.serviceUrl,c.options.params,function(e){c.processResponse(e)},"text")}},isBadQuery:function(b){for(var a=this.badQueries.length;a--;)if(b.indexOf(this.badQueries[a])===0)return true;return false},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide()},suggest:function(){if(this.suggestions.length===0)this.hide();else{var b,a,c,e,g,f,j,k;b=this;a=this.suggestions.length;e=this.options.fnFormatResult;g=this.getQuery(this.currentValue);j=function(h){return function(){b.activate(h)}};k=function(h){return function(){b.select(h)}};this.container.hide().empty();for(f=0;f<a;f++){c=this.suggestions[f];c=d((b.selectedIndex===f?'<div class="selected"':"<div")+' title="'+c+'">'+e(c,this.data[f],g)+"</div>");c.mouseover(j(f));c.click(k(f));this.container.append(c)}this.enabled=true;this.container.show()}},processResponse:function(b){var a;try{a=eval("("+b+")")}catch(c){return}if(!d.isArray(a.data))a.data=[];if(!this.options.noCache){this.cachedResponse[a.query]=a;a.suggestions.length===0&&this.badQueries.push(a.query)}if(a.query===this.getQuery(this.currentValue)){this.suggestions=a.suggestions;this.data=a.data;this.suggest()}},activate:function(b){var a,c;a=this.container.children();this.selectedIndex!==-1&&a.length>this.selectedIndex&&d(a.get(this.selectedIndex)).removeClass();this.selectedIndex=b;if(this.selectedIndex!==-1&&a.length>this.selectedIndex){c=a.get(this.selectedIndex);d(c).addClass("selected")}return c},deactivate:function(b,a){b.className="";if(this.selectedIndex===a)this.selectedIndex=-1},select:function(b){var a;if(a=this.suggestions[b]){this.el.val(a);if(this.options.autoSubmit){a=this.el.parents("form");a.length>0&&a.get(0).submit()}this.ignoreValueChange=true;this.hide();this.onSelect(b)}},moveUp:function(){if(this.selectedIndex!==-1)if(this.selectedIndex===0){this.container.children().get(0).className="";this.selectedIndex=-1;this.el.val(this.currentValue)}else this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(b){var a,c,e;a=this.activate(b).offsetTop;c=this.container.scrollTop();e=c+this.options.maxHeight-25;if(a<c)this.container.scrollTop(a);else a>e&&this.container.scrollTop(a-this.options.maxHeight+25);this.el.val(this.getValue(this.suggestions[b]))},onSelect:function(b){var a,c;a=this.options.onSelect;c=this.suggestions[b];b=this.data[b];this.el.val(this.getValue(c));d.isFunction(a)&&a(c,b,this.el)},getValue:function(b){var a,c;a=this.options.delimiter;if(!a)return b;c=this.currentValue;a=c.split(a);if(a.length===1)return b;return c.substr(0,c.length-a[a.length-1].length)+b}}})(jQuery);
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);;(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case"d":l=m("d");break;case"D":n("D",f,h);break;case"o":u=m("o");break;case"m":j=m("m");break;case"M":j=n("M",i,g);break;case"y":c=m("y");break;case"@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case"!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+
1;l=v.getDate();break;case"'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case"d":l+=g("d",b.getDate(),2);break;case"D":l+=j("D",b.getDay(),e,f);break;case"o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case"m":l+=g("m",b.getMonth()+1,2);break;case"M":l+=j("M",b.getMonth(),h,c);break;case"y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.getTime();break;case"!":l+=b.getTime()*1E4+this._ticksTo1970;break;case"'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case"d":case"D":g+=parseInt(k[1],10);break;case"w":case"W":g+=parseInt(k[1],10)*7;break;case"m":case"M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case"y":case"Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+
r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+
(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);;
(function($){var DEFAULT_SETTINGS={method:"GET",queryParam:"q",searchDelay:300,minChars:1,propertyToSearch:"name",jsonContainer:null,contentType:"json",prePopulate:null,processPrePopulate:false,hintText:"Type in a search term",noResultsText:"No results",searchingText:"Searching...",deleteText:"&times;",animateDropdown:true,theme:null,resultsFormatter:function(item){return"<li>"+item[this.propertyToSearch]+"</li>"},tokenFormatter:function(item){return"<li><p>"+item[this.propertyToSearch]+"</p></li>"},tokenLimit:null,tokenDelimiter:",",preventDuplicates:false,tokenValue:"id",onResult:null,onAdd:null,onDelete:null,onReady:null,idPrefix:"token-input-"};var DEFAULT_CLASSES={tokenList:"token-input-list",token:"token-input-token",tokenDelete:"token-input-delete-token",selectedToken:"token-input-selected-token",highlightedToken:"token-input-highlighted-token",dropdown:"token-input-dropdown",dropdownItem:"token-input-dropdown-item",dropdownItem2:"token-input-dropdown-item2",selectedDropdownItem:"token-input-selected-dropdown-item",inputToken:"token-input-input-token"};var POSITION={BEFORE:0,AFTER:1,END:2};var KEY={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUMPAD_ENTER:108,COMMA:188};var methods={init:function(url_or_data_or_function,options){var settings=$.extend({},DEFAULT_SETTINGS,options||{});return this.each(function(){$(this).data("tokenInputObject",new $.TokenList(this,url_or_data_or_function,settings));});},clear:function(){this.data("tokenInputObject").clear();return this;},add:function(item){this.data("tokenInputObject").add(item);return this;},remove:function(item){this.data("tokenInputObject").remove(item);return this;},get:function(){return this.data("tokenInputObject").getTokens();}}
$.fn.tokenInput=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else{return methods.init.apply(this,arguments);}};$.TokenList=function(input,url_or_data,settings){if($.type(url_or_data)==="string"||$.type(url_or_data)==="function"){settings.url=url_or_data;var url=computeURL();if(settings.crossDomain===undefined){if(url.indexOf("://")===-1){settings.crossDomain=false;}else{settings.crossDomain=(location.href.split(/\/+/g)[1]!==url.split(/\/+/g)[1]);}}}else if(typeof(url_or_data)==="object"){settings.local_data=url_or_data;}
if(settings.classes){settings.classes=$.extend({},DEFAULT_CLASSES,settings.classes);}else if(settings.theme){settings.classes={};$.each(DEFAULT_CLASSES,function(key,value){settings.classes[key]=value+"-"+settings.theme;});}else{settings.classes=DEFAULT_CLASSES;}
var saved_tokens=[];var token_count=0;var cache=new $.TokenList.Cache();var timeout;var input_val;var input_box=$("<input type=\"text\"  autocomplete=\"off\">").css({outline:"none"}).attr("id",settings.idPrefix+input.id).focus(function(){if(settings.tokenLimit===null||settings.tokenLimit!==token_count){show_dropdown_hint();setTimeout(function(){do_search();},5);}}).blur(function(){hide_dropdown();$(this).val("");}).bind("keyup keydown blur update",resize_input).keydown(function(event){var previous_token;var next_token;switch(event.keyCode){case KEY.LEFT:case KEY.RIGHT:case KEY.UP:case KEY.DOWN:if(1!=1){previous_token=input_token.prev();next_token=input_token.next();if((previous_token.length&&previous_token.get(0)===selected_token)||(next_token.length&&next_token.get(0)===selected_token)){if(event.keyCode===KEY.LEFT||event.keyCode===KEY.UP){deselect_token($(selected_token),POSITION.BEFORE);}else{deselect_token($(selected_token),POSITION.AFTER);}}else if((event.keyCode===KEY.LEFT||event.keyCode===KEY.UP)&&previous_token.length){select_token($(previous_token.get(0)));}else if((event.keyCode===KEY.RIGHT||event.keyCode===KEY.DOWN)&&next_token.length){select_token($(next_token.get(0)));}}else{var dropdown_item=null;if(event.keyCode===KEY.DOWN||event.keyCode===KEY.RIGHT){dropdown_item=$(selected_dropdown_item).next();}else{dropdown_item=$(selected_dropdown_item).prev();}
if(dropdown_item.length){select_dropdown_item(dropdown_item);}
return false;}
break;case KEY.BACKSPACE:previous_token=input_token.prev();if(!$(this).val().length){if(selected_token){delete_token($(selected_token));hidden_input.change();}else if(previous_token.length){select_token($(previous_token.get(0)));}
return false;}else if($(this).val().length===1){hide_dropdown();}else{setTimeout(function(){do_search();},5);}
break;case KEY.TAB:case KEY.ENTER:case KEY.NUMPAD_ENTER:if(selected_dropdown_item){add_token($(selected_dropdown_item).data("tokeninput"));hidden_input.change();return false;}
break;case KEY.ESCAPE:hide_dropdown();return true;default:if(String.fromCharCode(event.which)){setTimeout(function(){do_search();},5);}
break;}});var hidden_input=$(input).hide().val("").focus(function(){input_box.focus();}).blur(function(){input_box.blur();});var selected_token=null;var selected_token_index=0;var selected_dropdown_item=null;var token_list=$("<ul />").addClass(settings.classes.tokenList).click(function(event){var li=$(event.target).closest("li");if(li&&li.get(0)&&$.data(li.get(0),"tokeninput")){toggle_select_token(li);}else{if(selected_token){deselect_token($(selected_token),POSITION.END);}
input_box.focus();}}).mouseover(function(event){var li=$(event.target).closest("li");if(li&&selected_token!==this){li.addClass(settings.classes.highlightedToken);}}).mouseout(function(event){var li=$(event.target).closest("li");if(li&&selected_token!==this){li.removeClass(settings.classes.highlightedToken);}}).insertBefore(hidden_input);var input_token=$("<li />").addClass(settings.classes.inputToken).appendTo(token_list).append(input_box);var dropdown=$("<div>").addClass(settings.classes.dropdown).appendTo("body").hide();var input_resizer=$("<tester/>").insertAfter(input_box).css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:input_box.css("fontSize"),fontFamily:input_box.css("fontFamily"),fontWeight:input_box.css("fontWeight"),letterSpacing:input_box.css("letterSpacing"),whiteSpace:"nowrap"});hidden_input.val("");var li_data=settings.prePopulate||hidden_input.data("pre");if(settings.processPrePopulate&&$.isFunction(settings.onResult)){li_data=settings.onResult.call(hidden_input,li_data);}
if(li_data&&li_data.length){$.each(li_data,function(index,value){insert_token(value);checkTokenLimit();});}
if($.isFunction(settings.onReady)){settings.onReady.call();}
this.clear=function(){token_list.children("li").each(function(){if($(this).children("input").length===0){delete_token($(this));}});}
this.add=function(item){add_token(item);}
this.remove=function(item){token_list.children("li").each(function(){if($(this).children("input").length===0){var currToken=$(this).data("tokeninput");var match=true;for(var prop in item){if(item[prop]!==currToken[prop]){match=false;break;}}
if(match){delete_token($(this));}}});}
this.getTokens=function(){return saved_tokens;}
function checkTokenLimit(){if(settings.tokenLimit!==null&&token_count>=settings.tokenLimit){input_box.hide();hide_dropdown();return;}}
function resize_input(){if(input_val===(input_val=input_box.val())){return;}
var escaped=input_val.replace(/&/g,'&amp;').replace(/\s/g,' ').replace(/</g,'&lt;').replace(/>/g,'&gt;');input_resizer.html(escaped);input_box.width(input_resizer.width()+30);}
function is_printable_character(keycode){return((keycode>=48&&keycode<=90)||(keycode>=96&&keycode<=111)||(keycode>=186&&keycode<=192)||(keycode>=219&&keycode<=222));}
function insert_token(item){var this_token=settings.tokenFormatter(item);this_token=$(this_token).addClass(settings.classes.token).insertBefore(input_token);$("<span>"+settings.deleteText+"</span>").addClass(settings.classes.tokenDelete).appendTo(this_token).click(function(){delete_token($(this).parent());hidden_input.change();return false;});var token_data=item;$.data(this_token.get(0),"tokeninput",item);saved_tokens=saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));selected_token_index++;update_hidden_input(saved_tokens,hidden_input);token_count+=1;if(settings.tokenLimit!==null&&token_count>=settings.tokenLimit){input_box.hide();hide_dropdown();}
return this_token;}
function add_token(item){var callback=settings.onAdd;if(token_count>0&&settings.preventDuplicates){var found_existing_token=null;token_list.children().each(function(){var existing_token=$(this);var existing_data=$.data(existing_token.get(0),"tokeninput");if(existing_data&&existing_data.id===item.id){found_existing_token=existing_token;return false;}});if(found_existing_token){select_token(found_existing_token);input_token.insertAfter(found_existing_token);input_box.focus();return;}}
if(settings.tokenLimit==null||token_count<settings.tokenLimit){insert_token(item);checkTokenLimit();}
input_box.val("");hide_dropdown();if($.isFunction(callback)){callback.call(hidden_input,item);}}
function select_token(token){token.addClass(settings.classes.selectedToken);selected_token=token.get(0);input_box.val("");hide_dropdown();}
function deselect_token(token,position){token.removeClass(settings.classes.selectedToken);selected_token=null;if(position===POSITION.BEFORE){input_token.insertBefore(token);selected_token_index--;}else if(position===POSITION.AFTER){input_token.insertAfter(token);selected_token_index++;}else{input_token.appendTo(token_list);selected_token_index=token_count;}
input_box.focus();}
function toggle_select_token(token){var previous_selected_token=selected_token;if(selected_token){deselect_token($(selected_token),POSITION.END);}
if(previous_selected_token===token.get(0)){deselect_token(token,POSITION.END);}else{select_token(token);}}
function delete_token(token){var token_data=$.data(token.get(0),"tokeninput");var callback=settings.onDelete;var index=token.prevAll().length;if(index>selected_token_index)index--;token.remove();selected_token=null;input_box.focus();saved_tokens=saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));if(index<selected_token_index)selected_token_index--;update_hidden_input(saved_tokens,hidden_input);token_count-=1;if(settings.tokenLimit!==null){input_box.show().val("").focus();}
if($.isFunction(callback)){callback.call(hidden_input,token_data);}}
function update_hidden_input(saved_tokens,hidden_input){var token_values=$.map(saved_tokens,function(el){if(typeof settings.tokenValue=='function')
return settings.tokenValue.call(this,el);return el[settings.tokenValue];});hidden_input.val(token_values.join(settings.tokenDelimiter));}
function hide_dropdown(){dropdown.hide().empty();selected_dropdown_item=null;}
function show_dropdown(){dropdown.css({position:"absolute",top:$(token_list).offset().top+$(token_list).outerHeight(),left:$(token_list).offset().left,'z-index':999}).show();}
function show_dropdown_searching(){if(settings.searchingText){dropdown.html("<p>"+settings.searchingText+"</p>");show_dropdown();}}
function show_dropdown_hint(){if(settings.hintText){dropdown.html("<p>"+settings.hintText+"</p>");show_dropdown();}}
function highlight_term(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term+")(?![^<>]*>)(?![^&;]+;)","gi"),"<b>$1</b>");}
function find_value_and_highlight_term(template,value,term){return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+value+")(?![^<>]*>)(?![^&;]+;)","g"),highlight_term(value,term));}
function populate_dropdown(query,results){if(results&&results.length){dropdown.empty();var dropdown_ul=$("<ul>").appendTo(dropdown).mouseover(function(event){select_dropdown_item($(event.target).closest("li"));}).mousedown(function(event){add_token($(event.target).closest("li").data("tokeninput"));hidden_input.change();return false;}).hide();$.each(results,function(index,value){var this_li=settings.resultsFormatter(value);this_li=find_value_and_highlight_term(this_li,value[settings.propertyToSearch],query);this_li=$(this_li).appendTo(dropdown_ul);if(index%2){this_li.addClass(settings.classes.dropdownItem);}else{this_li.addClass(settings.classes.dropdownItem2);}
if(index===0){select_dropdown_item(this_li);}
$.data(this_li.get(0),"tokeninput",value);});show_dropdown();if(settings.animateDropdown){dropdown_ul.slideDown("fast");}else{dropdown_ul.show();}}else{if(settings.noResultsText){dropdown.html("<p>"+settings.noResultsText+"</p>");show_dropdown();}}}
function select_dropdown_item(item){if(item){if(selected_dropdown_item){deselect_dropdown_item($(selected_dropdown_item));}
item.addClass(settings.classes.selectedDropdownItem);selected_dropdown_item=item.get(0);}}
function deselect_dropdown_item(item){item.removeClass(settings.classes.selectedDropdownItem);selected_dropdown_item=null;}
function do_search(){var query=input_box.val().toLowerCase();if(selected_token){deselect_token($(selected_token),POSITION.AFTER);}
if(query.length>=settings.minChars){show_dropdown_searching();clearTimeout(timeout);timeout=setTimeout(function(){run_search(query);},settings.searchDelay);}else{hide_dropdown();}}
function run_search(query){var cache_key=query+computeURL();var cached_results=cache.get(cache_key);if(cached_results){populate_dropdown(query,cached_results);}else{if(settings.url){var url=computeURL();var ajax_params={};ajax_params.data={};if(url.indexOf("?")>-1){var parts=url.split("?");ajax_params.url=parts[0];var param_array=parts[1].split("&");$.each(param_array,function(index,value){var kv=value.split("=");ajax_params.data[kv[0]]=kv[1];});}else{ajax_params.url=url;}
ajax_params.data[settings.queryParam]=query;ajax_params.type=settings.method;ajax_params.dataType=settings.contentType;if(settings.crossDomain){ajax_params.dataType="jsonp";}
ajax_params.success=function(results){if($.isFunction(settings.onResult)){results=settings.onResult.call(hidden_input,results);}
cache.add(cache_key,settings.jsonContainer?results[settings.jsonContainer]:results);if(input_box.val().toLowerCase()===query){populate_dropdown(query,settings.jsonContainer?results[settings.jsonContainer]:results);}};$.ajax(ajax_params);}else if(settings.local_data){var results=$.grep(settings.local_data,function(row){return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase())>-1;});if($.isFunction(settings.onResult)){results=settings.onResult.call(hidden_input,results);}
cache.add(cache_key,results);populate_dropdown(query,results);}}}
function computeURL(){var url=settings.url;if(typeof settings.url=='function'){url=settings.url.call();}
return url;}};$.TokenList.Cache=function(options){var settings=$.extend({max_size:500},options);var data={};var size=0;var flush=function(){data={};size=0;};this.add=function(query,results){if(size>settings.max_size){flush();}
if(!data[query]){size+=1;}
data[query]=results;};this.get=function(query){return data[query];};};}(jQuery));
(function($){function TouchCarousel(g,h){this.carouselRoot=$(g);var j=this;this._az=false;this._by=false;this._cx="";this._dw="";this._ev="";this._fu;this._gt;this._hs;this._ir;this._jq;this._kp=0;this.settings=$.extend({},$.fn.touchCarousel.defaults,h);this._lo=this.carouselRoot.find(".touchcarousel-container");this._loStyle=this._lo[0].style;this._az1=this._lo.wrap($('<div class="touchcarousel-wrapper" />')).parent();var k=this._lo.find(".touchcarousel-item");this.items=[];this.numItems=k.length;this._by1;this._cx1=false;this._dw1=0;this._ev1=0;this._fu1=0;this._gt1=false;this._hs1=false;this._ir1=false;if('ontouchstart'in window){this.hasTouch=true;this._cx='touchstart.rs';this._dw='touchmove.rs';this._ev='touchend.rs';this._jq1=this.settings.baseTouchFriction}else{this.hasTouch=false;this._jq1=this.settings.baseMouseFriction;if(this.settings.dragUsingMouse){this._cx='mousedown.rs';this._dw='mousemove.rs';this._ev='mouseup.rs';this._kp1;this._lo1;var l=$.browser;if(l.msie||l.opera){this._kp1=this._lo1="move"}else if(l.mozilla){this._kp1="-moz-grab";this._lo1="-moz-grabbing"}this._mn1()}else{this._az1.addClass('auto-cursor')}}if(this.hasTouch||this.settings.useWebkit3d){if(('WebKitCSSMatrix'in window&&'m11'in new WebKitCSSMatrix())){this._lo.css({'-webkit-transform-origin':'0 0','-webkit-transform':'translateZ(0)'});this._ir1=true}}if(this._ir1){this._az2='-webkit-transform';this._by2='translate3d(';this._cx2='px, 0, 0)'}else{this._az2='left';this._by2='';this._cx2='px'}if(this.hasTouch){this.settings.directionNavAutoHide=false}if(!this.settings.directionNav){if(this.settings.loopItems){this._dw2=true;this._ev2=true}else{this._dw2=false;this._ev2=false}this.settings.loopItems=true}var m,jqItem,dataSRC,slideImg,currPosX=0;k.eq(this.numItems-1).addClass('last');k.each(function(c){jqItem=$(this);m={};m.item=jqItem;m.index=c;m.posX=currPosX;m.width=(jqItem.outerWidth(true)||j.settings.itemFallbackWidth);currPosX+=m.width;if(!this.hasTouch){jqItem.find('a').bind('click.touchcarousel',function(e){if(j._cx1){e.preventDefault();return false}})}else{var d=jqItem.find('a');var f;d.each(function(){f=$(this);f.data('tc-href',f.attr('href'));f.data('tc-target',f.attr('target'));f.attr('href','#');f.bind('click',function(e){e.preventDefault();if(j._cx1){return false}else{var a=$(this).data('tc-href');var b=$(this).data('tc-target');if(!b||b.toLowerCase()==='_fu2'){window.location.href=a}else{window.open(a)}}})})}jqItem.find('.non-draggable').bind(j._cx,function(e){j._cx1=false;e.stopImmediatePropagation()});j.items.push(m)});this._gt2=this._fu=currPosX;if(this.settings.itemsPerMove>0){this._hs2=this.settings.itemsPerMove}else{this._hs2=1}if(this.settings.pagingNav){this.settings.snapToItems=true;this._ir2=true;this._jq2=Math.ceil(this.numItems/this._hs2);this._kp2=0;if(this.settings.pagingNavControls){this._lo2=$('<div class="tc-paging-container"><div class="tc-paging-centerer"><div class="tc-paging-centerer-inside"></div></div></div>');var n=this._lo2.find('.tc-paging-centerer-inside');var o;for(var i=1;i<=this._jq2;i++){o=$('<a class="tc-paging-item" href="#">'+i+'</a>').data('tc-id',i);if(i===this._kp2+1){o.addClass('current')}n.append(o)}this._mn2=n.find(".tc-paging-item").click(function(e){e.preventDefault();j.goTo(($(e.currentTarget).data('tc-id')-1)*j._hs2)});this._az1.after(this._lo2)}}else{this._ir2=false}this._lo.css({width:currPosX});if(this.settings.directionNav){this._az1.after("<a href='#' class='arrow-holder left'><span class='arrow-icon left'></span></a> <a href='#' class='arrow-holder right'><span class='arrow-icon right'></span></a>");this.arrowLeft=this.carouselRoot.find(".arrow-holder.left");this.arrowRight=this.carouselRoot.find(".arrow-holder.right");if(this.arrowLeft.length<1||this.arrowRight.length<1){this.settings.directionNav=false}else if(this.settings.directionNavAutoHide){this.arrowLeft.hide();this.arrowRight.hide();this.carouselRoot.one("mousemove.arrowshover",function(){j.arrowLeft.fadeIn("fast");j.arrowRight.fadeIn("fast")});this.carouselRoot.hover(function(){j.arrowLeft.fadeIn("fast");j.arrowRight.fadeIn("fast")},function(){j.arrowLeft.fadeOut("fast");j.arrowRight.fadeOut("fast")})}this._by3(0);if(this.settings.directionNav){this.arrowRight.click(function(e){e.preventDefault();if(j.settings.loopItems&&!j._gt1||!j._ev2)j.next()});this.arrowLeft.click(function(e){e.preventDefault();if(j.settings.loopItems&&!j._gt1||!j._dw2)j.prev()})}}this.carouselWidth;this._cx3='onorientationchange'in window?'orientationchange.touchcarousel':'resize.touchcarousel';var p;$(window).bind(this._cx3,function(){if(p)clearTimeout(p);p=setTimeout(function(){j.updateCarouselSize(false)},100)});if(this.settings.scrollbar){this._dw3=$("<div class='scrollbar-holder'><div class='scrollbar"+(this.settings.scrollbarTheme.toLowerCase()==="light"?" light":" dark")+"'></div></div>");this._dw3.appendTo(this.carouselRoot);this.scrollbarJQ=this._dw3.find('.scrollbar');this._ev3="";this._fu3=this.scrollbarJQ[0].style;this._gt3=0;if(this.settings.scrollbarAutoHide){this._hs3=false;this.scrollbarJQ.css("opacity",0)}else{this._hs3=true}}else{this.settings.scrollbarAutoHide=false}this.updateCarouselSize(true);this._az1.bind(this._cx,function(e){j._ir3(e)});if(this.settings.autoplay&&this.settings.autoplayDelay>0){this._jq3=false;this.autoplayTimer='';this.wasAutoplayRunning=true;if(!this.hasTouch){this.carouselRoot.hover(function(){j._jq3=true;j._kp3()},function(){j._jq3=false;j._lo3()})}this.autoplay=true;this._mn3()}else{this.autoplay=false}if(this.settings.keyboardNav){$(document).bind("keydown.touchcarousel",function(e){if(!j._gt1){if(e.keyCode===37){j.prev()}else if(e.keyCode===39){j.next()}}})}this.carouselRoot.css("overflow","visible")}TouchCarousel.prototype={goTo:function(a,b){var c=this.items[a];if(c){if(!b&&this.autoplay&&this.settings.autoplayStopAtAction){this.stopAutoplay()}this._az4(a);this.endPos=this._by4();var d=-c.posX;if(d>0){d=0}else if(d<this.carouselWidth-this._gt2){d=this.carouselWidth-this._gt2}this.animateTo(d,this.settings.transitionSpeed,"easeInOutSine")}},next:function(a){var b=this._by4();var c=this._cx4(b).index;if(!this._ir2){c=c+this._hs2;if(this.settings.loopItems){if(b<=this.carouselWidth-this._gt2){c=0}}if(c>this.numItems-1){c=this.numItems-1}}else{var d=this._kp2+1;if(d>this._jq2-1){if(this.settings.loopItems){c=0}else{c=(this._jq2-1)*this._hs2}}else{c=d*this._hs2}}this.goTo(c,a)},prev:function(a){var b=this._by4();var c=this._cx4(b).index;if(!this._ir2){c=c-this._hs2;if(c<0){if(this.settings.loopItems){if(b<0){c=0}else{c=this.numItems-1}}else{c=0}}}else{var d=this._kp2-1;if(d<0){if(this.settings.loopItems){c=(this._jq2-1)*this._hs2}else{c=0}}else{c=d*this._hs2}}this.goTo(c,a)},getCurrentId:function(){var a=this._cx4(this._by4()).index;return a},setXPos:function(a,b){if(!b){this._loStyle[this._az2]=(this._by2+a+this._cx2)}else{this._fu3[this._az2]=(this._by2+a+this._cx2)}},stopAutoplay:function(){this._kp3();this.autoplay=false;this.wasAutoplayRunning=false},resumeAutoplay:function(){this.autoplay=true;if(!this.wasAutoplayRunning){this._lo3()}},updateCarouselSize:function(a){var b=this;this.carouselWidth=this.carouselRoot.width();if(this.settings.scrollToLast){var c=0;if(this._ir2){var d=(this.numItems%this._hs2);if(d>0){for(var i=this.numItems-d;i<this.numItems;i++){c+=this.items[i].width}}else{c=this.carouselWidth}}else{c=this.items[this.numItems-1].width}this._gt2=this._fu+this.carouselWidth-c}else{this._gt2=this._fu}if(this.settings.scrollbar){var e=Math.round(this._dw3.width()/(this._gt2/this.carouselWidth));this.scrollbarJQ.css('width',e);this._gt3=this._dw3.width()-e}if(!this.settings.scrollToLast){if(this.carouselWidth>=this._fu){this._hs1=true;if(!this.settings.loopItems){this._ev2=true;this.arrowRight.addClass("disabled");this._dw2=true;this.arrowLeft.addClass("disabled")}this.setXPos(0);return}else if(this._hs1){this._hs1=false;this._ev2=false;this._dw2=false;this.arrowRight.removeClass("disabled");this.arrowLeft.removeClass("disabled")}}if(!a){var f=this.endPos=this._by4();if(f>0){f=0}else if(f<this.carouselWidth-this._gt2){f=this.carouselWidth-this._gt2}this.animateTo(f,300,"easeInOutSine")}},animateTo:function(a,b,c,d,e,f,g){if(this.settings.onAnimStart!==null){this.settings.onAnimStart.call(this)}if(this.autoplay&&this.autoplayTimer){this.wasAutoplayRunning=true;this._kp3()}this._dw4();var h=this;var i=this.settings.scrollbar,prop=h._az2,pref=h._by2,suf=h._cx2,from={containerPos:this.endPos},to={containerPos:a},to2={containerPos:e},e=d?e:a,dContainer=h._loStyle;h._by=true;if(i){var j=this._fu3;var k=h._gt2-h.carouselWidth;if(this.settings.scrollbarAutoHide){if(!this._hs3){this._ev4()}}}this._by3(e);function animationComplete(){h._by=false;h._mn3();if(h.settings.scrollbarAutoHide){h._fu4()}if(h.settings.onAnimComplete!==null){h.settings.onAnimComplete.call(h)}}this._by1=$(from).animate(to,{duration:b,easing:c,step:function(){if(i){j[prop]=(pref+Math.round((h._gt3)*(-this.containerPos/k))+suf)}dContainer[prop]=(pref+Math.round(this.containerPos)+suf)},complete:function(){if(d){h._by1=$(to).animate(to2,{duration:f,easing:g,step:function(){if(i){j[prop]=(pref+Math.round((h._gt3)*(-this.containerPos/k))+suf)}dContainer[prop]=(pref+Math.round(this.containerPos)+suf)},complete:function(){if(i){j[prop]=(pref+Math.round((h._gt3)*(-to2.containerPos/k))+suf)}dContainer[prop]=(pref+Math.round(to2.containerPos)+suf);animationComplete()}})}else{if(i){j[prop]=(pref+Math.round((h._gt3)*(-to.containerPos/k))+suf)}dContainer[prop]=(pref+Math.round(to.containerPos)+suf);animationComplete()}}})},destroy:function(){this.stopAutoplay();this._az1.unbind(this._cx);$(document).unbind(this._dw).unbind(this._ev);$(window).unbind(this._cx3);if(this.settings.keyboardNav){$(document).unbind("keydown.touchcarousel")}this.carouselRoot.remove()},_az4:function(a){if(this._ir2){var b=this._gt4(a);this._kp2=b;if(this.settings.pagingNavControls){this._mn2.removeClass('current');this._mn2.eq(b).addClass('current')}}},_gt4:function(a){var b=this._hs2;for(var i=0;i<this._jq2;i++){if(a>=i*b&&a<i*b+b){return i}}if(a<0){return 0}else if(a>=this._jq2){return this._jq2-1}return false},_hs4:function(){if(!this.settings.loopItems){if(this._dw2){this._dw2=false;this.arrowLeft.removeClass("disabled")}else if(this._ev2){this._ev2=false;this.arrowRight.removeClass("disabled")}}},_az3:function(){if(!this._dw2&&!this.settings.loopItems){this._dw2=true;this.arrowLeft.addClass("disabled");if(this._ev2){this._ev2=false;this.arrowRight.removeClass("disabled")}}},_ir4:function(){if(!this._ev2&&!this.settings.loopItems){this._ev2=true;this.arrowRight.addClass("disabled");if(this._dw2){this._dw2=false;this.arrowLeft.removeClass("disabled")}}},_cx4:function(a){var b=this;a=-a;var c;for(var i=0;i<b.numItems;i++){c=b.items[i];if(a>=c.posX&&a<c.posX+c.width){return c}}return-1},_mn3:function(){if(this.autoplay){if(this.wasAutoplayRunning){if(!this._jq3){this._lo3()}this.wasAutoplayRunning=false}}},_fu4:function(){var a=this;this._hs3=false;if(this._ev3){clearTimeout(this._ev3)}this._ev3=setTimeout(function(){a.scrollbarJQ.animate({opacity:0},150,"linear")},450)},_ev4:function(){this._hs3=true;if(this._ev3){clearTimeout(this._ev3)}this.scrollbarJQ.stop().animate({opacity:1},150,"linear")},_dw4:function(){if(this._by1){this._by1.stop()}},_lo3:function(){if(this.autoplay){var a=this;if(!this.autoplayTimer){this.autoplayTimer=setInterval(function(){if(!a._jq4&&!a._by){a.next(true)}},this.settings.autoplayDelay)}}},_kp3:function(){if(this.autoplayTimer){clearInterval(this.autoplayTimer);this.autoplayTimer=''}},_by4:function(a){var b=!a?this._lo:this.scrollbarJQ;if(!this._ir1){return Math.round(b.position().left)}else{var c=b.css("-webkit-transform");var d=c.replace(/^matrix\(/i,'').split(/, |\)$/g);return parseInt(d[4],10)}},_ir3:function(e){if(!this._jq4){if(this.autoplay&&this.settings.autoplayStopAtAction){this.stopAutoplay()}this._dw4();if(this.settings.scrollbarAutoHide){this._ev4()}var a;if(this.hasTouch){this._az=false;var b=e.originalEvent.touches;if(b&&b.length>0){a=b[0]}else{return false}}else{a=e;e.preventDefault()}this._kp4();this._jq4=true;var c=this;if(this._ir1){c._lo.css({'-webkit-transition-duration':'0','-webkit-transition-property':'none'})}$(document).bind(this._dw,function(e){c._lo4(e)});$(document).bind(this._ev,function(e){c._mn4(e)});this._az5=this._by4();this._ir=a.clientX;this._cx1=false;this._kp=e.timeStamp||Date.now();this._fu1=0;this._ev1=this._dw1=a.clientX;this._by5=a.clientY}},_lo4:function(e){var a=(e.timeStamp||Date.now());var b;if(this.hasTouch){if(this._az){return false}var c=e.originalEvent.touches;if(c.length>1){return false}b=c[0];if(Math.abs(b.clientY-this._by5)>Math.abs(b.clientX-this._dw1)+3){if(this.settings.lockAxis){this._az=true}return false}e.preventDefault()}else{b=e;e.preventDefault()}this._jq=b.clientX;this._cx5=this._dw5;var d=b.clientX-this._ev1;if(this._cx5!=d){this._dw5=d}if(d!=0){var f=this._az5+this._fu1;if(f>=0){d=d/4;this._az3()}else if(f<=this.carouselWidth-this._gt2){this._ir4();d=d/4}else{this._hs4()}this._fu1+=d;this.setXPos(f);if(this.settings.scrollbar){this.setXPos((this._gt3)*(-f/(this._gt2-this.carouselWidth)),true)}}this._ev1=b.clientX;if(a-this._kp>350){this._kp=a;this._ir=b.clientX}if(this.settings.onDragStart!==null){this.settings.onDragStart.call(this)}return false},_mn4:function(e){if(this._jq4){var b=this;this._jq4=false;this._mn1();this.endPos=this._by4();this.isdrag=false;$(document).unbind(this._dw).unbind(this._ev);if(this.endPos==this._az5){this._cx1=false;if(this.settings.scrollbarAutoHide){this._fu4()}return}else{this._cx1=true}var c=(this._jq-this._ir);var d=Math.max(40,(e.timeStamp||Date.now())-this._kp);var f=0.5,mass=2,v0=Math.abs(c)/d;function getCorrectXPos(a){if(a>0){a=0}else if(a<b.carouselWidth-b._gt2){a=b.carouselWidth-b._gt2}return a}if(!this.settings.snapToItems){var g=0;if(v0<=2){f=this._jq1*3.5;g=0}else if(v0>2&&v0<=3){f=this._jq1*4;g=200}else if(v0>3){g=300;if(v0>4){v0=4;g=400;f=this._jq1*6}f=this._jq1*5}var S=(v0*v0*mass)/(2*f);S=S*(c<0?-1:1);var t=v0*mass/f+g;if(this.endPos+S>0){if(this.endPos>0){this.animateTo(0,800,"easeOutCubic")}else{this.animateTo((this.carouselWidth/10)*((g+200)/1000),(Math.abs(this.endPos)*1.1)/v0,"easeOutSine",true,0,400,"easeOutCubic")}}else if(this.endPos+S<this.carouselWidth-this._gt2){if(this.endPos<this.carouselWidth-this._gt2){this.animateTo(this.carouselWidth-this._gt2,800,"easeOutCubic")}else{this.animateTo(this.carouselWidth-this._gt2-(this.carouselWidth/10)*((g+200)/1000),(Math.abs(this.carouselWidth-this._gt2-this.endPos)*1.1)/v0,"easeOutSine",true,this.carouselWidth-this._gt2,400,"easeOutCubic")}}else{this.animateTo(this.endPos+S,t,"easeOutCubic")}}else{if(this.autoplay&&this.settings.autoplayStopAtAction){this.stopAutoplay()}var h=Boolean(this._dw1-this._ev1>0);var i=getCorrectXPos(this._by4());var j=this._cx4(i).index;if(!this._ir2){j=j+(h?this._hs2:(-this._hs2+1))}else{if(h){i=Math.max(i-this.carouselWidth-1,1-b._gt2);j=this._cx4(i).index;if(j===undefined){j=this.numItems-1}}var k=this._gt4(j);j=k*this._hs2}if(h){j=Math.min(j,this.numItems-1)}else{j=Math.max(j,0)}var l=this.items[j];this._az4(j);if(l){i=getCorrectXPos(-l.posX);var m=Math.abs(this.endPos-i);var n=Math.max((m*1.08)/v0,150);var o=Boolean(n<180);var p=m*0.08;if(h){p=p*-1}this.animateTo(o?(i+p):i,Math.min(n,400),"easeOutSine",o,i,300,"easeOutCubic")}}if(this.settings.onDragRelease!==null){this.settings.onDragRelease.call(this)}}return false},_by3:function(a){if(a===undefined){a=this._by4()}if(!this.settings.loopItems){if(a>=0){this._az3()}else if(a<=this.carouselWidth-this._gt2){this._ir4()}else{this._hs4()}}},_mn1:function(){if(this._kp1){this._az1.css('cursor',this._kp1)}else{this._az1.removeClass('grabbing-cursor');this._az1.addClass('grab-cursor')}},_kp4:function(){if(this._lo1){this._az1.css('cursor',this._lo1)}else{this._az1.removeClass('grab-cursor');this._az1.addClass('grabbing-cursor')}}};$.fn.touchCarousel=function(b){return this.each(function(){var a=new TouchCarousel($(this),b);$(this).data("touchCarousel",a)})};$.fn.touchCarousel.defaults={itemsPerMove:1,snapToItems:false,pagingNav:false,pagingNavControls:true,autoplay:false,autoplayDelay:3000,autoplayStopAtAction:true,scrollbar:true,scrollbarAutoHide:false,scrollbarTheme:"dark",transitionSpeed:600,directionNav:true,directionNavAutoHide:false,loopItems:false,keyboardNav:false,dragUsingMouse:true,scrollToLast:false,itemFallbackWidth:500,baseMouseFriction:0.0012,baseTouchFriction:0.0008,lockAxis:true,useWebkit3d:false,onAnimStart:null,onAnimComplete:null,onDragStart:null,onDragRelease:null};$.fn.touchCarousel.settings={};$.extend(jQuery.easing,{easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b}})})(jQuery);
(function($){var types=['DOMMouseScroll','mousewheel'];$.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=types.length;i;){this.addEventListener(types[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=types.length;i;){this.removeEventListener(types[--i],handler,false);}}else{this.onmousewheel=null;}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(event.wheelDelta){delta=event.wheelDelta/120;}
if(event.detail){delta=-event.detail/3;}
deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta;}
if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY/120;}
if(orgEvent.wheelDeltaX!==undefined){deltaX=-1*orgEvent.wheelDeltaX/120;}
args.unshift(event,delta,deltaX,deltaY);return $.event.handle.apply(this,args);}})(jQuery);
(function($){var mwheelI={pos:[-260,-260]},minDif=3,doc=document,root=doc.documentElement,body=doc.body,longDelay,shortDelay;function unsetPos(){if(this===mwheelI.elem){mwheelI.pos=[-260,-260];mwheelI.elem=false;minDif=3;}}
$.event.special.mwheelIntent={setup:function(){var jElm=$(this).bind('mousewheel',$.event.special.mwheelIntent.handler);if(this!==doc&&this!==root&&this!==body){jElm.bind('mouseleave',unsetPos);}
jElm=null;return true;},teardown:function(){$(this).unbind('mousewheel',$.event.special.mwheelIntent.handler).unbind('mouseleave',unsetPos);return true;},handler:function(e,d){var pos=[e.clientX,e.clientY];if(this===mwheelI.elem||Math.abs(mwheelI.pos[0]-pos[0])>minDif||Math.abs(mwheelI.pos[1]-pos[1])>minDif){mwheelI.elem=this;mwheelI.pos=pos;minDif=250;clearTimeout(shortDelay);shortDelay=setTimeout(function(){minDif=10;},200);clearTimeout(longDelay);longDelay=setTimeout(function(){minDif=3;},1500);e=$.extend({},e,{type:'mwheelIntent'});return $.event.handle.apply(this,arguments);}}};$.fn.extend({mwheelIntent:function(fn){return fn?this.bind("mwheelIntent",fn):this.trigger("mwheelIntent");},unmwheelIntent:function(fn){return this.unbind("mwheelIntent",fn);}});$(function(){body=doc.body;$(doc).bind('mwheelIntent.mwheelIntentDefault',$.noop);});})(jQuery);
(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('<div class="jspPane" />').css("padding",aI).append(D.children());am=b('<div class="jspContainer" />').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('<div class="jspCorner" />').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(au<az.horizontalDragMinWidth){au=az.horizontalDragMinWidth}}h.width(au+"px");j=l-au;ae(aa)}if(aA){A=Math.ceil(1/q*t);if(A>az.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(A<az.verticalDragMinHeight){A=az.verticalDragMinHeight}}av.height(A+"px");i=t-A;ad(I)}}function al(aK,aM,aJ,s){var aO="before",aL="after",aN;if(aM=="os"){aM=/Mac/.test(navigator.platform)?"after":"split"}if(aM==aO){aL=aM}else{if(aM==aL){aO=aM;aN=aJ;aJ=s;s=aN}}aK[aO](aJ)[aL](s)}function aE(aJ,s,aK){return function(){H(aJ,s,this,aK);this.blur();return false}}function H(aM,aL,aP,aO){aP=b(aP).addClass("jspActive");var aN,aK,aJ=true,s=function(){if(aM!==0){Q.scrollByX(aM*az.arrowButtonSpeed)}if(aL!==0){Q.scrollByY(aL*az.arrowButtonSpeed)}aK=setTimeout(s,aJ?az.initialDelay:az.arrowRepeatFreq);aJ=false};s();aN=aO?"mouseout.jsp":"mouseup.jsp";aO=aO||b("html");aO.bind(aN,function(){aP.removeClass("jspActive");aK&&clearTimeout(aK);aK=null;aO.unbind(aN)})}function p(){w();if(aA){aq.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageY-aP.top-I,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageY-aS.top-A/2,aQ=v*az.scrollPagePercent,aR=i*aQ/(Z-v);if(aN<0){if(I-aR>aT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aR<aT){Q.scrollByY(aQ)}else{V(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}if(aF){G.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageX-aP.left-aa,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageX-aS.left-au/2,aQ=ak*az.scrollPagePercent,aR=j*aQ/(T-ak);if(aN<0){if(aa-aR>aT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aR<aT){Q.scrollByX(aQ)}else{W(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(aq){aq.unbind("mousedown.jsp")}}function ax(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(av){av.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aJ){if(!aA){return}if(s<0){s=0}else{if(s>i){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae)}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(s<aJ||aR){aS=s-az.verticalGutter}else{if(s+aL>aP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aV<aQ||aR){aU=aV-az.horizontalGutter}else{if(aV+aM>aT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return-Y.position().left}function aB(){return-Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return!aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return!aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus"in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus"in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aL,aJ,aK=escape(location.hash);try{aL=b(aK)}catch(s){return}if(aL.length&&Y.find(aK)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(aK,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(aK,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5;return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){var aJ=aD()+Math[s<0?"floor":"ceil"](s),aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){var aJ=aB()+Math[s<0?"floor":"ceil"](s),aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,easing:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);
jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};
(function($){$.fn.quickAccess=function(options){var opts=$.extend(true,{},$.fn.quickAccess.defaults,options);return new quickAccessClass($(this),opts);};$.fn.quickAccess.defaults={screenPosition:'left',margin:'9px',width:'110px',radius:{},css:{position:'fixed'},itemCss:{'position':'inherit','backgroundColor':'#5C893C'},iconType:'light',change:[]};var quickAccessClass=function(el,opts){var qa=this;qa.el=el;qa.classes=['light','medium_dark','dark'];qa.items=qa.el.find('a');qa.opts=opts;qa.__construct=function(){qa.el.addClass('quickAccess_holder');qa.setContainerClass(qa.opts.iconType);qa.applyCss();qa.applyPosition(qa.opts.screenPosition);qa.applyRadius(qa.opts.radius);qa.addHover();qa.fireChange('end constructor');};qa.fireChange=function(event){var i=qa.opts.change.length;while(i--)qa.opts.change[i](qa);};qa.setOption=function(new_options){qa.opts=$.extend(true,qa.opts,new_options);return qa;};qa.getOption=function(index){return qa.opts[index];};qa.getCssOption=function(index){return qa.opts.itemCss[index];};qa.applyCss=function(){$.each(qa.opts.css,function(index,val){qa.el.css(index,val);});$.each(qa.opts.itemCss,function(index,val){qa.items.css(index,val);});qa.fireChange('apply css');return qa;};qa.removeCss=function(){$.each(qa.opts.css,function(index,val){qa.el.css(index,'');});$.each(qa.opts.itemCss,function(index,val){qa.items.css(index,'');});return qa;};qa.applyPosition=function(screenPosition){qa.el.addClass(screenPosition);switch(screenPosition){case'right':qa.items.css('marginBottom',opts.margin);break;case'top':qa.items.css('marginRight',opts.margin);break;case'bottom':qa.items.css('marginRight',opts.margin);break;default:qa.items.css('marginBottom',opts.margin);break;}
qa.fireChange('apply position');return qa;};qa.removePosition=function(screenPosition){qa.el.removeClass(screenPosition);switch(screenPosition){case'right':qa.items.css('marginBottom','');break;case'top':qa.items.css('marginRight','');break;case'bottom':qa.items.css('marginRight','');break;default:qa.items.css('marginBottom','');break;}
return qa;};qa.changePosition=function(screenPosition){qa.removePosition(qa.opts.screenPosition);qa.setOption({screenPosition:screenPosition});qa.applyPosition(screenPosition);return qa;};qa.applyRadius=function(radius_info){qa.items.css(radius_info);qa.fireChange('apply radius');return qa;};qa.changeRadius=function(radius_info){qa.setOption({radius:radius_info});qa.applyRadius(radius_info);return qa;};qa.removeRadius=function(radius_info){$.each(radius_info,function(index,val){qa.items.css(index,'');});return qa;};qa.getPosition=function(){return qa.getOption('screenPosition');};qa.setContainerClass=function(classname){$.each(qa.classes,function(index,value){qa.el.removeClass(value);});qa.el.addClass(classname);};qa.addHover=function(){qa.removeHover();var offs=0;qa.items.filter('[href*=#]').click(function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var $target=$(this.hash);$target=$target.length&&$target||$('[name='+this.hash.slice(1)+']');if($target.length){var targetOffset=$target.offset().top-offs;$('html,body').animate({scrollTop:targetOffset},700);var hash=this.hash;$('#nav a').each(function(){el=this;$el=$(this);if(el.hash==hash){$('#nav a').parent().removeClass('active');$el.parent().addClass('active');}});return true;}}});qa.items.each(function(){var or_bk=$(this).css('backgroundColor');$(this).hover(function(ev){if($(this).is(':animated')){return false;}
or_bk=$(this).css('backgroundColor');var bk=getBk(or_bk);if(qa.opts.screenPosition=='right'){$(this).animate({width:qa.opts.width,marginLeft:'-'+qa.opts.width,backgroundColor:bk});}
else{$(this).animate({width:qa.opts.width,backgroundColor:bk});}},function(ev){if(qa.opts.screenPosition=='right'){$(this).animate({width:'0px',marginLeft:'0px',backgroundColor:or_bk});}
else{$(this).animate({width:'0px',backgroundColor:or_bk});}});});return qa;};qa.removeHover=function(){qa.items.each(function(){$(this).unbind('mouseenter').unbind('mouseleave');});return qa;};qa.__destruct=function(){qa.el.removeClass('quickAccess_holder');qa.removeCss();qa.removeRadius(qa.opts.radius);qa.removePosition(qa.opts.screenPosition);qa.removeHover();qa.opts={};};qa.__construct();var getBk=function(color){var rgb=getRGB(color);for(var i=0;i<rgb.length;i++){rgb[i]=Math.max(0,rgb[i]-40);}
var newColor='rgb('+rgb[0]+','+rgb[1]+','+rgb[2]+')';return newColor;};var getRGB=function(color){var result;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];};};})(jQuery);(function(d){d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(f,e){d.fx.step[e]=function(g){if(!g.colorInit){g.start=c(g.elem,e);g.end=b(g.end);g.colorInit=true}g.elem.style[e]="rgb("+[Math.max(Math.min(parseInt((g.pos*(g.end[0]-g.start[0]))+g.start[0]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[1]-g.start[1]))+g.start[1]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[2]-g.start[2]))+g.start[2]),255),0)].join(",")+")"}});function b(f){var e;if(f&&f.constructor==Array&&f.length==3){return f}if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return[parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55]}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}if(e=/rgba\(0, 0, 0, 0\)/.exec(f)){return a.transparent}return a[d.trim(f).toLowerCase()]}function c(g,e){var f;do{f=d.curCSS(g,e);if(f!=""&&f!="transparent"||d.nodeName(g,"body")){break}e="backgroundColor"}while(g=g.parentNode);return b(f)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]}})(jQuery);
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});
var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}
return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}
qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}
child=child.nextSibling;}
return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}
var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}
return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){add(obj[i],i);}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}
return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}
this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}
var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}
var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}
this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}
for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}
if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}
return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}
r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}
return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}
for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}
return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Переместите файлы сюда для загрузки</span></div>'+'<div class="qq-upload-button">Загрузить</div>'+'<ul class="qq-upload-list" style="display:none;"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}
return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}
qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}
e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}
qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}
input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}
return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}
this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}
return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}
var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}
if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}
callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}
return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype)
qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}
return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}
this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}
this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});
$('.sel_imul').live('click',function(){$('.sel_imul').removeClass('act');$(this).addClass('act');if($(this).children('.sel_options').is(':visible')){$('.sel_options').hide();}
else{$('.sel_options').hide();$(this).children('.sel_options').show();}});$('.sel_option').live('click',function(){var tektext=$(this).html();$(this).parent('.sel_options').parent('.sel_imul').children('.sel_selected').children('.selected-text').html(tektext);$(this).parent('.sel_options').children('.sel_option').removeClass('sel_ed');$(this).addClass('sel_ed');var tekval=$(this).attr('value');tekval=typeof(tekval)!='undefined'?tekval:tektext;$(this).parent('.sel_options').parent('.sel_imul').parent('.sel_wrap').children('select').children('option').removeAttr('selected').each(function(){if($(this).val()==tekval){$(this).attr('selected','select');}});});var selenter=false;$('.sel_imul').live('mouseenter',function(){selenter=true;});$('.sel_imul').live('mouseleave',function(){selenter=false;});$(document).click(function(){if(!selenter){$('.sel_options').hide();$('.sel_imul').removeClass('act');}});function reselect(select,addclass,callback,id){addclass=typeof(addclass)!='undefined'?addclass:'';$(select).wrap('<div class="sel_wrap '+addclass+'"/>');var sel_options='';$(select).children('option').each(function(){sel_options=sel_options+'<div class="sel_option" value="'+$(this).val()+'">'+$(this).html()+'</div>';});var sel_imul='<div class="sel_imul">\
                <div class="sel_selected">\
                    <div class="selected-text">'+$(select).children('option').first().html()+'</div>\
                    <div class="sel_arraw"></div>\
                </div>\
                <div class="sel_options" id="'+id+'">'+sel_options+'</div>\
            </div>';$(select).before(sel_imul);if(callback){$("#"+id).live('click',function(){callback()})}}
function doCatSearch(catid,list,url){if(!url){url='object'}
catObjectList.url='/'+url
var url=catObjectList.url+'/getCatObjects/city_id/'+city_id+'/catid/'+catid;$.ajax({url:encodeURI(url),cache:true,dataType:"json",success:function(json){list.proccessJSON(json,$("#search_results"))
if(!$('#main_info_toggable').is(':visible'))
$('#main_info').click()}});}
function showCatTags(catid,url,object,cssclass){$(object).parent().parent().parent().find('li').css('background','')
$(object).parent().css('background-color',cssclass)
mapView.reset()
catObjectList.setNoClearDiv(false);doCatSearch(catid,catObjectList,url)}
function cRC(id,object,cssclass,catUrl){if(catUrl=='lostandfound'){catObjectList=new GeoLocationObjectListLostAndFound(mapView)}else{catObjectList=new GeoLocationObjectList(mapView)}
catObjectList.objects=new Array();mapView.reset()
$("#left_panel").hide(600)
$("#main_info_toggable").hide(600)
$(object).parent().attr('class',cssclass+' active')
$("#cat2").html($("#cat3").html())
$("#cat2").offset({left:423})
$("#cat2").animate({left:'-=1000'},animationTime-100);$("#cat3").html($("#subcat"+id).html())
$("#catdiv").height($("#cat3").height())
$("#cat3").offset({top:$("#cat2").offset().top,left:1000})
$("#cat3").animate({left:0},animationTime-100)
$("#catCroudes").find('.arrow').show()
$("#catCroudes").append('<span><a href="javascript:void(0)" subcat='+id+'>'+$(object).text()+'</a>'+'<span class="arrow" style="display:none;">-></span></span>')
$("#catCroudes").find('a:last').css('color',cssclass)
$("#catCroudes").find('a:last').click(croudClick);}
function croudClick(){stepsCroud=new Array();var item=$(this).parent();while(1==1){var id=item.find('a').attr('subcat')
if(!id){break;}
stepsCroud.push(new Array(id,item))
var item=$(item).next()}
if(stepsCroud.length>1){stepsCroud[stepsCroud.length-1][1].remove()}
for(var i=stepsCroud.length-2;i>=0;i--){var time=(stepsCroud.length-2-i)*animationTime-45;setTimeout('cRCBack("'+stepsCroud[i][0]+'")',time)
if(i>0){setTimeout('$(stepsCroud['+i+'][1]).remove()',time+animationTime-100)}else{setTimeout('$(stepsCroud['+i+'][1]).find(".arrow").hide()',time+animationTime-100)}}}
function cRCBack(id){$('#main_info_toggable').hide(600)
$('#left_panel').hide(600)
catObjectList.objects=new Array();$("#search_results").html('');mapView.reset()
if($("#cat2").offset().left>=0){var l=$("#cat2").offset().left;$("#cat2").offset({left:-1000})
$("#cat3").html($("#cat2").html())
$("#cat3").offset({left:l})}
$("#cat2").html($("#subcat"+id).html())
$("#cat3").animate({left:'+=1000'},animationTime-100)
$("#cat3").offset({top:$("#cat2").offset().top})
$("#cat2").animate({left:0},animationTime-100)
$("#catdiv").height($("#cat2").height())}
var Cufon=(function(){var m=function(){return m.replace.apply(null,arguments)};var x=m.DOM={ready:(function(){var C=false,E={loaded:1,complete:1};var B=[],D=function(){if(C){return}C=true;for(var F;F=B.shift();F()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",D,false);window.addEventListener("pageshow",D,false)}if(!window.opera&&document.readyState){(function(){E[document.readyState]?D():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");D()}catch(F){setTimeout(arguments.callee,1)}})()}q(window,"load",D);return function(F){if(!arguments.length){D()}else{C?F():B.push(F)}}})(),root:function(){return document.documentElement||document.body}};var n=m.CSS={Size:function(C,B){this.value=parseFloat(C);this.unit=String(C).match(/[a-z%]*$/)[0]||"px";this.convert=function(D){return D/B*this.value};this.convertFrom=function(D){return D/this.value*B};this.toString=function(){return this.value+this.unit}},addClass:function(C,B){var D=C.className;C.className=D+(D&&" ")+B;return C},color:j(function(C){var B={};B.color=C.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(E,D,F){B.opacity=parseFloat(F);return"rgb("+D+")"});return B}),fontStretch:j(function(B){if(typeof B=="number"){return B}if(/%$/.test(B)){return parseFloat(B)/100}return{"ultra-condensed":0.5,"extra-condensed":0.625,condensed:0.75,"semi-condensed":0.875,"semi-expanded":1.125,expanded:1.25,"extra-expanded":1.5,"ultra-expanded":2}[B]||1}),getStyle:function(C){var B=document.defaultView;if(B&&B.getComputedStyle){return new a(B.getComputedStyle(C,null))}if(C.currentStyle){return new a(C.currentStyle)}return new a(C.style)},gradient:j(function(F){var G={id:F,type:F.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},C=F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var E=0,B=C.length,D;E<B;++E){D=C[E].split("=",2).reverse();G.stops.push([D[1]||E/(B-1),D[0]])}return G}),quotedList:j(function(E){var D=[],C=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,B;while(B=C.exec(E)){D.push(B[3]||B[1])}return D}),recognizesMedia:j(function(G){var E=document.createElement("style"),D,C,B;E.type="text/css";E.media=G;try{E.appendChild(document.createTextNode("/**/"))}catch(F){}C=g("head")[0];C.insertBefore(E,C.firstChild);D=(E.sheet||E.styleSheet);B=D&&!D.disabled;C.removeChild(E);return B}),removeClass:function(D,C){var B=RegExp("(?:^|\\s+)"+C+"(?=\\s|$)","g");D.className=D.className.replace(B,"");return D},supports:function(D,C){var B=document.createElement("span").style;if(B[D]===undefined){return false}B[D]=C;return B[D]===C},textAlign:function(E,D,B,C){if(D.get("textAlign")=="right"){if(B>0){E=" "+E}}else{if(B<C-1){E+=" "}}return E},textShadow:j(function(F){if(F=="none"){return null}var E=[],G={},B,C=0;var D=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(B=D.exec(F)){if(B[0]==","){E.push(G);G={};C=0}else{if(B[1]){G.color=B[1]}else{G[["offX","offY","blur"][C++]]=B[2]}}}E.push(G);return E}),textTransform:(function(){var B={uppercase:function(C){return C.toUpperCase()},lowercase:function(C){return C.toLowerCase()},capitalize:function(C){return C.replace(/\b./g,function(D){return D.toUpperCase()})}};return function(E,D){var C=B[D.get("textTransform")];return C?C(E):E}})(),whiteSpace:(function(){var D={inline:1,"inline-block":1,"run-in":1};var C=/^\s+/,B=/\s+$/;return function(H,F,G,E){if(E){if(E.nodeName.toLowerCase()=="br"){H=H.replace(C,"")}}if(D[F.get("display")]){return H}if(!G.previousSibling){H=H.replace(C,"")}if(!G.nextSibling){H=H.replace(B,"")}return H}})()};n.ready=(function(){var B=!n.recognizesMedia("all"),E=false;var D=[],H=function(){B=true;for(var K;K=D.shift();K()){}};var I=g("link"),J=g("style");function C(K){return K.disabled||G(K.sheet,K.media||"screen")}function G(M,P){if(!n.recognizesMedia(P||"all")){return true}if(!M||M.disabled){return false}try{var Q=M.cssRules,O;if(Q){search:for(var L=0,K=Q.length;O=Q[L],L<K;++L){switch(O.type){case 2:break;case 3:if(!G(O.styleSheet,O.media.mediaText)){return false}break;default:break search}}}}catch(N){}return true}function F(){if(document.createStyleSheet){return true}var L,K;for(K=0;L=I[K];++K){if(L.rel.toLowerCase()=="stylesheet"&&!C(L)){return false}}for(K=0;L=J[K];++K){if(!C(L)){return false}}return true}x.ready(function(){if(!E){E=n.getStyle(document.body).isUsable()}if(B||(E&&F())){H()}else{setTimeout(arguments.callee,10)}});return function(K){if(B){K()}else{D.push(K)}}})();function s(D){var C=this.face=D.face,B={"\u0020":1,"\u00a0":1,"\u3000":1};this.glyphs=D.glyphs;this.w=D.w;this.baseSize=parseInt(C["units-per-em"],10);this.family=C["font-family"].toLowerCase();this.weight=C["font-weight"];this.style=C["font-style"]||"normal";this.viewBox=(function(){var F=C.bbox.split(/\s+/);var E={minX:parseInt(F[0],10),minY:parseInt(F[1],10),maxX:parseInt(F[2],10),maxY:parseInt(F[3],10)};E.width=E.maxX-E.minX;E.height=E.maxY-E.minY;E.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")};return E})();this.ascent=-parseInt(C.ascent,10);this.descent=-parseInt(C.descent,10);this.height=-this.ascent+this.descent;this.spacing=function(L,N,E){var O=this.glyphs,M,K,G,P=[],F=0,J=-1,I=-1,H;while(H=L[++J]){M=O[H]||this.missingGlyph;if(!M){continue}if(K){F-=G=K[H]||0;P[I]-=G}F+=P[++I]=~~(M.w||this.w)+N+(B[H]?E:0);K=M.k}P.total=F;return P}}function f(){var C={},B={oblique:"italic",italic:"oblique"};this.add=function(D){(C[D.style]||(C[D.style]={}))[D.weight]=D};this.get=function(H,I){var G=C[H]||C[B[H]]||C.normal||C.italic||C.oblique;if(!G){return null}I={normal:400,bold:700}[I]||parseInt(I,10);if(G[I]){return G[I]}var E={1:1,99:0}[I%100],K=[],F,D;if(E===undefined){E=I>400}if(I==500){I=400}for(var J in G){if(!k(G,J)){continue}J=parseInt(J,10);if(!F||J<F){F=J}if(!D||J>D){D=J}K.push(J)}if(I<F){I=F}if(I>D){I=D}K.sort(function(M,L){return(E?(M>=I&&L>=I)?M<L:M>L:(M<=I&&L<=I)?M>L:M<L)?-1:1});return G[K[0]]}}function r(){function D(F,G){if(F.contains){return F.contains(G)}return F.compareDocumentPosition(G)&16}function B(G){var F=G.relatedTarget;if(!F||D(this,F)){return}C(this,G.type=="mouseover")}function E(F){C(this,F.type=="mouseenter")}function C(F,G){setTimeout(function(){var H=d.get(F).options;m.replace(F,G?h(H,H.hover):H,true)},10)}this.attach=function(F){if(F.onmouseenter===undefined){q(F,"mouseover",B);q(F,"mouseout",B)}else{q(F,"mouseenter",E);q(F,"mouseleave",E)}}}function u(){var C=[],D={};function B(H){var E=[],G;for(var F=0;G=H[F];++F){E[F]=C[D[G]]}return E}this.add=function(F,E){D[F]=C.push(E)-1};this.repeat=function(){var E=arguments.length?B(arguments):C,F;for(var G=0;F=E[G++];){m.replace(F[0],F[1],true)}}}function A(){var D={},B=0;function C(E){return E.cufid||(E.cufid=++B)}this.get=function(E){var F=C(E);return D[F]||(D[F]={})}}function a(B){var D={},C={};this.extend=function(E){for(var F in E){if(k(E,F)){D[F]=E[F]}}return this};this.get=function(E){return D[E]!=undefined?D[E]:B[E]};this.getSize=function(F,E){return C[F]||(C[F]=new n.Size(this.get(F),E))};this.isUsable=function(){return!!B}}function q(C,B,D){if(C.addEventListener){C.addEventListener(B,D,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){return D.call(C,window.event)})}}}function v(C,B){var D=d.get(C);if(D.options){return C}if(B.hover&&B.hoverables[C.nodeName.toLowerCase()]){b.attach(C)}D.options=B;return C}function j(B){var C={};return function(D){if(!k(C,D)){C[D]=B.apply(null,arguments)}return C[D]}}function c(F,E){var B=n.quotedList(E.get("fontFamily").toLowerCase()),D;for(var C=0;D=B[C];++C){if(i[D]){return i[D].get(E.get("fontStyle"),E.get("fontWeight"))}}return null}function g(B){return document.getElementsByTagName(B)}function k(C,B){return C.hasOwnProperty(B)}function h(){var C={},B,F;for(var E=0,D=arguments.length;B=arguments[E],E<D;++E){for(F in B){if(k(B,F)){C[F]=B[F]}}}return C}function o(E,M,C,N,F,D){var K=document.createDocumentFragment(),H;if(M===""){return K}var L=N.separate;var I=M.split(p[L]),B=(L=="words");if(B&&t){if(/^\s/.test(M)){I.unshift("")}if(/\s$/.test(M)){I.push("")}}for(var J=0,G=I.length;J<G;++J){H=z[N.engine](E,B?n.textAlign(I[J],C,J,G):I[J],C,N,F,D,J<G-1);if(H){K.appendChild(H)}}return K}function l(D,M){var C=D.nodeName.toLowerCase();if(M.ignore[C]){return}var E=!M.textless[C];var B=n.getStyle(v(D,M)).extend(M);var F=c(D,B),G,K,I,H,L,J;if(!F){return}for(G=D.firstChild;G;G=I){K=G.nodeType;I=G.nextSibling;if(E&&K==3){if(H){H.appendData(G.data);D.removeChild(G)}else{H=G}if(I){continue}}if(H){D.replaceChild(o(F,n.whiteSpace(H.data,B,H,J),B,M,G,D),H);H=null}if(K==1){if(G.firstChild){if(G.nodeName.toLowerCase()=="cufon"){z[M.engine](F,null,B,M,G,D)}else{arguments.callee(G,M)}}J=G}}}var t=" ".split(/\s+/).length==0;var d=new A();var b=new r();var y=new u();var e=false;var z={},i={},w={autoDetect:false,engine:null,forceHitArea:false,hover:false,hoverables:{a:true},ignore:{applet:1,canvas:1,col:1,colgroup:1,head:1,iframe:1,map:1,optgroup:1,option:1,script:1,select:1,style:1,textarea:1,title:1,pre:1},printable:true,selector:(window.Sizzle||(window.jQuery&&function(B){return jQuery(B)})||(window.dojo&&dojo.query)||(window.Ext&&Ext.query)||(window.YAHOO&&YAHOO.util&&YAHOO.util.Selector&&YAHOO.util.Selector.query)||(window.$$&&function(B){return $$(B)})||(window.$&&function(B){return $(B)})||(document.querySelectorAll&&function(B){return document.querySelectorAll(B)})||g),separate:"words",textless:{dl:1,html:1,ol:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,ul:1},textShadow:"none"};var p={words:/\s/.test("\u00a0")?/[^\S\u00a0]+/:/\s+/,characters:"",none:/^/};m.now=function(){x.ready();return m};m.refresh=function(){y.repeat.apply(y,arguments);return m};m.registerEngine=function(C,B){if(!B){return m}z[C]=B;return m.set("engine",C)};m.registerFont=function(D){if(!D){return m}var B=new s(D),C=B.family;if(!i[C]){i[C]=new f()}i[C].add(B);return m.set("fontFamily",'"'+C+'"')};m.replace=function(D,C,B){C=h(w,C);if(!C.engine){return m}if(!e){n.addClass(x.root(),"cufon-active cufon-loading");n.ready(function(){n.addClass(n.removeClass(x.root(),"cufon-loading"),"cufon-ready")});e=true}if(C.hover){C.forceHitArea=true}if(C.autoDetect){delete C.fontFamily}if(typeof C.textShadow=="string"){C.textShadow=n.textShadow(C.textShadow)}if(typeof C.color=="string"&&/^-/.test(C.color)){C.textGradient=n.gradient(C.color)}else{delete C.textGradient}if(!B){y.add(D,arguments)}if(D.nodeType||typeof D=="string"){D=[D]}n.ready(function(){for(var F=0,E=D.length;F<E;++F){var G=D[F];if(typeof G=="string"){m.replace(C.selector(G),C,true)}else{l(G,C)}}});return m};m.set=function(B,C){w[B]=C;return m};return m})();Cufon.registerEngine("vml",(function(){var e=document.namespaces;if(!e){return}e.add("cvml","urn:schemas-microsoft-com:vml");e=null;var b=document.createElement("cvml:shape");b.style.behavior="url(#default#VML)";if(!b.coordsize){return}b=null;var h=(document.documentMode||0)<8;document.write(('<style type="text/css">cufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:'+(h?"middle":"text-bottom")+";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}</style>").replace(/;/g,"!important;"));function c(i,j){return a(i,/(?:em|ex|%)$|^[a-z-]+$/i.test(j)?"1em":j)}function a(l,m){if(m==="0"){return 0}if(/px$/i.test(m)){return parseFloat(m)}var k=l.style.left,j=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=m.replace("%","em");var i=l.style.pixelLeft;l.style.left=k;l.runtimeStyle.left=j;return i}function f(l,k,j,n){var i="computed"+n,m=k[i];if(isNaN(m)){m=k.get(n);k[i]=m=(m=="normal")?0:~~j.convertFrom(a(l,m))}return m}var g={};function d(p){var q=p.id;if(!g[q]){var n=p.stops,o=document.createElement("cvml:fill"),i=[];o.type="gradient";o.angle=180;o.focus="0";o.method="sigma";o.color=n[0][1];for(var m=1,l=n.length-1;m<l;++m){i.push(n[m][0]*100+"% "+n[m][1])}o.colors=i.join(",");o.color2=n[l][1];g[q]=o}return g[q]}return function(ac,G,Y,C,K,ad,W){var n=(G===null);if(n){G=K.alt}var I=ac.viewBox;var p=Y.computedFontSize||(Y.computedFontSize=new Cufon.CSS.Size(c(ad,Y.get("fontSize"))+"px",ac.baseSize));var y,q;if(n){y=K;q=K.firstChild}else{y=document.createElement("cufon");y.className="cufon cufon-vml";y.alt=G;q=document.createElement("cufoncanvas");y.appendChild(q);if(C.printable){var Z=document.createElement("cufontext");Z.appendChild(document.createTextNode(G));y.appendChild(Z)}if(!W){y.appendChild(document.createElement("cvml:shape"))}}var ai=y.style;var R=q.style;var l=p.convert(I.height),af=Math.ceil(l);var V=af/l;var P=V*Cufon.CSS.fontStretch(Y.get("fontStretch"));var U=I.minX,T=I.minY;R.height=af;R.top=Math.round(p.convert(T-ac.ascent));R.left=Math.round(p.convert(U));ai.height=p.convert(ac.height)+"px";var F=Y.get("color");var ag=Cufon.CSS.textTransform(G,Y).split("");var L=ac.spacing(ag,f(ad,Y,p,"letterSpacing"),f(ad,Y,p,"wordSpacing"));if(!L.length){return null}var k=L.total;var x=-U+k+(I.width-L[L.length-1]);var ah=p.convert(x*P),X=Math.round(ah);var O=x+","+I.height,m;var J="r"+O+"ns";var u=C.textGradient&&d(C.textGradient);var o=ac.glyphs,S=0;var H=C.textShadow;var ab=-1,aa=0,w;while(w=ag[++ab]){var D=o[ag[ab]]||ac.missingGlyph,v;if(!D){continue}if(n){v=q.childNodes[aa];while(v.firstChild){v.removeChild(v.firstChild)}}else{v=document.createElement("cvml:shape");q.appendChild(v)}v.stroked="f";v.coordsize=O;v.coordorigin=m=(U-S)+","+T;v.path=(D.d?"m"+D.d+"xe":"")+"m"+m+J;v.fillcolor=F;if(u){v.appendChild(u.cloneNode(false))}var ae=v.style;ae.width=X;ae.height=af;if(H){var s=H[0],r=H[1];var B=Cufon.CSS.color(s.color),z;var N=document.createElement("cvml:shadow");N.on="t";N.color=B.color;N.offset=s.offX+","+s.offY;if(r){z=Cufon.CSS.color(r.color);N.type="double";N.color2=z.color;N.offset2=r.offX+","+r.offY}N.opacity=B.opacity||(z&&z.opacity)||1;v.appendChild(N)}S+=L[aa++]}var M=v.nextSibling,t,A;if(C.forceHitArea){if(!M){M=document.createElement("cvml:rect");M.stroked="f";M.className="cufon-vml-cover";t=document.createElement("cvml:fill");t.opacity=0;M.appendChild(t);q.appendChild(M)}A=M.style;A.width=X;A.height=af}else{if(M){q.removeChild(M)}}ai.width=Math.max(Math.ceil(p.convert(k*P)),0);if(h){var Q=Y.computedYAdjust;if(Q===undefined){var E=Y.get("lineHeight");if(E=="normal"){E="1em"}else{if(!isNaN(E)){E+="em"}}Y.computedYAdjust=Q=0.5*(a(ad,E)-parseFloat(ai.height))}if(Q){ai.marginTop=Math.ceil(Q)+"px";ai.marginBottom=Q+"px"}}return y}})());Cufon.registerEngine("canvas",(function(){var b=document.createElement("canvas");if(!b||!b.getContext||!b.getContext.apply){return}b=null;var a=Cufon.CSS.supports("display","inline-block");var e=!a&&(document.compatMode=="BackCompat"||/frameset|transitional/i.test(document.doctype.publicId));var f=document.createElement("style");f.type="text/css";f.appendChild(document.createTextNode(("cufon{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;"+(e?"":"font-size:1px;line-height:1px;")+"}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(a?"cufon canvas{position:relative;}":"cufon canvas{position:absolute;}")+"}@media print{cufon{padding:0;}cufon canvas{display:none;}}").replace(/;/g,"!important;")));document.getElementsByTagName("head")[0].appendChild(f);function d(p,h){var n=0,m=0;var g=[],o=/([mrvxe])([^a-z]*)/g,k;generate:for(var j=0;k=o.exec(p);++j){var l=k[2].split(",");switch(k[1]){case"v":g[j]={m:"bezierCurveTo",a:[n+~~l[0],m+~~l[1],n+~~l[2],m+~~l[3],n+=~~l[4],m+=~~l[5]]};break;case"r":g[j]={m:"lineTo",a:[n+=~~l[0],m+=~~l[1]]};break;case"m":g[j]={m:"moveTo",a:[n=~~l[0],m=~~l[1]]};break;case"x":g[j]={m:"closePath"};break;case"e":break generate}h[g[j].m].apply(h,g[j].a)}return g}function c(m,k){for(var j=0,h=m.length;j<h;++j){var g=m[j];k[g.m].apply(k,g.a)}}return function(V,w,P,t,C,W){var k=(w===null);if(k){w=C.getAttribute("alt")}var A=V.viewBox;var m=P.getSize("fontSize",V.baseSize);var B=0,O=0,N=0,u=0;var z=t.textShadow,L=[];if(z){for(var U=z.length;U--;){var F=z[U];var K=m.convertFrom(parseFloat(F.offX));var I=m.convertFrom(parseFloat(F.offY));L[U]=[K,I];if(I<B){B=I}if(K>O){O=K}if(I>N){N=I}if(K<u){u=K}}}var Z=Cufon.CSS.textTransform(w,P).split("");var E=V.spacing(Z,~~m.convertFrom(parseFloat(P.get("letterSpacing"))||0),~~m.convertFrom(parseFloat(P.get("wordSpacing"))||0));if(!E.length){return null}var h=E.total;O+=A.width-E[E.length-1];u+=A.minX;var s,n;if(k){s=C;n=C.firstChild}else{s=document.createElement("cufon");s.className="cufon cufon-canvas";s.setAttribute("alt",w);n=document.createElement("canvas");s.appendChild(n);if(t.printable){var S=document.createElement("cufontext");S.appendChild(document.createTextNode(w));s.appendChild(S)}}var aa=s.style;var H=n.style;var j=m.convert(A.height);var Y=Math.ceil(j);var M=Y/j;var G=M*Cufon.CSS.fontStretch(P.get("fontStretch"));var J=h*G;var Q=Math.ceil(m.convert(J+O-u));var o=Math.ceil(m.convert(A.height-B+N));n.width=Q;n.height=o;H.width=Q+"px";H.height=o+"px";B+=A.minY;H.top=Math.round(m.convert(B-V.ascent))+"px";H.left=Math.round(m.convert(u))+"px";var r=Math.max(Math.ceil(m.convert(J)),0)+"px";if(a){aa.width=r;aa.height=m.convert(V.height)+"px"}else{aa.paddingLeft=r;aa.paddingBottom=(m.convert(V.height)-1)+"px"}var X=n.getContext("2d"),D=j/A.height;X.scale(D,D*M);X.translate(-u,-B);X.save();function T(){var x=V.glyphs,ab,l=-1,g=-1,y;X.scale(G,1);while(y=Z[++l]){var ab=x[Z[l]]||V.missingGlyph;if(!ab){continue}if(ab.d){X.beginPath();if(ab.code){c(ab.code,X)}else{ab.code=d("m"+ab.d,X)}X.fill()}X.translate(E[++g],0)}X.restore()}if(z){for(var U=z.length;U--;){var F=z[U];X.save();X.fillStyle=F.color;X.translate.apply(X,L[U]);T()}}var q=t.textGradient;if(q){var v=q.stops,p=X.createLinearGradient(0,A.minY,0,A.maxY);for(var U=0,R=v.length;U<R;++U){p.addColorStop.apply(p,v[U])}X.fillStyle=p}else{X.fillStyle=P.get("color")}T();return s}})());
Cufon.registerFont({"w":237,"face":{"font-family":"ChunkFive","font-weight":400,"font-stretch":"normal","units-per-em":"360","panose-1":"0 0 0 0 0 0 0 0 0 0","ascent":"270","descent":"-90","x-height":"5","bbox":"-4 -293 369 83","underline-thickness":"18","underline-position":"-18","unicode-range":"U+0020-U+007C"},"glyphs":{" ":{"w":90},"e":{"d":"159,-60r31,35v-65,53,-182,46,-188,-66v-6,-105,156,-123,183,-42v4,13,8,40,0,61r-113,0v2,10,7,30,37,30v12,0,31,-2,50,-18xm101,-136v-22,0,-27,19,-28,28r54,0v0,-14,-3,-28,-26,-28","w":195},"f":{"d":"148,-267r-22,41v-10,-5,-31,-9,-31,15r0,31r33,0r0,47r-33,0r0,86r22,0r0,47r-108,0r0,-47r15,0r0,-86r-15,0r0,-47r15,0v1,-53,-10,-96,71,-96v19,0,44,4,53,9","w":138},"g":{"d":"9,42r19,-40v8,7,35,23,62,23v38,0,44,-19,42,-46v-5,6,-19,20,-42,20v-62,0,-86,-45,-86,-90v0,-71,73,-118,128,-78r7,-11r86,0r0,47r-22,0r0,108v0,60,-36,99,-112,99v-40,0,-68,-19,-82,-32xm80,-92v0,22,10,44,26,44v14,0,26,-18,26,-46v0,-24,-12,-43,-26,-43v-15,0,-26,18,-26,45","w":230},"h":{"d":"122,-47r0,47r-113,0r0,-47r15,0r0,-176r-15,0r0,-47r87,0r0,112v4,-6,31,-28,57,-28v80,0,60,71,63,139r17,0r0,47r-93,0r0,-98v0,-12,0,-33,-21,-33v-34,0,-20,51,-23,84r26,0"},"i":{"d":"110,-47r0,47r-101,0r0,-47r15,0r0,-86r-15,0r0,-47r84,0r0,133r17,0xm58,-196v-49,-2,-53,-72,0,-73v52,0,53,74,0,73","w":118},"j":{"d":"46,-25r0,-108r-15,0r0,-47r83,0r0,155v0,45,-13,100,-109,100r0,-48v42,0,41,-35,41,-52xm80,-196v-49,-2,-53,-72,0,-73v52,0,53,74,0,73","w":129},"o":{"d":"104,5v-51,0,-101,-32,-100,-96v0,-60,49,-93,99,-93v57,0,99,35,100,95v1,60,-44,94,-99,94xm104,-41v15,0,25,-21,25,-48v0,-27,-9,-49,-26,-49v-14,0,-25,22,-25,48v0,30,11,49,26,49","w":206},"u":{"d":"5,-132r0,-48r88,0r0,87v0,31,4,45,19,45v32,0,21,-52,23,-84r-24,0r0,-48r93,0r0,132r18,0r0,48r-68,0r-10,-23v-8,9,-20,28,-51,28v-73,0,-75,-63,-72,-137r-16,0","w":227},"t":{"d":"5,-133r0,-47r20,0r0,-33r66,-21r0,54r34,0r0,47r-34,0r0,64v0,12,-2,29,12,29v5,0,15,-3,22,-6r0,46v-11,4,-35,6,-43,6v-78,3,-52,-74,-57,-139r-20,0","w":130},"B":{"d":"244,-73v0,98,-142,69,-235,73r0,-47r21,0r0,-158r-21,0r0,-47v84,3,222,-20,222,62v0,30,-8,45,-35,56v26,7,48,26,48,61xm104,-47v31,2,57,0,58,-31v1,-29,-27,-34,-58,-31r0,62xm151,-178v0,-27,-21,-27,-47,-26r0,54v27,2,47,-1,47,-28","w":247},"D":{"d":"117,0r-108,0r0,-48r22,0r0,-156r-22,0r0,-48r110,0v87,0,137,54,137,123v0,82,-50,129,-139,129xm173,-129v0,-44,-19,-81,-68,-75r0,156v51,5,68,-31,68,-81","w":259},"C":{"d":"199,-91r43,46v-24,27,-63,51,-110,51v-76,0,-127,-49,-127,-129v0,-110,112,-166,165,-108r9,-21r56,0r0,103r-64,0v-1,-23,-13,-46,-39,-46v-57,0,-58,139,10,139v30,0,54,-31,57,-35","w":246},"N":{"d":"285,-252r0,47r-24,0r0,205r-77,0r-92,-137r0,91r28,0r0,46r-111,0r0,-46r21,0r0,-159r-21,0r0,-47r104,0r88,132r0,-85r-25,0r0,-47r109,0","w":293},"n":{"d":"120,-47r0,47r-111,0r0,-47r15,0r0,-86r-15,0r0,-47r77,0r8,22v12,-17,28,-28,51,-28v80,0,64,70,66,139r17,0r0,47r-91,0r0,-98v0,-12,1,-34,-20,-34v-34,0,-20,51,-23,85r26,0","w":232},"l":{"d":"114,-47r0,47r-105,0r0,-47r15,0r0,-177r-15,0r0,-46r84,0r0,223r21,0","w":119},"m":{"d":"116,-47r0,47r-107,0r0,-47r15,0r0,-85r-15,0r0,-48r68,0r8,22v6,-7,22,-27,45,-27v36,0,48,17,54,26v11,-13,28,-26,53,-26v77,2,66,68,67,136r17,0r0,49r-91,0r0,-88v0,-17,3,-45,-14,-45v-33,0,-14,55,-19,85r22,0r0,48r-93,0r0,-92v0,-29,-1,-41,-15,-41v-30,2,-12,58,-17,86r22,0","w":326},"p":{"d":"149,-88v0,-22,-10,-44,-26,-44v-14,0,-26,18,-26,46v0,24,12,43,26,43v15,0,26,-18,26,-45xm9,73r0,-47r15,0r0,-158r-15,0r0,-48r82,0r7,13v7,-5,21,-16,43,-16v56,0,85,43,85,94v0,79,-82,113,-129,79r0,36r20,0r0,47r-108,0","w":229},"q":{"d":"138,-93v0,-22,-10,-44,-26,-44v-14,0,-26,18,-26,46v0,24,12,43,26,43v15,0,26,-18,26,-45xm114,83r0,-47r24,0r0,-48v-51,37,-129,0,-129,-79v0,-81,81,-113,129,-78r7,-11r84,0r0,47r-18,0r0,168r18,0r0,48r-115,0"},"r":{"d":"111,-47r0,47r-102,0r0,-47r16,0r0,-86r-16,0r0,-47r68,0r11,23v9,-17,19,-32,56,-32r0,65v-49,-5,-55,30,-51,77r18,0","w":149},"P":{"d":"9,-204r0,-48r117,0v84,0,99,36,99,77v-1,57,-57,77,-122,72r0,55r22,0r0,48r-116,0r0,-48r20,0r0,-156r-20,0xm154,-172v0,-28,-21,-36,-51,-33r0,63v28,2,51,-5,51,-30","w":230},"x":{"d":"135,-135r0,-45r92,0r0,45r-24,0r-38,39r45,51r17,0r0,45r-115,0r0,-45r17,0r-27,-29r-26,29r23,0r0,45r-92,0r0,-45r24,0r37,-41r-45,-49r-16,0r0,-45r117,0r0,45r-17,0r25,27r27,-27r-24,0","w":233},"w":{"d":"102,-55v-1,-23,16,-94,27,-125r66,0v12,32,26,99,30,125v1,-18,9,-57,16,-78r-15,0r0,-47r88,0r0,47r-15,0r-42,133r-76,0r-25,-81r-26,81r-74,0r-41,-133r-15,0r0,-47r97,0r0,47r-12,0v7,20,16,59,17,78","w":313},"d":{"d":"132,-170r0,-53r-16,0r0,-47r90,0r0,223r17,0r0,47r-84,0r-7,-13v-5,4,-20,16,-45,16v-51,0,-83,-45,-83,-95v0,-76,79,-113,128,-78xm81,-92v0,22,10,44,26,44v14,0,25,-18,25,-46v0,-24,-11,-43,-25,-43v-15,0,-26,18,-26,45","w":228},"k":{"d":"110,0r-96,0r0,-47r14,0r0,-176r-14,0r0,-47r83,0r0,163r42,-25r-26,0r0,-48r100,0r0,48v-25,-3,-39,6,-52,15r49,70r18,0r0,47r-107,0r0,-47r15,0r-27,-39r-13,9r0,30r14,0r0,47","w":235},"K":{"d":"122,-252r0,47r-19,0r0,58r67,-58r-26,0r0,-47r120,0r0,47r-21,0r-52,45r73,113r20,0r0,47r-140,0r0,-47r24,0r-38,-61r-27,23r0,38r19,0r0,47r-113,0r0,-47r19,0r0,-158r-19,0r0,-47r113,0","w":293},"v":{"d":"91,-134v12,20,22,57,28,76v1,-22,19,-56,28,-76r-19,0r0,-46r93,0r0,46r-19,0r-62,134r-56,0r-67,-134r-17,0r0,-46r109,0r0,46r-18,0","w":220},"y":{"d":"114,-78r24,-56r-17,0r0,-46r91,0r0,45r-17,0r-68,166v-10,22,-26,51,-78,51v-19,0,-32,-9,-43,-18r27,-43v13,15,38,17,44,-7r5,-15r-70,-133r-15,0r0,-46r111,0r0,46r-17,0","w":208},"E":{"d":"9,-204r0,-48r217,0r0,80r-62,0r0,-32r-58,0r0,50r69,0r0,47r-69,0r0,59r58,0r0,-33r62,0r0,81r-217,0r0,-48r23,0r0,-156r-23,0","w":235},"W":{"d":"94,-205v8,35,15,93,23,124v5,-34,26,-126,36,-171r75,0r22,100v7,22,5,57,13,71v4,-41,15,-86,23,-124r-20,0r0,-47r103,0r0,47r-20,0r-53,205r-86,0v-12,-42,-17,-91,-32,-130v-6,46,-20,87,-30,130r-84,0r-47,-205r-21,0r0,-47r119,0r0,47r-21,0","w":365,"k":{"a":22,"s":22,"y":11,"r":22,"u":11,"o":22,"e":22}},"H":{"d":"9,-204r0,-48r117,0r0,48r-23,0r0,54r69,0r0,-54r-22,0r0,-48r117,0r0,48r-20,0r0,156r20,0r0,48r-117,0r0,-48r22,0r0,-54r-69,0r0,54r23,0r0,48r-117,0r0,-48r20,0r0,-156r-20,0","w":276},"U":{"d":"5,-205r0,-47r115,0r0,47r-20,0v0,51,-8,161,36,148v22,0,37,-9,37,-71r0,-76r-20,0r0,-48r107,0r0,47r-20,0r0,87v0,85,-35,124,-103,124v-73,0,-111,-40,-111,-122r0,-89r-21,0","w":265},"M":{"d":"261,-47r-2,-141r-48,188r-76,0v-16,-65,-37,-116,-48,-188v-4,44,0,96,-1,142r21,0r0,46r-98,0r0,-46r19,0r0,-159r-19,0r0,-47r137,0r36,135r35,-135r137,0r0,47r-20,0r0,158r20,0r0,47r-114,0r0,-47r21,0","w":362},"@":{"d":"67,-84v-5,-46,68,-109,108,-60r2,-14r36,5r-14,103v32,18,50,-27,50,-49v0,-54,-43,-98,-113,-98v-73,0,-104,68,-104,115v0,59,48,108,111,108v54,0,84,-26,84,-26r17,24v0,0,-37,32,-101,32v-74,0,-141,-55,-141,-138v0,-60,40,-145,134,-145v89,0,143,57,143,128v0,31,-14,84,-67,84v-19,0,-27,-7,-32,-12v-51,40,-106,8,-113,-57xm170,-102v-4,-9,-14,-24,-30,-24v-42,-1,-41,79,-8,80v10,0,20,-3,31,-9","w":280},"G":{"d":"188,0r-12,-23v-8,13,-30,26,-58,26v-63,0,-113,-48,-113,-126v0,-78,55,-133,111,-133v52,0,64,24,70,30r8,-26r53,0r0,107r-64,0v-1,-29,-20,-46,-41,-46v-29,0,-49,32,-49,68v0,56,58,87,83,48r0,-15r-22,0r0,-39r120,0r0,39r-14,0r0,90r-72,0","w":279},"T":{"d":"5,-252r242,0r0,94r-53,0r0,-46r-30,0r0,156r30,0r0,48r-134,0r0,-48r29,0r0,-156r-31,0r0,46r-53,0r0,-94","w":252,"k":{"a":22,"s":22,"y":14,"r":22,"u":14,"o":22,"e":22}},"R":{"d":"9,-204r0,-48r117,0v84,0,100,34,100,75v0,28,-22,48,-52,52v25,4,47,25,47,51v0,25,13,32,17,13r0,-12r24,0v2,43,-5,77,-53,77v-47,0,-70,-25,-70,-67v0,-33,-4,-40,-36,-40r0,55r22,0r0,48r-116,0r0,-48r20,0r0,-156r-20,0xm154,-173v0,-28,-21,-34,-51,-32r0,61v28,2,51,-4,51,-29","w":265},"V":{"d":"140,-124v8,18,7,36,13,43v7,-39,32,-87,46,-124r-19,0r0,-47r102,0r0,47r-18,0r-86,205r-66,0r-96,-205r-20,0r0,-47r133,0r0,47r-20,0","w":278,"k":{"a":22,"y":22,"u":22,"o":22,"e":22}},"X":{"d":"129,-46r0,46r-120,0r0,-46r31,0r53,-69r-65,-90r-19,0r0,-47r143,0r0,47r-21,0r35,48r37,-48r-32,0r0,-47r120,0r0,47r-31,0r-54,70r65,88r21,0r0,47r-144,0r0,-47r20,0r-34,-47r-38,48r33,0","w":300},"s":{"d":"73,-130v16,28,103,20,103,80v0,59,-99,70,-122,28r-4,22r-45,0r0,-65r49,0v0,19,27,24,38,24v7,0,16,-2,16,-12v0,-11,-27,-13,-53,-22v-24,-9,-48,-23,-48,-57v0,-63,95,-65,117,-24r3,-24r44,0r0,65r-47,0v0,-15,-19,-28,-37,-28v-8,0,-14,4,-14,13","w":182},"S":{"d":"72,0r-63,0r0,-91r67,0v0,30,30,36,45,36v13,0,31,-3,31,-18v0,-28,-138,-16,-138,-108v0,-88,122,-101,161,-40r3,-31r62,0r0,91r-65,0v0,-27,-21,-42,-46,-42v-10,0,-25,6,-25,19v0,37,143,28,143,113v0,90,-135,93,-171,43","w":255},"Q":{"d":"157,-2v-89,12,-152,-30,-152,-125v0,-73,49,-126,121,-126v124,0,153,142,94,218v1,21,23,33,23,7r0,-10r23,0v3,44,-11,75,-54,76v-30,0,-47,-19,-55,-40xm86,-108v14,-20,62,-23,83,-3v5,-43,-13,-89,-43,-89v-26,0,-47,48,-40,92xm104,-66v12,14,30,16,44,4v-2,-41,-36,-35,-44,-4","w":271},"z":{"d":"56,-108r-47,0r0,-72r178,0r0,46r-85,87r37,0r0,-25r51,0r0,72r-181,0r0,-47r87,-87r-40,0r0,26","w":199},"Z":{"d":"72,-157r-61,0r0,-95r236,0r1,48r-132,156r67,0r0,-46r64,0r0,94r-238,0r0,-47r131,-157r-68,0r0,47","w":257},"?":{"d":"40,-172r-39,-39v42,-63,179,-67,179,27v0,59,-69,48,-57,100r-67,0r0,-29v0,-33,57,-51,57,-71v0,-14,-14,-17,-27,-17v-15,0,-34,15,-46,29xm46,-37v0,-18,15,-38,41,-38v26,0,43,17,43,38v0,20,-17,37,-43,37v-23,0,-41,-18,-41,-37","w":187},"F":{"d":"9,-204r0,-48r215,0r0,80r-63,0r0,-32r-55,0r0,63r69,0r0,47r-69,0r0,46r37,0r0,48r-134,0r0,-48r22,0r0,-156r-22,0","w":229,"k":{"a":22,"s":22,"y":11,"r":22,"u":11,"o":22,"e":22}},"I":{"d":"9,-204r0,-48r120,0r0,48r-23,0r0,156r23,0r0,48r-120,0r0,-48r23,0r0,-156r-23,0","w":137},"J":{"d":"8,69r-1,-47v30,9,45,-2,46,-49r0,-177r-31,0r0,-48r136,0r0,48r-30,0v-5,127,38,304,-120,273","w":166},"L":{"d":"9,-204r0,-48r114,0r0,48r-19,0r0,156r46,0r0,-46r61,0r0,94r-202,0r0,-48r20,0r0,-156r-20,0","w":219},"O":{"d":"134,6v-75,0,-129,-43,-129,-133v0,-78,52,-131,127,-131v88,0,129,52,129,133v0,81,-46,131,-127,131xm134,-50v23,0,37,-30,37,-75v0,-44,-12,-78,-40,-78v-22,0,-37,31,-37,76v0,47,17,77,40,77","w":266},".":{"d":"46,1v-53,0,-54,-77,0,-79v52,1,56,81,0,79","w":92},"a":{"d":"28,-123r-15,-42v45,-34,175,-43,176,49r0,70r22,0r0,46r-77,0r-9,-16v-38,44,-115,24,-120,-37v-5,-56,76,-84,111,-54v9,-51,-66,-32,-88,-16xm74,-57v-1,23,37,19,42,5v0,-17,1,-24,-21,-24v-14,0,-21,8,-21,19","w":216},"b":{"d":"92,0r-81,0r0,-47r15,0r0,-176r-15,0r0,-47r87,0r0,104v8,-9,29,-17,47,-17v55,0,83,46,83,94v0,75,-79,118,-130,77xm149,-88v0,-22,-10,-44,-26,-44v-14,0,-25,18,-25,46v0,24,11,43,25,43v15,0,26,-18,26,-45","w":236},"c":{"d":"130,-99v-1,-17,-6,-37,-23,-37v-45,0,-42,90,5,88v19,0,32,-7,44,-20r32,36v-47,57,-188,51,-188,-59v0,-85,90,-114,134,-72r6,-17r43,0r0,81r-53,0","w":191},"[":{"d":"10,-204r0,-48r117,0v84,0,99,41,99,82v0,27,-15,46,-38,59r40,64r21,0r0,47r-69,0r-60,-96r-16,0r0,48r22,0r0,48r-116,0r0,-48r21,0r0,-156r-21,0xm156,-172v0,-28,-22,-36,-52,-33r0,63v29,2,53,-5,52,-30","w":259},"\\":{"d":"187,28r-51,1r-134,-300r51,0","w":188},"]":{"d":"119,0r-108,0r0,-47r15,0r0,-176r-15,0r0,-47r83,0r0,163r42,-25r-26,0r0,-48r101,0r0,48v-24,-2,-39,4,-51,13r50,72r15,0r0,47r-58,0r-61,-86r-12,9r0,30r25,0r0,47","w":232},"Y":{"d":"101,-206v12,21,24,45,33,68v7,-21,23,-47,33,-68r-19,0r0,-46r96,0r0,46r-19,0r-67,117r0,42r21,0r0,47r-116,0r0,-47r21,0r0,-42r-70,-117r-18,0r0,-46r124,0r0,46r-19,0","w":240,"k":{"a":22,"s":22,"y":11,"r":22,"u":14,"o":29,"e":22}},"1":{"d":"26,-165r-17,-39v21,-10,37,-17,63,-48r64,0r0,204r34,0r0,48r-144,0r0,-48r36,0r0,-133","w":178},"2":{"d":"191,-177v3,66,-86,85,-111,129r63,0r0,-29r60,0r0,77r-194,0r0,-52v20,-32,31,-42,53,-61v27,-22,63,-39,63,-61v0,-42,-63,-19,-74,4r-39,-41v45,-66,174,-61,179,34","w":212},"3":{"d":"189,-75v0,92,-146,101,-184,39r37,-38v16,24,78,38,80,-4v1,-29,-28,-28,-57,-27r0,-43v27,1,57,1,57,-24v0,-41,-53,-33,-74,-7r-35,-42v13,-14,44,-35,77,-35v84,0,118,86,66,122v12,8,33,27,33,59","w":194},"4":{"d":"4,-71r0,-51r103,-130r75,0r0,142r19,0r0,39r-19,0r0,23r19,0r0,48r-116,0r0,-48r22,0r0,-23r-103,0xm54,-110r53,0r0,-66","w":210},"5":{"d":"202,-86v0,104,-154,114,-197,47r40,-41v19,32,88,39,90,-9v2,-37,-56,-45,-71,-18r-46,-21r22,-124r143,0r0,54r-97,0r-6,35v52,-26,122,6,122,77","w":207},"'":{"d":"13,-252r71,0r-13,107r-45,0","w":98},",":{"d":"39,70r-41,-24v26,-32,38,-63,34,-117r66,18v1,46,-22,90,-59,123","w":97},":":{"d":"45,3v-51,0,-53,-77,0,-79v54,2,54,80,0,79xm45,-107v-50,0,-54,-76,0,-78v53,1,55,79,0,78","w":91},"6":{"d":"197,-227r-25,47v-12,-7,-30,-19,-52,-19v-27,0,-44,22,-48,49v45,-39,132,-9,132,62v0,48,-34,89,-93,91v-59,2,-103,-40,-105,-112v-1,-48,11,-144,106,-147v24,-1,64,11,85,29xm110,-116v-17,0,-31,13,-37,20v0,18,11,43,34,43v37,2,46,-63,3,-63","w":209},"7":{"d":"5,-180r0,-72r195,0r0,48r-97,204r-77,0r96,-204r-59,0r0,24r-58,0","w":203},"8":{"d":"101,5v-96,0,-128,-101,-57,-142v-56,-40,-20,-119,59,-119v84,0,113,88,56,120v69,40,34,141,-58,141xm89,-108v-29,12,-26,63,12,62v18,0,33,-10,33,-30v0,-25,-28,-31,-45,-32xm112,-164v25,-8,20,-49,-10,-47v-14,0,-26,11,-26,23v0,20,24,24,36,24","w":201},"9":{"d":"13,-25r24,-47v28,23,102,30,97,-31v-43,43,-129,7,-129,-62v0,-48,35,-89,94,-91v59,-2,105,41,107,113v1,55,-13,143,-108,146v-24,1,-64,-10,-85,-28xm99,-136v17,0,28,-14,34,-21v0,-18,-7,-42,-30,-42v-38,0,-48,63,-4,63","w":211},"-":{"d":"9,-62r0,-48r104,0r0,48r-104,0","w":122},";":{"d":"62,-100v-52,-1,-55,-78,0,-80v53,1,55,81,0,80xm2,46r41,24v37,-33,60,-77,59,-123r-66,-18v4,54,-8,85,-34,117","w":108},"=":{"d":"9,-62r0,-48r148,0r0,48r-148,0xm9,-141r0,-48r148,0r0,48r-148,0","w":166},"0":{"d":"109,4v-60,0,-104,-42,-104,-131v0,-76,42,-129,102,-129v71,0,103,51,103,131v0,80,-36,129,-101,129xm109,-51v17,0,29,-30,29,-74v1,-91,-60,-98,-61,-2v0,46,18,76,32,76","w":215},"!":{"d":"10,-37v0,-18,15,-38,41,-38v26,0,43,17,43,38v0,20,-17,37,-43,37v-23,0,-41,-18,-41,-37xm31,-93v-11,-49,-23,-96,-19,-159r86,0v4,64,-8,111,-20,159r-47,0","w":110},"(":{"d":"94,-293r37,38v-17,21,-56,65,-56,143v0,80,35,124,56,149r-37,38v-39,-35,-85,-105,-85,-187v0,-85,55,-155,85,-181","w":139},")":{"d":"9,-255r37,-38v30,26,85,96,85,181v0,82,-46,153,-85,188r-37,-39v21,-25,55,-69,55,-149v0,-78,-38,-122,-55,-143","w":139},"\"":{"d":"13,-252r69,0r-11,107r-45,0xm100,-252r69,0r-13,107r-45,0","w":181},"$":{"d":"81,-279r50,0r0,37v8,4,16,10,21,18r2,-20r53,0r0,84r-55,0v0,-25,-17,-40,-40,-40v-9,0,-22,6,-22,18v0,35,122,28,122,108v0,53,-44,69,-81,70r0,37r-50,0r0,-47v-6,-4,-13,-9,-19,-14r-4,22r-53,0r0,-87r57,0v0,29,29,35,43,35v10,0,27,-3,27,-18v0,-27,-117,-22,-117,-103v0,-48,36,-68,66,-70r0,-30","w":217},"%":{"d":"257,0v-43,0,-74,-29,-74,-75v0,-44,36,-73,73,-73v47,0,74,30,74,75v0,42,-27,73,-73,73xm80,-110v-43,0,-75,-29,-75,-75v0,-44,36,-73,73,-73v47,0,74,29,74,74v0,42,-26,74,-72,74xm109,0r-41,0r156,-252r41,0xm237,-75v0,53,40,56,39,2v1,-50,-39,-56,-39,-2xm80,-143v11,0,18,-16,18,-41v1,-50,-39,-55,-39,-1v0,26,12,42,21,42","w":335},"\/":{"d":"53,29r-51,-1r134,-299r51,0","w":188},"+":{"d":"188,-157r0,47r-66,0r0,66r-47,0r0,-66r-66,0r0,-47r66,0r0,-66r47,0r0,66r66,0","w":196},"<":{"d":"13,-122r0,-45r154,-64r18,44r-110,42r110,43r-18,44","w":197},">":{"d":"185,-167r0,45r-155,63r-17,-44r110,-42r-110,-42r17,-44","w":197},"&":{"d":"99,5v-103,-1,-132,-108,-42,-152v-50,-33,-24,-109,50,-109v94,0,98,93,38,114r33,33v9,-16,15,-33,19,-48r77,0r0,46r-35,0v-6,17,-13,30,-21,42v12,10,17,26,43,22r0,47r-53,0r-24,-23v-19,18,-51,28,-85,28xm71,-76v0,37,47,32,72,12v-17,-14,-29,-33,-48,-45v-10,6,-24,20,-24,33xm128,-194v0,-10,-6,-22,-21,-22v-11,0,-18,11,-18,20v0,29,39,37,39,2","w":277},"A":{"d":"291,-47r0,47r-144,0r0,-47r34,0r-8,-25r-74,0r-7,25r28,0r0,47r-115,0r0,-47r25,0r48,-158r-14,0r0,-47r138,0r64,205r25,0xm136,-193r-23,78r47,0","w":296},"|":{"d":"36,-252r48,0r0,325r-48,0r0,-325","w":119},"_":{"d":"9,0r0,-30r234,0r0,30r-234,0","w":251},"*":{"d":"136,-142r-33,25r-28,-40r-30,41r-32,-26r31,-34r-42,-15r15,-35r41,19r-5,-45r44,0r-6,46r41,-20r15,35r-44,15","w":148},"^":{"d":"82,-252r52,0r77,143r-64,0r-39,-81r-40,81r-64,0","w":214},"#":{"d":"25,-156r0,-49r56,0r17,-66r47,0r-17,66r48,0r17,-66r48,0r-17,66r41,0r0,49r-53,0r-11,41r44,0r0,49r-56,0r-17,66r-47,0r16,-66r-48,0r-17,66r-47,0r16,-66r-40,0r0,-49r53,0r10,-41r-43,0xm116,-156r-11,41r49,0r10,-41r-48,0","w":270},"\u00a0":{"w":90}}});
var mapView;var objectsNotApproved;var lostandfoundNotApproved;var eventsList;var tmpLatLng;var tmpIcon;var tmpTitle;var authHtml;$(document).ready(function(){reselect($("#searchTypeSelect"),'searchTypeSelect',null,'searchTypeSelectDivWrapper')
$("#add_place_toggable div.tab").click(function(){mapView.reset();$("#add_place_toggable div.tab").attr('class','tab');$(this).attr('class','tab active');$("#add_place_toggable span").hide();$("#"+$(this).attr('tab')).show();});$("#lostandfound").click(function(){addType=2;mapView.reset();lostandfoundNotApproved.displayObjects()});$("#tab_add_events").click(function(){addType=3
mapView.reset();eventsList.displayObjects()})
$("#routesAdd").click(function(){$.ajax({url:'/route/getNotApproved',cache:true,dataType:"json",success:function(data){$("#waiting_approve_routes").html('')
$(data).each(function(i,item){$("#waiting_approve_routes").append('<p class="right_menu_item">\
          <a href="javascript:void(0)" routeid="'+item.id+'"><b><u>'+item.title+"</u></b></a><br />"+item.address+"</p>");});$("#waiting_approve_routes a").click(function(){$(this).parent().css('background','#339900');$("#waiting_approve_routes a").not($(this)).each(function(){$(this).parent().css('background','none');});mapView.reset()
$('#left_panel').html('');poly.getRouteWaypoints($(this).attr('routeid'))
poly.getInfo()});}});});$("#tab_add_objects").click(function(){addType=1;mapView.reset();objectsNotApproved.displayObjects()});$("#add_place").click(function(){if($("#add_place_toggable").css('display')=='none'){addType=1;mapView.reset();objectsNotApproved.displayObjects()}
$(".soortkiezer").not("#add_place_toggable").not("#left_panel").hide(600);$("#add_place_toggable").toggle(600);})
$("#main_info").click(function(){$(".soortkiezer").not("#main_info_toggable").not("#left_panel").hide(600);$("#main_info_toggable").toggle(600);addType=0;})
$("#busSearch, #busSearchMenu").click(function(){if($("#busSearchToggable").css('display')=='none'){routesLoadList()
mapView.markersSetVisible(true)}else{mapView.reset();}
$(".soortkiezer").not("#busSearchToggable").not("#left_panel").hide(600);$("#busSearchToggable").toggle(600);$("#left_panel").hide(600)
addType=0;})
$("#newRouteAdd").click(function(){mapView.newRoute();});var myLatA=myLat;var myLngA=myLng-0.025;Map.onSearchDataLoaded=proccessRouteSearch;mapView=new Map(myLatA,myLngA,myLat,myLng);$("#cityRouteSelect").change(function(e){var id=$(this).find('option:selected').attr('routeid')
mapView.reset()
poly.getRouteWaypoints(id)
$("#left_panel").html('')
poly.getInfo()});var options=new URIWorker().parseURL();if(options.get('city')){city_id=options.get('city')}
if(options.get('module')=='place'){var geoObject=new GeoLocationObject(options.get('id'),null,null,'object');geoObject.showInfo(true)}
if(options.get('module')=='cat'){doCatSearch(options.get('id'),catObjectList)}
var addType=0;objectsNotApproved=new GeoLocationObjectList(this.map,$("#waiting_approve_objects"));objectsNotApproved.onAddFormClose=function(){addType=1}
lostandfoundNotApproved=new GeoLocationObjectListLostAndFound(this.map,$("#lostandfound_objects"));lostandfoundNotApproved.url='/lostandfound'
lostandfoundNotApproved.onAddFormClose=function(){addType=2}
eventsList=new GeoLocationObjectList(this.map,$("#events_objets"));eventsList.url='/event';eventsList.onAddFormClose=function(){addType=3}
google.maps.event.addListener(mapView.map,'click',function(event){if(addType==1){addType=0;objectsNotApproved.showAddForm(mapView,event.latLng,"/object/new");$("#left_panel").hide(600)}else if(addType==2){addType=0;lostandfoundNotApproved.showAddForm(mapView,event.latLng,"/lostandfound/new");}else if(addType==3){addType=0;eventsList.showAddForm(mapView,event.latLng,"/event/new");}});setCity()
$(document).ajaxStart(function(){ajax_load()});$(document).ajaxComplete(function(){ajax_finished()});$(document).ajaxError(function(event,xhr){if(xhr.status==401){$.colorbox.close()
setTimeout("$.colorbox({html: generateAuthHtml()})",500)}else if(xhr.status==500){alert("Оопс. Что-то пошло не так. Пожалуйста сообщите нам об ошибке, если она повторяется.");}
ajax_finished()});});
function setroute2(os,poly)
{for(var i=0;i<os.length;i++){waypoint=os[i]['Waypoint']
var latlng=new google.maps.LatLng(waypoint['lat'],waypoint['lng'])
var marker=poly.addMarker(latlng,true);if(waypoint['type_id']==0){marker.setIcon(waypointIcon)}else{marker.setIcon(stopOverIcon)}}}
var poly;var poly2;var map;var isDeleting=false;var waypointIcon=new google.maps.MarkerImage('/images/waypoint_icon.png')
var stopOverIcon=new google.maps.MarkerImage('/images/stopover.png');function initialize(){directionsDisplay=new google.maps.DirectionsRenderer();var myLatlng=new google.maps.LatLng(43.25,76.92);var myOptions={zoom:12,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP}
map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);directionsDisplay.setMap(map);directionsDisplay.setPanel(document.getElementById("directionsPanel"));mapView.reset()
google.maps.event.addListener(map,'click',addLatLng);}
function addLatLng(event){poly.addMarker(event.latLng,true)}
function ajax_load()
{$("#ajax_status").show();}
function ajax_finished()
{$("#ajax_status").hide();}
function save()
{save_waypoints($('#city_id').val(),$('#new_route_number').val())}
var data={};function fetchdata()
{poly.setMap(null)
var polyOptions={strokeColor:'#003DF5',strokeOpacity:1.0,strokeWeight:3}
poly=new google.maps.Polyline(polyOptions);poly.setMap(map);load_waypoints(document.getElementById('type_id').selectedIndex,$('#number').val(),$('#city_id').val())}
function getRoutes()
{$("#number").empty()
$.ajax({url:'/route/get_routes?city_id='+$('#city_id').val()+'&type_id='+$('#type_id').val(),dataType:"json",async:false,success:function(data){$.each(data,function(key,val){$("#number").append('<option value="'+val.number+'">'+val.number+'</option>')});}});}
function save_waypoints(city_id,number)
{var markers=[]
for(var i=0;i<map.getMarkers().length;i++){marker=map.getMarkers()[i]
if(marker&&marker.getPosition()){markers.push([marker.getPosition(),marker.getIcon()==stopOverIcon?'stopover':'waypoint'])}}
var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/save');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('&path='+JSON.stringify(poly.getPath())+'&waypoints='+JSON.stringify(markers)+'&city_id='+city_id+'&type_id='+document.getElementById('type_id').selectedIndex+'&number='+number)
jax.onreadystatechange=function(){if(jax.readyState==4){if(jax.responseText.indexOf('bien')+1)alert('Updated');else alert(jax.responseText)}}}
function load_waypoints(type_id,number,city_id)
{var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/load');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('city_id='+city_id+'&type_id='+type_id+'&number='+number)
jax.onreadystatechange=function(){if(jax.readyState==4){setroute2(eval('('+jax.responseText+')'),poly);}}}
function deleteStop(latlng){var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/deletestop');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('latlng='+JSON.stringify(latlng))
jax.onreadystatechange=function(){if(jax.readyState==4){}}}
function markerMove(startPos,endPos){var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/movermarker');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('startpos='+JSON.stringify(startPos)+'&endpos='+JSON.stringify(endPos))
jax.onreadystatechange=function(){if(jax.readyState==4){}}}
function changeMarkerType(pos,type){var jax=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');jax.open('POST','/route/changemarkertype');jax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');jax.send('pos='+JSON.stringify(pos)+'&type='+type)
jax.onreadystatechange=function(){if(jax.readyState==4){}}}
var myLat=null;var myLng=null;;var myLatA=null;;var myLngA=null;;var mapWidget=null;var map;var mapView;var gLocalSearch;var gCurrentResults=[];var gInfoWindow;var isAuthenticated=false;var recommendationsCurType=null;var carouselInstance;function loadjscssfile(filename,filetype){if(filetype=="js"){var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src",filename)}
else if(filetype=="css"){var fileref=document.createElement("link")
fileref.setAttribute("rel","stylesheet")
fileref.setAttribute("type","text/css")
fileref.setAttribute("href",filename)}
if(typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref)}
function hasPosition(position){myLatA=position.coords.latitude
myLngA=position.coords.longitude
mapWidget=new MapWidget(myLatA,myLngA,myLat,myLng)
mapWidget.search()}
function initWidget(la,lg){myLat=la
myLng=lg
if(navigator.geolocation){navigator.geolocation.getCurrentPosition(hasPosition);}else{myLatA=myLat;myLngA=myLng-0.025;mapWidget=new MapWidget(myLatA,myLngA,myLat,myLng)
mapWidget.search()}}
function loadSelectedRoutes(option){var id=option.attr('id')
ajax_load()
mapView.reset()
poly.setRouteId(id)
getRouteWaypoints(id,poly)
if(option.attr('type')=="2"){var id2=option.attr('id2')
poly2.setRouteId(id2)
getRouteWaypoints(id2,poly2)}
ajax_finished()}
function getFirstItemInObject(obj){for(var i in obj){return obj[i];}}
function unselectMarkers(){for(var i=0;i<gCurrentResults.length;i++){gCurrentResults[i].unselect();}}
function doSearch(){var query=document.getElementById("queryInput").value;gLocalSearch.setCenterPoint(mapView.map.getCenter());gLocalSearch.execute(query);}
function setCity(){lat=parseFloat($("#citySelect option:selected").attr('lat'));lng=parseFloat($("#citySelect option:selected").attr('lng'));mapView.fromMarker.setPosition(new google.maps.LatLng(lat,lng));mapView.toMarker.setPosition(new google.maps.LatLng(lat,lng+0.025));mapView.map.setCenter(new google.maps.LatLng(lat,lng));city_id=$("#citySelect option:selected").attr('cityid');mapView.setCityId(city_id)}
function routesLoadList(){$("#cityRouteSelect").empty()
$.ajax({url:"/route/get_routesall/city_id/"+city_id,cache:true,dataType:"json",success:function(data){$(data).each(function(key,val){if(val.type_id==0)var type='Автобус'
if(val.type_id==1)var type='Троллейбус'
if(val.type_id==2)var type='Трамвай'
if(val.type_id==3)var type='Метро'
$("#cityRouteSelect").append('<option routeid="'+val.id+'" value="'+val.number+'">'+val.number+' - '+type+'</option>')});}});}
function extend(Child,Parent){var F=function(){}
F.prototype=Parent.prototype
Child.prototype=new F()
Child.prototype.constructor=Child
Child.superclass=Parent.prototype}
function doGeoObjectSearch(url,list)
{url='/search.php?city_id='+city_id+'&q='+$("#searchInput").val()
var list=new GeoLocationObjectList(mapView);$.ajax({url:encodeURI(url),cache:true,dataType:"json",success:function(json){mapView.reset();$("#search_results_info").html('')
if(json.corrected){$("#search_results_info").html('<p><i>возможно вы имели ввиду <b>'+json.corrected+'</b></i></p>')}
list.proccessJSON(json.data,$("#search_results"))
if(!$('#main_info_toggable').is(':visible'))$('#main_info').click()}});}
function oauth_login(token,checkAuthorization){if(checkAuthorization){var url='/isAuthenticated.php'}else{var url='/profile/oauthLogin/token/'+token}
$.ajax({url:url,dataType:"json",async:true,success:function(data){if(data.id){isAuthenticated=true;$("#home_menu_toggable").hide()
$("#home_menu #top").html('<a href="#" style="position:absolute;color:white;left:50px;text-decoration:underline;">'+data.nickname+'</a> \
    <img style="position:absolute;left:5px;top:4px;" src="/uploads/avatar/thumbnail_24/'+data.id+'.jpg" />')
$('#uLoginLeft').html('')
$("#uLogin").html($("#authorizedMenu").html());var onclick="$.colorbox({href: 'http://kz-city.info:3000/profile/show?session="+$.cookie('symfony')+"&user_id="+data.id+"'});";$("#uLogin").prepend('<div onclick="'+onclick+'"><a href="javascript:void(0)">мой профиль</a></div>');$("#footer_bottom_panel").animate({height:25},{duration:300,complete:function(now,fx){$(window).resize()}})
$("#endtour").click()
$.colorbox.close()}else{}}});}
function showGreetingColorbox(){$.colorbox({html:$("#greeting-colorbox").html(),onComplete:function(){function like(value){var li=$("#carousel-single-image .touchcarousel-item").get(carouselInstance.getCurrentId())
var id=$(li).attr('itemid');greetingSelectIds.push(new Array(id,value))
if(carouselInstance.getCurrentId()+1==carouselInstance.numItems){showRecommendationsForUser(0,true);$.colorbox.close();showTooltip()}else{carouselInstance.next()}}
carouselInstance=$("#carousel-single-image").touchCarousel({pagingNav:true,scrollbar:false,directionNavAutoHide:false,itemsPerMove:1,loopItems:true,directionNav:false,autoplay:false,autoplayDelay:2000,useWebkit3d:true,transitionSpeed:400,}).data("touchCarousel");$("#buttonNotInterested").click(function(){like(-1)})
$("#buttonSkip").click(function(){like(0)})
$("#buttonInterested").click(function(){like(1)})}})}
function showTooltip(){var $tourcontrols='<div id="tourcontrols" class="tourcontrols">';$tourcontrols+='<p><a href="javascript:void(0)" onclick="$.colorbox({html: generateAuthHtml()});$(\'#tourcontrols\').remove()">Зарегистрируйтесь</a> для сохранения рекомендаций и отслеживания новостей о событиях.</p>';$tourcontrols+='<a id="restarttour" style="display:none;">Перезапустить</span>';$tourcontrols+='<a id="endtour" style="display:none;">Закончить</a>';$tourcontrols+='<span class="close" id="canceltour" onclick="$(\'#tourcontrols\').remove()"></span>';$tourcontrols+='</div>';$('BODY').prepend($tourcontrols);$('#tourcontrols').css('bottom','130px')
$('#tourcontrols').animate({'right':'30px'},500);}
function generateAuthHtml(){random=Math.random()
authHtml='<div style="width:300px;height:100px;">\
      <b style="font-size:12px;">Войдите через сервис на котором Вы уже зарегистрированы.</b><br /><br />\
     <div id="uLoginColorBox'+random+'"></div><br />\
 <script>\
 var url  = "&display=panel"+\
      "&fields=email,nickname"+\
      "&providers=vkontakte,mailru,yandex,facebook,google,twitter"+\
      "&redirect_uri=http://kz-city.info/ulogin_xd.html"+\
      "&callback=oauth_login";\
 uLogin.init("id=uLoginColorBox'+random+'"+url)\
 </script>\
 </div>';return authHtml}
function showRecommendedUser(){}
function showRecommendationsForUser(type,visible){$('#footer_bottom_panel .menu-div').css('background','none')
$('#footer_bottom_panel .menu-div').find('a').css('color','#777')
if($("#carousel_panel").height()==0||visible==true||recommendationsCurType!=type){$('#recommendationsDivType'+type).css('background','#d0441b')
$('#recommendationsDivType'+type).find('a').css('color','white')
ids=isAuthenticated?null:greetingSelectIds
if(type=='NewUsers'){showBottomPanelNewUsers()}else{loadRecommendations(type,ids)}
recommendationsCurType=type
recommendationsPanelShow(true)}else{recommendationsPanelShow(visible)}}
function showBottomPanelNewUsers(){$('#carousel_panel').html('')
$('#carousel_panel').html($('#NewUsers').html())
var tmpEvent;$("#carousel_panel #carousel-gallery ul li a").mousedown(function(event){tmpEvent=event;});$("#carousel_panel #carousel-gallery ul li a").mouseup(function(event){if(tmpEvent.pageX==event.pageX){var user_id=$(this).attr('user_id')
$.colorbox({href:'http://kz-city.info:3000/profile/show?session='+$.cookie('symfony')+'&user_id='+user_id});}})
$("#carousel_panel #carousel-gallery").touchCarousel({autoplay:false,autoplayDelay:2000,dragUsingMouse:true,itemsPerPage:1,itemsPerMove:3,scrollbar:false,scrollbarAutoHide:true,scrollbarTheme:"dark",pagingNav:false,snapToItems:false,scrollToLast:true,useWebkit3d:true,loopItems:true});}
function recommendationsPanelShow(visible){var panelHeight=95
$("#carousel_panel").animate({height:($("#carousel_panel").height()==panelHeight&&!visible)?0:panelHeight},{duration:600,step:function(now,fx){$(window).resize()},complete:function(){leftPanelScrollbar(0)}})}
function recommendationsLike(id,like){$.ajax({url:'/user_recommendations.php?object_id='+id+'&like='+like,dataType:'xml',success:function(xmlData){}})
$("#touchcarousel_item"+id).fadeOut(450)}
function loadRecommendations(type,ids){url='/user_recommendations.php?type='+type+'&city_id='+city_id
$.ajax({url:url,dataType:'xml',success:function(xmlData){$("#carousel_panel").html('<div id="carousel-image-text-horizontal" class="touchcarousel">\
    <ul class="touchcarousel-container"></ul></div>')
data=xmlrpc(xmlData)
$(data).each(function(i,row){var image=row.get('image')?'/uploads/objects/thumbnail/'+row.get('image'):'/uploads/nophoto.gif'
var title=row.get('title')
title=title.length<=19?title:title.substr(0,16)+'...'
var a='<a href="#" title="'+row.get('title').replace('"','&quot;')+'" \
       style="color:#777" onclick="new GeoLocationObject('+row.get('id')+', null,null,\'/object\').showInfo(true)">'
var html='<li class="touchcarousel-item" id="touchcarousel_item'+row.get('id')+'">\
      '+a+'<img src="'+image+'" width="60" height="60" /></a>\
      <div class="rblock">\
       <h4>'+a+'\
       '+title+'</a></h4>\
       <p><a href="javascript:void(0);" onclick="recommendationsLike('+row.get('id')+', 1)">мне нравится</a> <br />\
       <a href="javascript:void(0);"  onclick="recommendationsLike('+row.get('id')+', -1)">мне это не интересно</a></p>\
      </div>\
     </li>'
$("#carousel-image-text-horizontal .touchcarousel-container").append(html)})
$("#carousel-image-text-horizontal").touchCarousel({itemsPerMove:5,pagingNav:false,scrollbar:false,scrollToLast:false,loopItems:false});}});}
function menuSlideToggle(object,catid){var borderClass='active'
var isSameItem=$(object).attr('class')==borderClass
animationTime=0;$('#menuCats').slideUp(200,function(){if(!isSameItem){$("#catCroudes a:first").click()
setTimeout('$("#catsLink_'+catid+'").click()',1)
$('#menuCats').slideDown(200,function(){animationTime=600;})}})
$("#menuLinksPanel a").each(function(){$(this).attr('class','not-active');})
if(!isSameItem){$(object).attr('class',borderClass);}}
function xmlrpc(xmlData){values=new Array();$(xmlData).find('struct').each(function(i,struct){rowDict=new Dict();$(struct).find('member').each(function(i,member){rowDict.set($(member).find('name').text(),$(member).find('value').text())})
values.push(rowDict)})
return values}
function leftPanelScrollbar(timeout){setTimeout("$('#scrollpane').jScrollPane({reinitialiseOnImageLoad: true});$('.jspVerticalBar').css('left', '0px')",timeout);}
