I am trying to make a countdown timer which after finishes shows a link which opens a popup window... and I am trying to merge these 2 codes together:
COUNTDOWN TIMER CODE:
<A HREF="#" name='delayLink'>Top</A> <SCRIPT type='text/javascript'> function delayLink(linkName, secs, finalURL, finalText) { for(var j=0; j<document.links.length && document.links[j].name!=linkName; j++) ; /*Poxy i.e. won't index a link by name, so get its offset.*/ if(j!=document.links.length && document.links[0].childNodes) { for(var i=secs; i>-1; i--) setTimeout("document.links[\'"+j+"\'].childNodes[0].nodeValue=\'Please wait "+(secs-i)+" second"+((secs-i==1)?"":"s")+"\'", i*1000); setTimeout("document.links[\'"+j+"\'].childNodes[0].nodeValue=\'"+finalText+"\';docu ment.links[\'"+j+"\'].href=\'"+finalURL+"\'", secs*1000); } } delayLink('delayLink',5,"Link Goes Here","Click here to download"); </SCRIPT>
POPUP CODE:
<script language="javascript"> var popupWindow = null; function centeredPopup(url,winName,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr oll+',resizable,location=no' popupWindow = window.open(url,winName,settings) } </script> <p><a href="Link Goes Here" onclick="centeredPopup(this.href,'myWindow','700','333','yes');return false">Centered Popup</a></p>