$(document).ready(function() {
	if($("#search #query").length) {
		if($("#search #query").val() == '') {
			$("#search #query").val('Search');
		}
		$("#search #query").focus(function(){
			if (this.value == 'Search') {
				this.value='';
			}
		});
		
		$("#search #query").blur(function(){
			if (this.value == '') {
				this.value='Search';
			}
		});
	}

	$("#socialLinks img")
		.mouseover(function() {
            var src = $(this).attr("src").match(/[^\.]+/) + "over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("over", "");
            $(this).attr("src", src);
	});

	if($('#slideshow').length > 0) {
		if(photos[0]['image'] != '') {
		$('#slideshow').cycle({
			fx:     'fade',
			speed:   400,
			timeout: 5000,
			pager:  '#pager',
			pause: true,
			pagerAnchorBuilder: function(idx, slide) {
				// return sel string for existing anchor
				return '#pager li:eq(' + (idx) + ') a';
			}
		});
		}
	}
});
