// eTeam Marketing Scripts - Jon Lynch
function popBookMark(docurl, popup) {

    popupwindow=window.open(docurl,'popupname','status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=1,width=350,height=300');

	popupwindow.focus();
	
}

function openWin(docurl, popup) {

    popupwindow=window.open(docurl,'popupname','status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=1,width=450,height=400');

	popupwindow.focus();
	
}

function openLrgWin(docurl,popup) {
	popupwindow=window.open(docurl,'popupname','status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=1,width=750,height=500');

	popupwindow.focus();
		
}


function openMedWin(docurl, popup) {

    popupwindow=window.open(docurl,'popupname','status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=1,width=470,height=550');

	popupwindow.focus();
	
}

function validateGoals(){
	if(isNaN(document.goalForm.desiredWeight.value) || document.goalForm.desiredWeight.value == ''){
		alert("Please enter a valid number into the Desired Weight Field.");
		return false;
		document.goalForm.desiredWeight.focus();
		}
	if(isNaN(document.goalForm.startingSize.value) || document.goalForm.startingSize.value == ''){
		alert("Please enter a valid number into the Starting Size Field.");
		return false;
		document.goalForm.startingSize.focus();
		}
	if(isNaN(document.goalForm.desiredSize.value) || document.goalForm.desiredSize.value == ''){
		alert("Please enter a valid number into the Desired Size Field.");
		return false;
		document.goalForm.startingSize.focus();
		}
	return true;
	}
	
function validateChart(){
	var rowNum = document.chartForm.logStart.value;
	var amWeight = 'document.chartForm.amWeight_' + rowNum + '.value';
	var bustChest = 'document.chartForm.bustChest_' + rowNum + '.value';
	var waist = 'document.chartForm.waist_' + rowNum + '.value';
	var hips = 'document.chartForm.hips_' + rowNum + '.value';
	var arms = 'document.chartForm.arms_' + rowNum + '.value';
	var thighs = 'document.chartForm.thighs_' + rowNum + '.value';
	var abdomen = 'document.chartForm.abdomen_' + rowNum + '.value';
	//amWeight
	/*
	if(isNaN(eval(amWeight)) || eval(amWeight) == ''){
		alert("Please enter a valid number into the AM Weight Field.");
		return false;
		amWeight.focus();
		}
	if(isNaN(eval(bustChest)) || eval(bustChest) == ''){
		alert("Please enter a valid number into the Bust/Chest Field.");
		return false;
		bustChest.focus();
		
		}
	if(isNaN(eval(waist)) || eval(waist) == ''){
		alert("Please enter a valid number into the Waist Field.");
		return false;
		waist.focus();
		
		}
	if(isNaN(eval(hips)) || eval(hips) == ''){
		alert("Please enter a valid number into the Hips Field.");
		return false;
		hips.focus();
		
		}
	if(isNaN(eval(arms)) || eval(arms) == ''){
		alert("Please enter a valid number into the Arms Field.");
		return false;
		arms.focus();
		
		}
	if(isNaN(eval(abdomen)) || eval(abdomen) == ''){
		alert("Please enter a valid number into the Abdomen Field.");
		return false;
		abdomen.focus();
		
		}
	if(isNaN(eval(thighs)) || eval(thighs) == ''){
		alert("Please enter a valid number into the Thighs Field.");
		return false;
		thighs.focus();
		
		}
	return true;
	}
*/
	if(eval(amWeight) == ''){
		alert("Please enter a valid number into the AM Weight Field.");
		return false;
		amWeight.focus();
		}
	if(eval(bustChest) == ''){
		alert("Please enter a valid number into the Bust/Chest Field.");
		return false;
		bustChest.focus();
		
		}
	if(eval(waist) == ''){
		alert("Please enter a valid number into the Waist Field.");
		return false;
		waist.focus();
		
		}
	if(eval(hips) == ''){
		alert("Please enter a valid number into the Hips Field.");
		return false;
		hips.focus();
		
		}
	if(eval(arms) == ''){
		alert("Please enter a valid number into the Arms Field.");
		return false;
		arms.focus();
		
		}
	if(eval(abdomen) == ''){
		alert("Please enter a valid number into the Abdomen Field.");
		return false;
		abdomen.focus();
		
		}
	if(eval(thighs) == ''){
		alert("Please enter a valid number into the Thighs Field.");
		return false;
		thighs.focus();
		
		}
	return true;
	}

function jump(tempMaxLength,tempCurrBox,tempNextBox){
	var tempCurrValueLength = tempCurrBox.value;
	tempCurrValueLength = tempCurrValueLength.length;
	if(tempCurrValueLength >= eval(tempMaxLength)){
	tempNextBox.focus();
	}
}