add jscript to show and hide div(preview)