﻿
//The purpose of this file is to quickly populate forms for testing purposes.


//Take action kit
function populateActionKitPrefs() {

}

function dPopulateSymbicort() {

	//dSetListVal('reg_user_Title', 1);
	dSetVal('reg_user_FirstName', 'Johnny');
	dSetVal('reg_user_LastName', 'Appleseed');
	dSetVal('reg_user_Address1', '123 main st.');
	dSetVal('reg_user_Address2', '2nd floor # 234');
	dSetVal('reg_user_City', 'Motown');
	dSetListVal('reg_user_State', 3);
	dSetVal('reg_user_Zip', '12345');
	dSetVal('reg_user_EmailAddress', dSetRandomEmail());
	dSetVal('reg_user_ConfirmEmail', dGetVal('reg_user_EmailAddress'));
	dSetVal('reg_user_DOBMonth', '01');
	dSetVal('reg_user_DOBDay', '02');
	dSetVal('reg_user_DOBYear', '1956');
	//dCheckVal('reg_user_Gender_Male');
	//dCheckVal('reg_survey_60_10');
	//dCheckVal('reg_survey_60_11');
	//dCheckVal('reg_survey_60_12');
	//dCheckVal('reg_survey_60_13');
}




function dPopulateRadios() {
	var inputs = document.getElementsByTagName('input');
	for (var i in inputs) {
		if (inputs[i].type == 'radio') {
			inputs[i].checked = true;
		}
	}
}
function dGetRandom() {
	var randomnumber = Math.floor(Math.random()*100001);
	return randomnumber;
}
function dSetRandomScreenName() {
	var r = dGetRandom();
	return 'user' + r;
}
function dSetRandomEmail() {
	var r = dGetRandom();
	return r + '@user.com';
}
function dSetVal(id, val) {
	if (document.getElementById(id)) {
		document.getElementById(id).value = val;
	}
}
function dSetListVal(id, i) {
	document.getElementById(id).selectedIndex = i;
}
function dGetVal(id) {
	return document.getElementById(id).value;
}
function dCheckVal(id) {
	if (document.getElementById(id)) {
		document.getElementById(id).checked = true;
	}
}
