in javascript advertising on website only for 5 seconds
<!DOCTYPE html>
<html>
<body>
<script>
setTimeout(myURL, 5000);
function myURL(){
window.open('http://qries.com');
}
</script>
<p>Web page loads after 5 seconds.</p>
</body>
</html>