function sendEmail()
{
	$.post("http://www.jackbarber.co.uk/scripts/contact.php", $("#ContactForm").serialize());
	document.getElementById('ContactText').value = '';
	document.getElementById('ContactText').style.background = "url('http://www.jackbarber.co.uk/images/textbg.jpg')";
	alert('Thank you.  Your message has been sent.');
}

function sendEmail2()
{
	$.post("http://www.jackbarber.co.uk/scripts/contact.php", $("#ContactForm").serialize());
	document.getElementById('ContactTextWide').value = '';
	document.getElementById('ContactTextWide').style.background = "url('http://www.jackbarber.co.uk/images/textbgwide.jpg') no-repeat #fff";
	alert('Thank you.  Your message has been sent.');
}

function sendComment()
{
	pHuman = document.getElementById('Human').value;
	
	if(pHuman == '7')
	{
		$.post("http://www.jackbarber.co.uk/scripts/comment.php", $("#CommentForm").serialize());
		document.getElementById('CommentFormArea').style.display = 'none';
		alert('Thank you.  Your comment has been sent.');
	}
	else
	{
		alert('Please check the answer to the sum');
	}
}

function PaleBG()
{
	document.getElementById('ContactText').style.background = "url('http://www.jackbarber.co.uk/images/textbg2.jpg')";
}

function BoldBG()
{
	pContact = document.getElementById('ContactText').value
	if(pContact=='')
	{
		document.getElementById('ContactText').style.background = "url('http://www.jackbarber.co.uk/images/textbg.jpg')";
	}
}

function PaleBGWide()
{
	document.getElementById('ContactTextWide').style.background = "url('http://www.jackbarber.co.uk/images/textbgwide2.jpg') no-repeat #fff";
}

function BoldBGWide()
{
	pContact = document.getElementById('ContactTextWide').value
	if(pContact=='')
	{
		document.getElementById('ContactTextWide').style.background = "url('http://www.jackbarber.co.uk/images/textbgwide.jpg') no-repeat #fff";
	}
}

$(function(){
    $('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;
            }
        }
    });
});