
function checkForm(){
	var isGood = true;
	
	if(document.getElementById('contact').value == ''){
		isGood = false;
		document.getElementById('contact_field').style.color = 'red';
		document.getElementById('contact_field').style.fontWeight = 'bold';
		document.getElementById('contact_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('contact_field').style.color = '#ca0135';
		document.getElementById('contact_field').style.fontWeight = 'normal';
		document.getElementById('contact_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('club_name').value == ''){
		isGood = false;
		document.getElementById('club_name_field').style.color = 'red';
		document.getElementById('club_name_field').style.fontWeight = 'bold';
		document.getElementById('club_name_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('club_name_field').style.color = '#ca0135';
		document.getElementById('club_name_field').style.fontWeight = 'normal';
		document.getElementById('club_name_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('address').value == ''){
		isGood = false;
		document.getElementById('address_field').style.color = 'red';
		document.getElementById('address_field').style.fontWeight = 'bold';
		document.getElementById('address_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('address_field').style.color = '#ca0135';
		document.getElementById('address_field').style.fontWeight = 'normal';
		document.getElementById('address_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('city').value == ''){
		isGood = false;
		document.getElementById('city_field').style.color = 'red';
		document.getElementById('city_field').style.fontWeight = 'bold';
		document.getElementById('city_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('city_field').style.color = '#ca0135';
		document.getElementById('city_field').style.fontWeight = 'normal';
		document.getElementById('city_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('state').value == ''){
		isGood = false;
		document.getElementById('state_field').style.color = 'red';
		document.getElementById('state_field').style.fontWeight = 'bold';
		document.getElementById('state_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('state_field').style.color = '#ca0135';
		document.getElementById('state_field').style.fontWeight = 'normal';
		document.getElementById('state_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('zipcode').value == ''){
		isGood = false;
		document.getElementById('zipcode_field').style.color = 'red';
		document.getElementById('zipcode_field').style.fontWeight = 'bold';
		document.getElementById('zipcode_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('zipcode_field').style.color = '#ca0135';
		document.getElementById('zipcode_field').style.fontWeight = 'normal';
		document.getElementById('zipcode_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('gym_phone').value == ''){
		isGood = false;
		document.getElementById('gym_phone_field').style.color = 'red';
		document.getElementById('gym_phone_field').style.fontWeight = 'bold';
		document.getElementById('gym_phone_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('gym_phone_field').style.color = '#ca0135';
		document.getElementById('gym_phone_field').style.fontWeight = 'normal';
		document.getElementById('gym_phone_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('cell_phone').value == ''){
		isGood = false;
		document.getElementById('cell_phone_field').style.color = 'red';
		document.getElementById('cell_phone_field').style.fontWeight = 'bold';
		document.getElementById('cell_phone_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('cell_phone_field').style.color = '#ca0135';
		document.getElementById('cell_phone_field').style.fontWeight = 'normal';
		document.getElementById('cell_phone_field').style.fontStyle = 'normal';
	}
	
	if(document.getElementById('email').value == ''){
		isGood = false;
		document.getElementById('email_field').style.color = 'red';
		document.getElementById('email_field').style.fontWeight = 'bold';
		document.getElementById('email_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('email_field').style.color = '#ca0135';
		document.getElementById('email_field').style.fontWeight = 'normal';
		document.getElementById('email_field').style.fontStyle = 'normal';
	}
	if(document.getElementById('gym_fax').value == ''){
		isGood = false;
		document.getElementById('gym_fax_field').style.color = 'red';
		document.getElementById('gym_fax_field').style.fontWeight = 'bold';
		document.getElementById('gym_fax_field').style.fontStyle = 'italic';
	}else{
		document.getElementById('gym_fax_field').style.color = '#ca0135';
		document.getElementById('gym_fax_field').style.fontWeight = 'normal';
		document.getElementById('gym_fax_field').style.fontStyle = 'normal';
	}
	
	if(isGood == false) alert('Please fix the errors in RED.');

	return isGood;
}

function addAthlete(){
	$('a.addCoaching').click( function() {
		$('#coaches').append('<tr><td><input type="text" name="coach[]" value="" style="height:16px; width:150px; font-size:12px"></td><td><input type="text" name="usag[]" value="" style="height:16px; width:150px; font-size:12px"></td><td><input type="text" name="cert[]" value="" style="height:16px; width:150px; font-size:12px"></td></tr>');
		
		return false;
	});
	$('a.addAthlete').click( function() {
		$('#athletes').append('\n\
<tr> \
	<td><input type="text" name="athlete[]" value="" style="height:16px; width:250px; font-size:12px"></td> \n\
	<td><input type="text" name="level[]" value="" style="height:16px; width:50px; font-size:12px"></td> \n\
	<td><input type="text" name="usag_ath[]" value="" style="height:16px; width:75px; font-size:12px"></td> \n\
	<td><input type="text" name="bday[]" value="" style="height:16px; width:75px; font-size:12px" /></td> \n\
</tr>');

		return false;
	});
}

function sidebar(){
	if(window.location.href.indexOf('information_new.php') == -1){
		$('#navigation a').each(function(index) {
			var thisHref = $(this).attr('href');
			var pageHref = window.location.href;
			if(pageHref.indexOf(thisHref) > -1){
				var thisText = $(this).html();
				$(this).html('<strong>' + thisText + '</strong>');
				$(this).addClass("navline");
			}
			//alert(thisHref + '==' + );
		});
	}
}

$(document).ready(function(){
	sidebar();
	addAthlete();
});
