modify and simplify fancybox function in script.js.