// JavaScript Document
$(document).ready(function(){
	$('.box').hover(showBox,hideBox).wrapInner('<div></div>');
	$('.thumb div').hide();
	$('[rel="resume"]').click(function(e){
		e.preventDefault();
		TINY.box.show({iframe:'AdamMartinezResume.pdf',boxid:'frameless',width:990,height:600,fixed:false,maskid:'mask',maskopacity:80})										 
	});
	$('input[name=uname], input[name=uemail], input[name=uphone], textarea[name=umessage]').focus(function(){
		$(this).css('color','#000');
		var val = $(this).val();
		if(val==$(this).attr('rel')){
			$(this).val('');
		}
	}).blur(function(){
		var val = $(this).val();
		if(val==''){
			$(this).val($(this).attr('rel')).css('color','#666');
		}
	}).val(function(){
		return $(this).attr('rel');
	});
});
function showBox(){
	$('div',this).show().addClass('over');
}
function hideBox(){
	var innerBox = $('div',this).removeClass('over');
	if($(this).hasClass('thumb')){
		innerBox.hide();
	}
}
function validate($form){
	error = "";
	if($('[name=uname]',$form).val() == $('[name=uname]',$form).attr('rel')){
		error += "Name is required. \n";
	}
	if($('[name=uphone]',$form).val() == $('[name=uphone]',$form).attr('rel')){
		error += "Phone is required. \n";
	}
	if($('[name=uemail]',$form).val() == $('[name=uemail]',$form).attr('rel')){
		error += "Email is required. \n";
	}
	if($('[name=umessage]',$form).val() == $('[name=umessage]',$form).attr('rel')){
		error += "Message is required. \n";
	}
	if(error==""){
		return true;
	} else {
		alert(error);
		return false;
	}
}
