How to include javascript method in vaadin 7

Hi,

I have created form using custom layout where i have link ,on clicking the link i need to show or hide a table.I have included the javascript method in html file but it is not recognized when my application is running

Below is my custom layout html snippnet

function showTable(id)
{
if(document.getElementById(id).style.display == ‘none’)
{
document.getElementById(id).style.display=‘block’;
}
else
{
document.getElementById(id).style.display = ‘none’;
}
}

More.....

This javascript method showTable is not recognized …Can any one help me on this