out of focus event javascript
// In JavaScript, using the addEventListener() method
// NOTE: The addEventListener() method is not supported in IE 8 and earlier versions
object.addEventListener("focusout", myScript)
// In JavaScript (may not work as expected in Chrome, Safari and Opera 15+)
object.onfocusout = function(){myScript};