use an inline javascript function (not jquery) on drupal 7
If you want to write a plain JavaScript instead of JQuery, You can proceed with normal function declaration like

function sample() {
}


and go ahead. It is normal way of the doing things in javascript, More over jQuery is a framework of javascript and as said you can add js files in the traditional way

drupal_add_js()