$(function(){
	$('.checkall').click(function(){
		$(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
	});
	$('.search').click(function(){
		search();
	});
	$('input[name=cat_id]').click(function(){
		$('.search_subcat').css('display','none');
		$('#sub-'+this.value).css('display','block');
	});
	$(".calendar").glDatePicker();
	if(document.getElementById('search')){
		var url = window.location.href;
		var uids = url.replace(/.*ids=(.*)&loc=(.*)/, "$1").split(",");
		var uloc = url.replace(/.*ids=(.*)&loc=(.*)/, "$2").split(",");
		var u,id;
		var dosearch = false;
		if(document.getElementById('search').elements['ids[]']){
			var ids = document.getElementById('search').elements['ids[]'];
			for(id=0;id<ids.length;id++){
				for(u=0;u<uids.length;u++){
					if(uids[u] == ids[id].value) ids[id].checked = dosearch = true;
				}
			}
		}
		if(document.getElementById('search').elements['locs[]']){
			var loc = document.getElementById('search').elements['locs[]'];
			for(id=0;id<loc.length;id++){
				for(u=0;u<uloc.length;u++){
					if(uloc[u] == loc[id].value) loc[id].checked = dosearch = true;
				}
			}
		}
		if(dosearch) search();
	}
});
function search(){
	$('#results').html = '<div class="box print"><h1>Search Results</h1><p style="padding:20px;text-align:center">Loading</p></div>';
	var ids = [];
	$("input[name=ids\\[\\]]:checked").each(function(){if($(this).val()!='false') ids.push($(this).val());});
	var locs = [];
	$("input[name=locs\\[\\]]:checked").each(function(){if($(this).val()!='false') locs.push($(this).val());});
	var url = 'ids='+ids.join(',')+'&loc='+locs.join(',')+'&map='+$('#map_results').is(':checked');
	$.get('/category.php?s='+$('#s').val()+'&'+url,function(data){$('#results').html(data);});
	setTimeout('document.location="#'+url+'"',1);
}
function grabFile(file,div){
	$.get(file,function(data){$('#'+div).html(data);});
}
// Slideshow
var fadingSpeed=100;var stats=new Array();var slideIndex=new Array();var slideIndexNext=new Array();var intervalId=new Array();var imageDivs=new Array();var currentOpacity=new Array();var imagesInGallery=new Array();
function createParentDivs(imageIndex,divId){var imgObj=document.getElementById(divId+'_'+imageIndex);if(!imageDivs[divId])imageDivs[divId]=new Array();imageDivs[divId][imageDivs[divId].length]=imgObj;if(imgObj){if(0!=imageIndex)imgObj.parentNode.style.visibility='hidden';else imgObj.parentNode.style.visibility='visible';imageIndex++;createParentDivs(imageIndex,divId)}}var revealInterval=0;
function showGallery(divId,dir){if(dir==1){if(slideIndex[divId]==-1)slideIndex[divId]=0;else slideIndex[divId]=slideIndexNext[divId];if(slideIndex[divId]==imageDivs[divId].length-1)slideIndex[divId]=0;slideIndexNext[divId]=slideIndex[divId]+1;if(slideIndexNext[divId]==imageDivs[divId].length-1)slideIndexNext[divId]=0}else{if(slideIndex[divId]==-1)slideIndex[divId]=1;if(slideIndex[divId]==imageDivs[divId].length-1)slideIndex[divId]=0;else slideIndex[divId]=slideIndexNext[divId];if(slideIndex[divId]<0)slideIndex[divId]=imageDivs[divId].length-2;slideIndexNext[divId]=slideIndex[divId]-1;if(slideIndexNext[divId]<0)slideIndexNext[divId]=imageDivs[divId].length-2}currentOpacity[divId]=100;imageDivs[divId][slideIndex[divId]].parentNode.style.visibility='visible';imageDivs[divId][slideIndexNext[divId]].parentNode.style.visibility='visible';if(document.all){imageDivs[divId][slideIndex[divId]].style.filter='alpha(opacity=100)';imageDivs[divId][slideIndexNext[divId]].style.filter='alpha(opacity=1)'}else{imageDivs[divId][slideIndex[divId]].style.opacity=0.99;imageDivs[divId][slideIndexNext[divId]].style.opacity=0.01}revealImage(divId)}
function revealImage(divId){currentOpacity[divId]-=20;if(document.all){imageDivs[divId][slideIndex[divId]].style.filter='alpha(opacity='+currentOpacity[divId]+')';imageDivs[divId][slideIndexNext[divId]].style.filter='alpha(opacity='+(100-currentOpacity[divId])+')'}else{imageDivs[divId][slideIndex[divId]].style.opacity=Math.max(0.01,currentOpacity[divId]/100);imageDivs[divId][slideIndexNext[divId]].style.opacity=Math.min(0.99,(1-(currentOpacity[divId]/100)))}if(currentOpacity[divId]>0)revealInterval=setTimeout('revealImage("'+divId+'")',fadingSpeed);else imageDivs[divId][slideIndex[divId]].parentNode.style.visibility='hidden'}
function initImageGallery(divId,timeout){var galleryContainer=document.getElementById(divId);slideIndex[divId]=-1;slideIndexNext[divId]=0;var galleryImgArray=galleryContainer.getElementsByTagName('IMG');for(var no=0;no<galleryImgArray.length;no++){galleryImgArray[no].id=divId+'_'+no}imagesInGallery[divId]=galleryImgArray.length;createParentDivs(0,divId);intervalId[divId]=setInterval("showGallery('"+divId+"',1)",timeout);$("#"+divId).hover(function(){clearInterval(intervalId[divId])},function(){intervalId[divId]=setInterval("showGallery('"+divId+"',1)",timeout)})}
// Ratings
function rate(choice){
	document.comment.rating.value = choice;
	fill(choice);
}
function out(){
	fill(document.comment.rating.value);
}
function fill(choice){
	switch(choice){
case '1': document.getElementById('star-2').src = '/images/star-n.png'; document.getElementById('star-3').src = '/images/star-n.png'; document.getElementById('star-4').src = '/images/star-n.png'; document.getElementById('star-5').src = '/images/star-n.png'; break;
case '2': document.getElementById('star-2').src = '/images/star-y.png'; document.getElementById('star-3').src = '/images/star-n.png'; document.getElementById('star-4').src = '/images/star-n.png'; document.getElementById('star-5').src = '/images/star-n.png'; break;
case '3': document.getElementById('star-2').src = '/images/star-y.png'; document.getElementById('star-3').src = '/images/star-y.png'; document.getElementById('star-4').src = '/images/star-n.png'; document.getElementById('star-5').src = '/images/star-n.png'; break;
case '4': document.getElementById('star-2').src = '/images/star-y.png'; document.getElementById('star-3').src = '/images/star-y.png'; document.getElementById('star-4').src = '/images/star-y.png'; document.getElementById('star-5').src = '/images/star-n.png'; break;
case '5': default: document.getElementById('star-2').src = '/images/star-y.png'; document.getElementById('star-3').src = '/images/star-y.png'; document.getElementById('star-4').src = '/images/star-y.png'; document.getElementById('star-5').src = '/images/star-y.png';
	}
}
// glDatePicker v1.2 - http://code.gautamlad.com/glDatePicker/
(function(c){var r={calId:0,cssName:"default",startDate:-1,endDate:-1,selectedDate:-1,showPrevNext:!0,allowOld:!0,showAlways:!1,position:"absolute"},j={init:function(a){return this.each(function(){var b=c(this),e=c.extend({},r);e.calId=b[0].id+"-gldp";a&&(e=c.extend(e,a));b.data("settings",e);b.click(j.show).focus(j.show);e.showAlways&&setTimeout(function(){b.trigger("focus")},50);c(window).bind("click",function(){j.hide.apply(b)})})},show:function(a){a.stopPropagation();j.hide.apply(c("._gldp").not(c(this)));
j.update.apply(c(this))},hide:function(){if(c(this).length){var a=c(this).data("settings");a.showAlways||(c("#"+a.calId).slideUp(200),c(this).removeClass("_gldp"))}},setStartDate:function(a){c(this).data("settings").startDate=a},setEndDate:function(a){c(this).data("settings").endDate=a},setSelectedDate:function(a){c(this).data("settings").selectedDate=a},update:function(){var a=c(this),b=a.data("settings"),e=b.calId,d=b.startDate;b.startDate==-1&&(d=new Date,d.setDate(1));d.setHours(0,0,0,0);var k=
d.getTime(),f=new Date(0);b.endDate!=-1&&(f=new Date(b.endDate),/^\d+$/.test(b.endDate)&&(f=new Date(d),f.setDate(f.getDate()+b.endDate)));f.setHours(0,0,0,0);var f=f.getTime(),h=new Date(0);b.selectedDate!=-1&&(h=new Date(b.selectedDate),/^\d+$/.test(b.selectedDate)&&(h=new Date(d),h.setDate(h.getDate()+b.selectedDate)));h.setHours(0,0,0,0);var h=h.getTime(),i=a.data("theDate"),i=i==-1||typeof i=="undefined"?d:i,m=new Date(i);m.setDate(1);var r=m.getTime(),d=new Date(m);d.setMonth(d.getMonth()+1);
d.setDate(0);var w=d.getTime(),s=d.getDate(),n=new Date(m);n.setDate(0);n=n.getDate();a.data("theDate",i);for(var d="",t=0,u=0;t<6;t++){for(var v="",q=0;q<7;q++,u++){var o=n-m.getDay()+u+1,p=o-n,g=q==0?"sun":q==6?"sat":"day";if(p>=1&&p<=s){o=new Date;o.setHours(0,0,0,0);var l=new Date(i);l.setHours(0,0,0,0);l.setDate(p);l=l.getTime();g=o.getTime()==l?"today":g;b.allowOld||(g=l<k?"noday":g);b.endDate!=-1&&(g=l>f?"noday":g);b.selectedDate!=-1&&(g=l==h?"selected":g)}else g="noday",p=p<=0?o:o-s-n;v+=
"<td class='gldp-days "+g+" **-"+g+"'><div class='"+g+"'>"+p+"</div></td>"}d+="<tr class='days'>"+v+"</tr>"}h=k<r||b.allowOld;k=w<f||f<k;b.showPrevNext||(h=k=!1);f="January,February,March,April,May,June,July,August,September,October,November,December".split(",")[i.getMonth()]+" "+i.getFullYear();k=("<div class='**'><table><tr>"+("<td class='**-prevnext prev'>"+(h?"\u25c4":"")+"</td>")+"<td class='**-monyear' colspan='5'>{MY}</td>"+("<td class='**-prevnext next'>"+(k?"\u25ba":"")+"</td>")+"</tr><tr class='**-dow'><td>S</td><td>M</td><td>T</td><td>W</td><td>H</td><td>F</td><td>S</td></tr>"+
d+"</table><div>").replace(/\*{2}/gi,"gldp-"+b.cssName).replace(/\{MY\}/gi,f);c("#"+e).length==0&&a.after(c("<div id='"+e+"'></div>").css({position:b.position,"z-index":b.zIndex}));$("#"+e).css({left:a.position().left,top:a.position().top+a.outerHeight(!0)});e=c("#"+e);e.html(k).slideDown(200);a.addClass("_gldp");c("[class*=-prevnext]",e).click(function(b){b.stopPropagation();if(c(this).html()!=""){var b=c(this).hasClass("prev")?-1:1,d=new Date(m);d.setMonth(i.getMonth()+b);a.data("theDate",d);j.update.apply(a)}});c("tr.days td:not(.noday, .selected)",
e).mouseenter(function(){var a="gldp-"+b.cssName+"-"+c(this).children("div").attr("class");c(this).removeClass(a).addClass(a+"-hover")}).mouseleave(function(){if(!c(this).hasClass("selected")){var a="gldp-"+b.cssName+"-"+c(this).children("div").attr("class");c(this).removeClass(a+"-hover").addClass(a)}}).click(function(b){b.stopPropagation();var b=c(this).children("div").html(),d=a.data("settings"),e=new Date(i);e.setDate(b);a.data("theDate",e);a.val(e.getMonth()+1+"/"+e.getDate()+"/"+e.getFullYear());
if(d.onChange!=null&&typeof d.onChange!="undefined")d.onChange(a,e);d.selectedDate=e;j.hide.apply(a)})}};c.fn.glDatePicker=function(a){if(j[a])return j[a].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof a==="object"||!a)return j.init.apply(this,arguments);else c.error("Method "+a+" does not exist on jQuery.glDatePicker")}})(jQuery);
// ColorBox v1.3.19 - jQuery lightbox plugin (c) 2011 Jack Moore jacklmoore.com License: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function Z(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function $(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function _(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function ba(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function bb(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bc(b,c){a.event.trigger(b),c&&c.call(P)}function bd(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(K.loop||y[Q+1])a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function be(b){U||(P=b,bb(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1)),S||(S=T=!0,r.show(),K.returnFocus&&a(P).blur().one(l,function(){a(this).focus()}),q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=_(K.initialWidth,"x"),K.h=_(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bc(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()),W.load(!0))}function bf(){!r&&b.body&&(Y=!1,z=a(c),r=Z(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}).hide(),q=Z(X,"Overlay",o?"position:absolute":"").hide(),s=Z(X,"Wrapper"),t=Z(X,"Content").append(A=Z(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Z(X,"LoadingOverlay").add(Z(X,"LoadingGraphic")),D=Z(X,"Title"),E=Z(X,"Current"),G=Z(X,"Next"),H=Z(X,"Previous"),F=Z(X,"Slideshow").bind(h,bd),I=Z(X,"Close")),s.append(Z(X).append(Z(X,"TopLeft"),u=Z(X,"TopCenter"),Z(X,"TopRight")),Z(X,!1,"clear:left").append(v=Z(X,"MiddleLeft"),t,w=Z(X,"MiddleRight")),Z(X,!1,"clear:left").append(Z(X,"BottomLeft"),x=Z(X,"BottomCenter"),Z(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Z(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),J=G.add(H).add(E).add(F),a(b.body).append(q,r.append(s,B)))}function bg(){return r?(Y||(Y=!0,L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))}),a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),be(this))})),!0):!1}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=!a.support.opacity&&!a.support.style,o=n&&!c.XMLHttpRequest,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div",Y;if(a.colorbox)return;a(bf),W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},bf();if(bg()){if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b))}).addClass(g),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&be(f[0])}return f},W.position=function(a,b){function i(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset(),g=z.scrollTop(),h=z.scrollLeft();z.unbind("resize."+f),r.css({top:-9e4,left:-9e4}),K.fixed&&!o?(e.top-=g,e.left-=h,r.css({position:"fixed"})):(c=g,d=h,r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-_(K.right,"x"),0):K.left!==!1?d+=_(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-_(K.bottom,"y"),0):K.top!==!1?c+=_(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){i(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",K.reposition&&setTimeout(function(){z.bind("resize."+f,W.position)},1),b&&b()},step:function(){i(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=_(a.width,"x")-O-M),a.innerWidth&&(K.w=_(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=_(a.height,"y")-N-L),a.innerHeight&&(K.h=_(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Z(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function q(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p;if(!S)return;l=function(){clearTimeout(V),C.hide(),bc(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[$(-1),$(1)];while(c=y[b.pop()])o=a.data(c,e).href||c.href,a.isFunction(o)&&(o=o.call(c)),ba(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Z("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,q):q()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||bb(),bc(m),bc(i,K.onLoad),K.h=K.height?_(K.height,"y")-N-L:K.innerHeight&&_(K.innerHeight,"y"),K.w=K.width?_(K.width,"x")-O-M:K.innerWidth&&_(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=_(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=_(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Z(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):ba(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Z(X,"Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(K.loop||y[Q+1])&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Z(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(K.loop||y[Q+1])&&(Q=$(1),W.load())},W.prev=function(){!T&&y[1]&&(K.loop||Q)&&(Q=$(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bc(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bc(m),A.remove(),setTimeout(function(){U=!1,bc(l,K.onClosed)},1)}))},W.remove=function(){a([]).add(r).add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g).die()},W.element=function(){return a(P)},W.settings=d})(jQuery,document,this);
// Masked Input plugin for jQuery Copyright (c) 2007-2011 Josh Bush (digitalbush.com) Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)  Version: 1.3
(function(a){var b=(a.browser.msie?"paste":"input")+".mask",c=window.orientation!=undefined;a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn"},a.fn.extend({caret:function(a,b){if(this.length!=0){if(typeof a=="number"){b=typeof b=="number"?b:a;return this.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}})}if(this[0].setSelectionRange)a=this[0].selectionStart,b=this[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},unmask:function(){return this.trigger("unmask")},mask:function(d,e){if(!d&&this.length>0){var f=a(this[0]);return f.data(a.mask.dataName)()}e=a.extend({placeholder:"_",completed:null},e);var g=a.mask.definitions,h=[],i=d.length,j=null,k=d.length;a.each(d.split(""),function(a,b){b=="?"?(k--,i=a):g[b]?(h.push(new RegExp(g[b])),j==null&&(j=h.length-1)):h.push(null)});return this.trigger("unmask").each(function(){function v(a){var b=f.val(),c=-1;for(var d=0,g=0;d<k;d++)if(h[d]){l[d]=e.placeholder;while(g++<b.length){var m=b.charAt(g-1);if(h[d].test(m)){l[d]=m,c=d;break}}if(g>b.length)break}else l[d]==b.charAt(g)&&d!=i&&(g++,c=d);if(!a&&c+1<i)f.val(""),t(0,k);else if(a||c+1>=i)u(),a||f.val(f.val().substring(0,c+1));return i?d:j}function u(){return f.val(l.join("")).val()}function t(a,b){for(var c=a;c<b&&c<k;c++)h[c]&&(l[c]=e.placeholder)}function s(a){var b=a.which,c=f.caret();if(a.ctrlKey||a.altKey||a.metaKey||b<32)return!0;if(b){c.end-c.begin!=0&&(t(c.begin,c.end),p(c.begin,c.end-1));var d=n(c.begin-1);if(d<k){var g=String.fromCharCode(b);if(h[d].test(g)){q(d),l[d]=g,u();var i=n(d);f.caret(i),e.completed&&i>=k&&e.completed.call(f)}}return!1}}function r(a){var b=a.which;if(b==8||b==46||c&&b==127){var d=f.caret(),e=d.begin,g=d.end;g-e==0&&(e=b!=46?o(e):g=n(e-1),g=b==46?n(g):g),t(e,g),p(e,g-1);return!1}if(b==27){f.val(m),f.caret(0,v());return!1}}function q(a){for(var b=a,c=e.placeholder;b<k;b++)if(h[b]){var d=n(b),f=l[b];l[b]=c;if(d<k&&h[d].test(f))c=f;else break}}function p(a,b){if(!(a<0)){for(var c=a,d=n(b);c<k;c++)if(h[c]){if(d<k&&h[c].test(l[d]))l[c]=l[d],l[d]=e.placeholder;else break;d=n(d)}u(),f.caret(Math.max(j,a))}}function o(a){while(--a>=0&&!h[a]);return a}function n(a){while(++a<=k&&!h[a]);return a}var f=a(this),l=a.map(d.split(""),function(a,b){if(a!="?")return g[a]?e.placeholder:a}),m=f.val();f.data(a.mask.dataName,function(){return a.map(l,function(a,b){return h[b]&&a!=e.placeholder?a:null}).join("")}),f.attr("readonly")||f.one("unmask",function(){f.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){m=f.val();var b=v();u();var c=function(){b==d.length?f.caret(0,b):f.caret(b)};(a.browser.msie?c:function(){setTimeout(c,0)})()}).bind("blur.mask",function(){v(),f.val()!=m&&f.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(b,function(){setTimeout(function(){f.caret(v(!0))},0)}),v()})}})})(jQuery)
jQuery(function($){
$("#phone").mask("999-999-9999",{placeholder:" "});
$("#birthday").mask("99/99/9999",{placeholder:" "});
$("#date").mask("99/99/9999",{placeholder:" "});
});
if(document.getElementById('facebook')) (function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0]; if(d.getElementById(id)){return;} js=d.createElement(s); js.id=id; js.src="//connect.facebook.net/en_US/all.js#xfbml=1&appId=181484441896911"; fjs.parentNode.insertBefore(js,fjs); }(document,'script','facebook-jssdk'));
// Ilia Draznin http://iliadraznin.com/2011/02/jquery-placeholder-plugin/ version 1.0.3
(function(d){var g=document.createElement("input");d.extend(d.support,{placeholder:!!("placeholder"in g)});d.fn.addPlaceholder=function(g){function h(a,c){if(f(a.val())||a.val()==c)a.val(c),a.addClass(b["class"]);a.focusin(function(){a.hasClass(b["class"])&&(a.removeClass(b["class"]),a.val(""))});a.focusout(function(){f(a.val())&&(a.val(c),a.addClass(b["class"]))})}function i(a,c){a.addClass(b["class"]);var e=d("<span/>",{"class":a.attr("class")+" "+b["class"],text:c,css:{border:"none",cursor:"text", background:"transparent",position:"absolute",top:a.position().top,left:a.position().left,lineHeight:a.height()+3+"px",paddingLeft:parseFloat(a.css("paddingLeft"))+2+"px"}}).insertAfter(a);a.focusin(function(){a.hasClass(b["class"])&&(e.hide(),a.removeClass(b["class"]))});a.focusout(function(){f(a.val())&&(e.show(),a.addClass(b["class"]))});b.checkafill&&function j(){!f(a.val())&&a.hasClass(b["class"])&&a.focusin();setTimeout(j,250)}()}function f(a){return b.allowspaces?a==="":d.trim(a)===""}var b= {"class":"placeholder",allowspaces:!1,dopass:!0,dotextarea:!0,checkafill:!1};return this.each(function(){if(d.support.placeholder)return!1;d.extend(b,g);if(!(this.tagName.toLowerCase()=="input"||b.dotextarea&&this.tagName.toLowerCase()=="textarea"))return!0;var a=d(this),c=this.getAttribute("placeholder"),e=a.is("input[type=password]");if(!c)return!0;b.dopass&&e?i(a,c):e||h(a,c)})}})(jQuery);
