function DEMOEMBED() { var _id, _sig, _h, _w; this.run = function(id, sig, h, w){ _id = id; _sig = sig; _h = h; _w = w; loadJQuery(); loadCSS(); } function loadJQuery() { var script = document.createElement('script'); var head = document.getElementsByTagName("head")[0] || document.documentElement; script.src = 'http://demonstrations.wolfram.com/javascript/jquery-1.5.1.js'; script.type = 'text/javascript'; // Handle Script loading var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { done = true; loadOthers(); // Handle memory leak in IE script.onload = script.onreadystatechange = null; if ( head && script.parentNode ) { head.removeChild( script ); } } }; document.getElementsByTagName('head')[0].appendChild(script); } function loadCSS() { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'http://demonstrations.wolfram.com/css/embed.css'; link.media = 'all'; document.getElementsByTagName('head')[0].appendChild(link); } function loadOthers() { $.ajax({ url: 'http://demonstrations.wolfram.com/javascript/JqueryBrowserOSdetect.js', dataType: "script", async: false, success: function () { $.ajax({ url: 'http://demonstrations.wolfram.com/javascript/browserplugin.js', dataType: "script", async: false, success: function () { loadEmbedPlugin(_h,_w,_id,_sig); } }); } }); } function loadEmbedPlugin(flashheight,flashwidth,nbname,signature) { signature = decodeURIComponent(signature); flashheight = parseInt(flashheight); flashwidth= parseInt(flashwidth); var thePath = "http://demonstrations.wolfram.com/" + nbname + "/"; var src = thePath + "preloadGraphic.jpg"; imagelink=document.createElement("A"); imagelink.setAttribute("href",""); imagelink.setAttribute("id","detectplayerplugin"); myImg=document.createElement("IMG"); var url = thePath + "preloadGraphic.jpg"; myImg.setAttribute("src",src); myImg.setAttribute("id","preloadgraphic"); imagelink.appendChild(myImg); $('
').insertBefore("#DEMO_"+nbname); var platform= $.client.os; // windows and mac platform if(platform == 'Windows' || platform =='Mac') { if(!$.browser.mathematica) { $("#mainFlash_"+nbname).append(""); myImg.setAttribute("class","overlay"); $("#mainFlash_"+nbname).append(myImg); if((flashwidth) > 238){ var paddingNeeded = (flashwidth- 238)/2; $("#mainFlash_"+nbname+" .downloadplayerfordemonstrationn").css("margin-left",paddingNeeded ); } } else { createEmbedObjectForSharing(flashwidth+5,flashheight+5,nbname,signature); } } else { if(platform == 'Linux') { $("#mainFlash_"+nbname).append("