function form2form(formA, formB) { var rdo = 0; $(':input[name]', formA).each(function() { switch (this.type) { case 'radio': if (this.checked) { rdo = this.value }; break; case 'checkbox': a = this.checked; break; default: a = this.value; }; $('[name='+$(this).attr('name')+']', formB).val( this.type=='radio' ? rdo : a) })};
function first_focus() { ($('form.validate input:text:visible:first').length == 0) ? $('form.validate  textarea:visible:first').focus() : $('form.validate input:text:visible:first').focus(); };
function back_form(src, back) {	src.hide();	back.show(); };	
function copy_form(src, next) {	var form = v2.Form.get( src.attr('id') ); mask(); if ( form.test("validate") ) { form2form( src, $('#master_form') );	if ( next == "last" ) { $('#master_form').submit();	} else if ( next.type == 'string' && next.substring(4,0) == "btn_" ) { $('#' + next).submit(); } else { src.hide(); next.show(); first_focus(); unmask(); }; } else { unmask(); }; return false;	};
function copy_control(src, dest) { $('#' + dest)[0].value = (src.type=='checkbox') ? src.checked : src.value; };
function catch_return() { $('form input').keypress(function (e) {	if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {	$('input:visible.default:first').click();	return false; } else { return true;	}	}); };
function set_word_cost(cost, mode) { $('input#word_option')[0].nextSibling.nodeValue = (mode == 'selected') ? ('Microsoft word upgrade selected (' + cost + ')') : ('Include the Microsoft Word Package for only ' + cost); };
/* function set_word_option(event) { alert(event.target.name + ":" + event.target.checked);}; */
function mask() { $('#mask').show(); $('img.hourglass').show(); };
function unmask() { $('#mask').hide(); $('img.hourglass').hide(); };
first_focus();
catch_return();
