var lifebuoy_mothers_daysite_id = "ananmanan"; var lifebuoy_mothers_daysite_body_width = 980; var lifebuoy_mothers_dayleft_iframe_link = "http://www.codeartlove.com/clients/lifebuoy/2014/mothers_day/background/?site_id=" + lifebuoy_mothers_daysite_id + "&side=left"; var lifebuoy_mothers_dayright_iframe_link = "http://www.codeartlove.com/clients/lifebuoy/2014/mothers_day/background/?site_id=" + lifebuoy_mothers_daysite_id + "&side=right"; function setlifebuoy_mothers_dayBackgroundWidth(){ var new_width = (window.innerWidth - lifebuoy_mothers_daysite_body_width) / 2; document.getElementById("lifebuoy_mothers_day-left").style.width = new_width + "px"; document.getElementById("lifebuoy_mothers_day-right").style.width = new_width + "px"; } if(window.attachEvent) { window.attachEvent('onresize', function() { setlifebuoy_mothers_dayBackgroundWidth(); }); } else if(window.addEventListener) { window.addEventListener('resize', function() { setlifebuoy_mothers_dayBackgroundWidth(); }, true); } function lifebuoy_mothers_dayAppendBackground(){ var left_div = document.createElement("div"); left_div.id = "lifebuoy_mothers_day-left"; left_div.style.position = "fixed"; left_div.style.width = "100%"; left_div.style.height = "100%"; left_div.style.right = "50%"; left_div.style.marginRight = (lifebuoy_mothers_daysite_body_width / 2) + "px"; var left_iframe = document.createElement("iframe"); left_iframe.src = lifebuoy_mothers_dayleft_iframe_link; left_iframe.frameBorder = "no"; left_iframe.scrolling = "no"; left_iframe.width = "100%"; left_iframe.height = "100%"; left_div.appendChild(left_iframe); var right_div = document.createElement("div"); right_div.id = "lifebuoy_mothers_day-right"; right_div.style.position = "fixed"; right_div.style.width = "100%"; right_div.style.height = "100%"; right_div.style.left = "50%"; right_div.style.marginLeft = (lifebuoy_mothers_daysite_body_width / 2) + "px"; var right_iframe = document.createElement("iframe"); right_iframe.src = lifebuoy_mothers_dayright_iframe_link; right_iframe.frameBorder = "no"; right_iframe.scrolling = "no"; right_iframe.width = "100%"; right_iframe.height = "100%"; right_div.appendChild(right_iframe); document.body.insertBefore(left_div, document.body.firstChild); document.body.insertBefore(right_div, document.body.firstChild); setlifebuoy_mothers_dayBackgroundWidth(); } window.onload = function(){ lifebuoy_mothers_dayAppendBackground(); }; if(typeof ($) != 'undefined') $(document).ready(function(){ lifebuoy_mothers_dayAppendBackground(); });