// keep_parent_background.js // RJM Programming // May, 2017 // As an HTML iframe child and parent defines document.body background, and the child has not defined background, adopt that parent one as the background function adopt_parent_background_maybe() { if (parent.document.body.outerHTML) { var parent_style_bits=parent.document.body.outerHTML.split('>')[0].split(' style="'); if (parent_style_bits.length > 1) { var parent_style=(";" + parent_style_bits[1].split('"')[0] + ";").replace(/ ; /g,';').replace(/; /g,';').replace(/ ;/g,';'); if (parent_style.toLowerCase().indexOf(";background") != -1) { if (document.body.outerHTML) { var self_style_bits=document.body.outerHTML.split('>')[0].split(' style="'); if (self_style_bits.length > 1) { var self_style=(";" + self_style_bits[1].split('"')[0] + ";").replace(/ ; /g,';').replace(/; /g,';').replace(/ ;/g,';'); if (self_style.toLowerCase().indexOf(";background") == -1 || 1 == 1) { if (parent_style.toLowerCase().indexOf(";background-color:") != -1) { document.body.style.backgroundColor=parent_style.toLowerCase().split(";background-color:")[1].split(";")[0].trim(); } } if (self_style.toLowerCase().indexOf("url('") == -1) { if (parent_style.toLowerCase().indexOf("url('") != -1) { var parifs=parent.document.getElementsByTagName('iframe'); for (var iparifs=0; iparifs