function setInnerHTML(divContent,HTML){divContent.innerHTML=HTML;try{var All=divContent.getElementsByTagName("*");for(var i=0;i<All.length;i++){All[i].id=All[i].getAttribute("id");All[i].name=All[i].getAttribute("name");if(!All[i].className){All[i].className=All[i].getAttribute("class")}}}catch(ex){}try{var AllScripts=HTML.extractTags("script");var Before=new Array();AllScripts.forEach(function(v){for(var i=0;i<Before.length;i++){if(Before[i]==v){return false}}Before.push(v);setTimeout(v,0)})}catch(ex){}try{var AllStyles=HTML.extractTags("style");AllStyles.forEach(function(v){var s=document.createStyleSheet();s.cssText=v;s.enabled=true},true)}catch(ex){}}String.prototype.extractTags=function(tag){var matchAll=new RegExp('(?:<'+tag+'.*?>)((\n|\r|.)*?)(?:<\/'+tag+'>)','img');var matchOne=new RegExp('(?:<'+tag+'.*?>)((\n|\r|.)*?)(?:<\/'+tag+'>)','im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1]})};Object.prototype.forEach=function(delegate,ownpropertiesonly){if(typeof(delegate)=="function"){if(this instanceof Array&&typeof(ownpropertiesonly)=="undefined"){ownpropertiesonly=true}for(key in this){var ok=(!ownpropertiesonly);if(!ok){try{ok=this.hasOwnProperty(key)}catch(ex){}}if(ok){try{delegate(this[key],key,this)}catch(e){}}}}return false};Object.prototype.map=function(iterator){var results=[];this.forEach(function(value,index){results.push(iterator(value,index))});return results};
