function submit_form( form_name, form_button_id ) {
	var current_form = document.forms[form_name];
	var button_new_value = 1;
	
	if ( arguments[2] != undefined ) {
		button_new_value = arguments[2];
	}
//	alert( button_new_value );

	if ( form_button_id != '' ) {
		var button_obj = document.getElementById( form_button_id );
		if ( button_obj != undefined && button_obj != null ) {
			button_obj.value = button_new_value;
		}
	}

	if ( current_form != undefined ) {
		current_form.submit();
	}

}


function open_new_win( theURL, winName, winWidth ) {
	
	var TheScreenWidth = (screen.width/2)-250;
	var TheScreenHeight = (screen.height/2)-250;
	var ScreenSize = ",screenX="+TheScreenWidth+",screenY="+TheScreenHeight+",left="+TheScreenWidth+",top="+TheScreenHeight;

	if ( (winWidth == null) || (winWidth == '') ) {
		winWidth = 540;
	}

	var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+ winWidth +",height=365"+ScreenSize;
	thewin = window.open(theURL,winName,features);
	thewin.focus();
}

function SelectCar( group_code ) {
	form_name = 'order_form';
	field_id = 'selected_car_group';

	field_obj = document.getElementById( field_id );
	field_obj.value = group_code;

	submit_form( form_name, form_name + '_submit' );
}


function check_number_field( field_value ) {
	var regexp_check = new RegExp( "^([0-9])+$", "g" );
	return regexp_check.test( field_value );
}
