var Site = {
	init : function() {
		this.tabs();	
	},
	
	tabs : function() {
		var tabs = $('#secondary > .tabs'),
			uls = tabs.find('> ul'),
			tabHeadings = tabs.next('#tabHeadings');
			
		// listen for heading clicks
		tabHeadings
			.delegate('a', 'click', function(e) {
				var a = $(this),
					hash;
			
				// change the selected class to the selected one
				a
					.siblings()
						.removeClass('selected')
					.end()
					.addClass('selected');
					
				// grab the hash of the anchor
				hash = a.attr('href');
				
				// show corresponding section
				uls
					.hide()
					.filter(hash)
						.fadeIn(500);
						
				e.preventDefault();
			});
		
	}
}


function validate()
	{
		if (document.contactform.name.value =="")
	    {
			alert("Name can't be left blank!");
			return false;
		}
				if (document.contactform.email.value =="" || (document.contactform.email.value.search("@") == -1 ||( document.contactform.email.value.search("com") == -1 && document.contactform.email.value.search("net") == -1 && document.contactform.email.value.search("au") == -1 && document.contactform.email.value.search("org") == -1)))
	    {
			alert("Please enter a valid email address!");
			return false;
		}
		
		if (document.contactform.subject.value =="")
	    {
			alert("Subject can't be left blank!");
			return false;
		}
		
		if (document.contactform.message.value =="")
	    {
			alert("Please enter a comment or question!");
			return false;
		}	
		document.contactform.submit();
	}
	
	
// Let's roll!
Site.init();
