javascript code wrapper While using drupal 7, is it necessary for to wrap pure javascript code with jquery wrapper? (I understand that while working with jquery, I need to wrap my code inside beaviors.)

code

function openWin()
  {
    mycode     
  }


od should I wrap it like this

(function () {

function openWin()
  {
mycode
  }

  })();


Or even use behaviors? Thank you.
You don't have to wrap your code with a behavior or jQuery at all. That depends:
If you want to use jQuery object with the $ as a shorthand:
Wrap your code like this:
(function($){
  //$('#something').show();
})(jQuery);

If you want to execute something after an Ajax DOM change and on document ready event
Use behaviors.
Drupal.behaviors.ysu_premium = {
  attach: function (context) {
    //jQuery('#something').show();
}}

You can wrap the behavior with the above jQuery wrapper if you want to use jQuery.
(function($){
  Drupal.behaviors.something_unique = {
    attach: function (context) {
      //$('#something').show();
    }}
})(jQuery);

When I'm working on Javascript, I always use the last snippet above.