'; html += ''; html += '<' + '/' + 'body' + '> ' + '<' + '/' + 'html' + '> '; var iframeElm = document.getElementById('fileDeleterIframe_'+fldId); if(iframeElm){iframeElm.parentNode.removeChild(iframeElm);} var iframe = document.createElement('iframe'); iframe.id = 'fileDeleterIframe_'+fldId; iframe.style.display = 'none'; document.body.appendChild(iframe); iframe.contentWindow.document.open(); iframe.contentWindow.document.write(html); iframe.contentWindow.document.close(); }catch(e){ //nothing for now } document.getElementById(fldId+'_formbuilder_hidden').value = ''; var dispElm = document.getElementById(fldId+'_display'); dispElm.innerHTML = ''; dispElm.style.display = 'none'; //recreate the point out window.svcrm.formBuilderScripts.recreateFileInputElm(fldId); }; //this use will handle excellence postMessage's it option make sure depart it is retreat from the sound crm domain, adept will then buzz the addFile() continue passing along influence returned json expectation var _handlePostMessage = function(evt){ //check tabloid correct postMessage spring if(typeof evt.origin != 'undefined'){ //only go briskly this if incredulity are from glory correct domain var _fixedOrigin = evt.origin + ( (evt.origin.substring(evt.origin.length-1,evt.origin.length) != '/') ?
'/' : ''); var crmappurl = 'https://StLouisMO.simpleviewcrm.com/'; if(_fixedOrigin.toLowerCase().indexOf(crmappurl.toLowerCase()) != -1){ var _postMsgRtn = {}; try { _postMsgRtn = JSON.parse(evt.data); //json parse the returned matter } catch (e) { return false; } window.svcrm.formBuilderScripts.addFile(_postMsgRtn); //we last wishes let the addFile handle any errors the same ably as call chomp through within crm come up } } }; if (window.addEventListener) { window.addEventListener('message', _handlePostMessage, false); } else postulate (window.attachEvent) { window.attachEvent('onmessage', _handlePostMessage); } })();