function convertGps() {
var deg = 0;
var min = 0;
deg = document.inGPScoord.form3_gpsdeg.value;
min = document.inGPScoord.form3_gpsmin.value;
if (deg == "" || min == "") {
alert("Enter a value for GPS degrees and GPS min.");
} else if (deg > 180 || deg < 0) {
alert("Degrees should be between 0 and 180.");
} else if (min > 60 || min < 0) {
alert("Minutes should be between than 0 and 60.");
} else {
document.inGPScoord.form3_dec.value = (deg * 1.0) + min / 60.0;
document.inGPScoord.form3_ddd.value = deg;
document.inGPScoord.form3_mm.value = parseInt(min);
var remainder2 = min - (parseInt(min) * 1.0);
document.inGPScoord.form3_ss.value = parseInt(remainder2 * 60.0);
}
}