function validate_tip(){
	//Function to validate tips on the newtip.php form
	//put the form fields into an array
	var myfields = new Array(5);
	for (i=0;( i < 3); i++) { myfields[i]=new Array(2) } ;
	var oEditor = FCKeditorAPI.GetInstance('tip') ;
		myfields[0] = [document.getElementById('title').value, 'Title'];
		myfields[1] = [oEditor.GetXHTML( true ), 'Tip'];
		myfields[2]= [document.getElementById('What').value, 'What'];
		myfields[3]= [document.getElementById('Where').value, 'Where'];
		myfields[4]= [document.getElementById('How').value, 'How'];
		
	//Make sure all of the fields are filled out		
	for (i=0;(i < myfields.length);i++){
		if (myfields[i][0]==''){
			if (myfields[i][1].charAt(0)=='T'){
				alert('Please fill out the ' + myfields[i][1] + ' field');
			}else{
				alert('Please select at least one value in the ' + myfields[i][1] + ' field');
			}	
			return false;
			break;}
	}
	
	//Make sure the tip and title fields have a minimum number of characters
	if(myfields[0][0].length<15){
		alert("Title must be more than 15 characters");
		return false; 
	}else if(myfields[1][0].length<50){
		alert("Tip must be more than 50 characters"); 
		return false;
	}
}



