Hi
where in this script could I set a timeout to remove the popup? I have a document.onclick = hideCurrentPopup; but it only works if you click somewhere in the document, I would like it to disappear after 15 seconds if the user is not going to enter anything.
thanks
function showPopup (targetObjectId, eventObj) {
if(eventObj) {
// hide any currently-visible popups
hideCurrentPopup();
// stop event from bubbling up any farther
eventObj.cancelBubble = true;
// move popup div to current cursor position
// (add scrollTop to account for scrolling for IE)
moveObject(targetObjectId, 0, 45);
// and make it visible
if( changeObjectVisibility(targetObjectId, ‘visible’) ) {
// if we successfully showed the popup
// store its Id on a globally-accessible object
window.currentlyVisiblePopup = targetObjectId;
return true;
} else {
// we couldn’t show the popup, boo hoo!
return false;
}
} else {
// there was no event object, so we won’t be able to position anything, so give up
return false;
}
} // showPopup
function hideCurrentPopup() {
// note: we’ve stored the currently-visible popup on the global object window.currentlyVisiblePopup
if(window.currentlyVisiblePopup) {
changeObjectVisibility(window.currentlyVisiblePopup, ‘hidden’);
window.currentlyVisiblePopup = false;
}
} // hideCurrentPopup