document.write('
'); var fps = (function(window, undefined){ var fps = { entry: document.getElementById('fps_widget'), root: 'http://www.francepropertyshop.com/', query: 'path=' }; fps.log = function(msg){ console.log(msg); } fps.jsonp = function(url, callback){ var s = document.createElement('script'); s.async = true; s.src = url; fps.entry.parentNode.insertBefore(s, fps.entry); } fps.loadScript = function(url, callback) { var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; script.src = url var entry = document.getElementsByTagName('script')[0]; entry.parentNode.insertBefore(script, entry); if (script.addEventListener) script.addEventListener('load', callback, false); else { script.attachEvent('onreadystatechange', function() { if (/complete|loaded/.test(script.readyState)) callback(); }); } } function loadCss(url, callback) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = url; // Append tag fps.entry.parentNode.insertBefore(link, fps.entry); // Append test element var testElem = document.createElement('span'); testElem.id = 'fps-css-ready'; fps.entry.parentNode.insertBefore(testElem, fps.entry); (function() { var node = document.getElementById('fps-css-ready'); if (window.getComputedStyle) { value = document.defaultView .getComputedStyle(node, null) .getPropertyValue('color'); } else if (testElem.currentStyle) { value = node.currentStyle['color']; } if (value && value === 'rgb(121, 121, 121)' || value === '#797979') { callback(); } else { setTimeout(arguments.callee, 100); } })(); } function loadSupportingFiles(callback){ loadCss(fps.root + 'static/built/widget/fps.css', function(){ fps.loadScript(fps.root + 'static/js/widget/fps.js', callback); }); } loadSupportingFiles(function(){ }); return fps; })(window);