<!--//
function clearText(obj){
	
	if (obj.value == obj.title){
		obj.value = ''
	}
	else if(obj.value == ''){
		obj.value = obj.title;
	}
}

$(function() {
	$('#gallery a').lightBox();
});



function request_catalog(form_id){
	var myForm = document.getElementById(form_id);
	var address2 = '';
	var error = '';
	
	if (myForm.firstname.value == '' || myForm.firstname.value == myForm.firstname.title){
		error += " - First name\n";
	}
	if (myForm.lastname.value == '' || myForm.lastname.value == myForm.lastname.title){
		error += " - Last name\n";
	}
	if (myForm.address1.value == '' || myForm.address1.value == myForm.address1.title){
		error += " - Address\n";
	}
	if (myForm.city.value == '' || myForm.city.value == myForm.city.title){
		error += " - City\n";
	}
	if (myForm.address2.value != myForm.address2.title){
		address2 = myForm.address2.value; 
	}
	if (myForm.zipcode.value == '' || myForm.zipcode.value == myForm.zipcode.title){
		error += " - Zipcode\n";
	}
	
	if (error == ''){
	
		$.post('/includes/ajax/', {
			firstname:		myForm.firstname.value,		
			lastname:		myForm.lastname.value,
			address1:		myForm.address1.value,
			address2:		address2,
			city:			myForm.city.value,
			state:			myForm.state.value,
			zipcode:		myForm.zipcode.value,
			country:		myForm.country.value,
			address1:		myForm.address1.value,
			email:			myForm.email.value,
			phone:			myForm.phone.value,
			comments:		myForm.comments.value,
			action:			'request_catalog',			
			method_type: 	'contacts'	
			
		}, function(data){
			if (data != '') {
				if(data == 'true') {
					document.getElementById('textchange').innerHTML = "<span class=\"catalog_thankyou\">Your catalog request has been submitted.<br /> Thank You</span>";
				}else{
					alert(data);	
				}
			}
		});
	}else{
		alert("The following fields are required: \n\n" + error);
	}
}


function clearText(obj){
	
	if (obj.value == obj.title){
		obj.value = ''
	}
	else if(obj.value == ''){
		obj.value = obj.title;
	}
}

//-->
