script for dynamic ad loading