// JavaScript Document

$(document).ready(function() {
	$("#search-articles").focus(function() {
		if($(this).val() == "Search..." || $(this).val() == "") {
			$(this).val("");	
		}
	});
	$("#search-articles").blur(function() {
		if($(this).val() == "") {
			$(this).val("Search...");	
		}
	});
	
	$("a[rel*='external']").click(function() {
		window.open(this.href);
		return false;					 
	});	
	
	$(".work_wrapper > li:nth-child(even)","#content").css({'padding-right' : '0px' });	
	$(".work_wrapper > li:last-child","#content").width("530px");
	$(".work_wrapper > li:last-child li","#content").css("padding","0px");
	
	$("input[type='submit']","#quick-contact").click(function() {
		if($("#name").val() == '' || $("#email").val() == '' || $("#message").val() == '') {			
			$('#basic-modal-content-error').modal();
		}
		else {			
			$.post($("#quick-contact").attr("action"), $("#quick-contact").serialize() );
			$(':input, :textarea','#quick-contact')
				.not(':button, :submit, :reset, :hidden')
				.val('')
				.removeAttr('checked')
				.removeAttr('selected');	
			$('#basic-modal-content').modal();
		}
		return false;			  
	});
	
	$(".aside ol li span").remove();
});