whats wrong with my script?! it wont work..
[quote]if ( ! attachOnLoadHandler(function () { loadBox();}))
window.onload = function () { loadBox();};
function loadBox() {
var cbox="var cbox="<div align=\"center\" id=\"cboxdiv\">"+
"<iframe frameborder=\"0\" width=\"98%\" height=\"150\" src=\"http://www.cbox.ws/box/?boxid=1025894&boxtag=8365&sec=main\" marginheight=\"2\" marginwidth=\"2\" scrolling=\"auto\" allowtransparency=\"yes\" name=\"cboxmain\" style=\"border:#787878 1px solid;\" id=\"cboxmain\"></iframe><br>"+
"<iframe frameborder=\"0\" width=\"98%\" height=\"75\" src=\"http://www.cbox.ws/box/?boxid=1025894&boxtag=8365&sec=form\" marginheight=\"2\" marginwidth=\"2\" scrolling=\"no\" allowtransparency=\"yes\" name=\"cboxform\" style=\"border:#787878 1px solid;border-top:0px\" id=\"cboxform\"></iframe>"+
"</div>";";
addNewBox.HTML("Chat Box",Chatbox,"Chatboxbox",/friends/i,"below");
var music3p="<center><embed src="http://www.mp3asset.com/swf/mp3/boomboom.swf?myid=6153433&path=2007/11/20&mycolor=0x312C20&mycolor2=0x494D4B&mycolor3=0x7C7052&autoplay=true&rand=0&f
&vol=100" quality="high" wmode="transparent" flashvars="" width="340" height="260"name="myflashfetish" align="middle"type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer" /><br><a href="http://www.myflashfetish.com/music-player/" target="_blank"><img src="http://www.myflashfetish.com/images/mffico.gif" title="Make your own playlist!" style="border-style:none;" alt="music player"></a><br />I made this <a href="http://www.myflashfetish.com/playlist/6153433" target="_blank">music player</a> at <a href="http://www.myflashfetish.com" target="_blank">MyFlashFetish</a>.com.<br></center>';
addNewBox.HTML("MUSIC3",music3p,"music3p",/friends/i,"above");
}
if (typeof addNewBox == "undefined") { addNewBox = {}; }
addNewBox = {
//addNewBox v2.2
/*
header: HTML string name
null - no header
x: "above" - HTML string: at the above of sibling box
"below" - HTML string: at the below of sibling box
null - HTML string: at the very bottom of box
sibling:- /controlpanel/i
- /photos/i
- /blogs/i
- /reviews/i
- /moreabout/i
- /publiccomments/i
- /scrapbook/i
- /meettrail/i
- /friends/i
- /ads/i
- /fanof/i
- /groups/i
*/
li: [], ul: [],
HTML: function(head,code,id,sibling,x) {
this.li = document.createElement("LI");
if (!head) head = "";
else head = "<h2>"+head+"</h2>";
this.li.innerHTML = "<div class=\"commonbox "+id+"\" id=\""+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
if (!x) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(this.li);
else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(this.li);
else if (x == "above") {
this.ul = this.getModuleByClassName(sibling)[0];
this.ul.parentNode.parentNode.insertBefore(this.li,this.ul.parentNode);
}
},
getModuleByClassName: function(sClass) {
var elm = [];
var els = document.getElementsByTagName("*") || document.all;
for (var j=0,k=els.length;j<k;j++) {
if (new RegExp(sClass).test(els[j].className))elm.push(els[j]);
}
return elm;
}
};[/quote]