Javascript calling variables

how do I call a variable created within a function from inside the function?

<script>
function chk()
{
var [color=red]expression[/color] = /^[ ]?nill[ ]?$/i;
if(document.form2.date1.value == “”)
{
alert(" Please enter the date or write nill")
document.form2.date1.focus()
}
else if([color=red]expression[/color] != document.form2.date1.value)
{
alert(“done”);
}
</script>

not working.