
var isSinglePostView = function() {
    var loc = document.baseURI;
    var re = new RegExp(".*blog.rasterboy.com/private/380549748/tumblr_kxlgfrANmn1qb2s5b*");
    return loc.match(re) != null;
}


$(window).ready(function() {
	// do stuff when DOM is ready
	if (isSinglePostView()) {
        var cform = $("#contact-form");
        var post = $(".post");
        var meta = $(".meta");
        
        post.css('display', 'none');
        meta.css('display', 'none');
        cform.css('display', 'block');
    }
    
    //image rollovers
    $('.post a img').hover( function(){
		$(this).addClass("shadow");
	},
	function(){
	     $(this).removeClass("shadow");
	     
	});

	 $('.meta a img').hover( function(){
		$(this).addClass("glow");
	},
	function(){
	     $(this).removeClass("glow");
	     
	});

    
	$("#q").focus(function() {
	if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
	if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	$(".follow-twitter img").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, "fast");
		},
		function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	$(".follow-flickr img").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, "fast");
		},
		function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	$(".follow-facebook img").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, "fast");
		},
		function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	$(".follow-pixelsbyus img").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, "fast");
		},
		function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
	$(".prev, .next").fadeTo(250, .85); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	
	$(".prev").hover(
		function() {
		$(this).fadeTo(250, 1); // This should set the opacity to 100% on hover;
		},
		function() {
		$(this).fadeTo(250, .85); // This should set the opacity back to 60% on mouseout
	});
	
	$(".next").hover(
		function() {
		$(this).fadeTo(250, 1); // This should set the opacity to 100% on hover;
		},
		function() {
		$(this).fadeTo(250, .85); // This should set the opacity back to 60% on mouseout
	});


});

