﻿/* jQuery for Oroza */
/* Authors: Colin MacDonald and Christopher Hoult*/
 
$(document).ready(function(){
   
	/* Contact Form Input defaults */
	
	$(".contact form input, .contact form textarea").focus(function(){
		if($(this).val() == $(this).attr("title")){
			$(this).val("");
		}
	});
	$(".contact form input, .contact form textarea").blur(function(){
		if($(this).val() == ""){
			$(this).val($(this).attr("title"));
		}
	});
	
	
	/* Contact Form Button */
	$(".contact form .submit, #blog #sidebar .submit, #blog #posts .comment .submit").bind("focus, mouseover",function(){
		$(this).css("background-position","0 -42px");
	});
	$(".contact form .submit, #blog #sidebar .submit, #blog #posts .comment .submit").bind("blur, mouseout",function(){
		$(this).css("background-position","0 0");
	});
	
	/* Smooth Anchor Scroll */
	$('a[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;
				$('html,body').animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});
   
});
