edited javascript for fancybox popups