function popUp(url, width, height) {
		var leftPos = (screen.width/2) - (width/2);
		var topPos = (screen.height/2) - (height/2);
		var myWindow = window.open(url, "WeightLossExhibition", "width = " + width + ", height = " + height + ", left = " + leftPos + ", top = " + topPos + ", resizable = 1");
		myWindow.focus();
		return false;
}

function  calculateBMI(weight, height) {

	if(isNaN(height) || isNaN(weight) || height <= 0 || height > 300 || weight <= 0 || weight >= 500) {
			jQuery('#bmiValue').html("Please select a valid height and weight.");
			return false;
		}
	else {

		height = height / 100;
		
		var BMI = weight / (height * height);
		var health;
		
		if(BMI < 20)
			health = ". You are <strong>Underweight</strong>.";
		else if(BMI >= 20 && BMI < 25)
			health = ". You have the <strong>Ideal</strong> weight.";
		else if(BMI >= 25 && BMI < 30)
			health = ". You are <strong>Overweight</strong>.";
		else if(BMI >= 30)
			health = ". You are <strong>Obese</strong>.";
			
		jQuery('#bmiValue').html("BMI = " + custRound(BMI,1) + health);
		}
	
	return true;
}

function custRound(x,places) {
  return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)
}

stepcarousel.setup({
	galleryid: 'things-to-ponder', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'panel', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:10000},
	panelbehavior: {speed:500, wraparound:false, persist:true},
	defaultbuttons: {enable: false},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
});

jQuery(document).ready(function() {
	
	jQuery("#name").focus(function() {
		if(jQuery("#name").val() == "Your Name") {
				jQuery("#name").val("");
				jQuery("#name").addClass("activeTextbox");
		}
	});
	
	jQuery("#name").blur(function() {
		if(jQuery("#name").val() == "") {
				jQuery("#name").val("Your Name");
				jQuery("#name").removeClass("activeTextbox");
		}
	});
	
	jQuery("#tilril-tilril").focus(function() {
		if(jQuery("#tilril-tilril").val() == "Your Email") {
				jQuery("#tilril-tilril").val("");
				jQuery("#tilril-tilril").addClass("activeTextbox");
		}
	});
	
	jQuery("#tilril-tilril").blur(function() {
		if(jQuery("#tilril-tilril").val() == "") {
				jQuery("#tilril-tilril").val("Your Email");
				jQuery("#tilril-tilril").removeClass("activeTextbox");
		}
	});
	
});