[JS] Body onload in script?

<body onload=“functionname(‘layer1’)”>

How do i put that in:

<script type=“javascript”>
//script here
</script>