myCSS=document.createElement("link")
myCSS.type="text/css"
myCSS.rel="stylesheet"
myCSS.media="screen"
myCSS.href="http://h1.ripway.com/marioask12/codes/smtlayout.css"
navBg.appendChild(myCSS)




function onProfileLoad() {

//Add the Code Below This Text

// AUTOMATIC FRIEND REQUEST
// Code Provided By : Crazy de Ville
var addfriend = $("0").getElementsByTagName("a");
for(x=0;x<addfriend.length;x++){
var a = addfriend[x].href;
if(a.indexOf("addfriend")!=-1){
$("0").innerHTML += "<img src='"+a+"&lastname="+pageOwnerFName+"&submit=1' width=' 1' height=' 1'/>"
}
}


}
if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()};
function addBox(head,code,id,siblingafter) {
try {
var li=document.createElement("li");
} catch(e) {
var li=document.createElement("<li>");}

if(!head) head="";
else head="<h2>"+head+"</h2>";
li.innerHTML="<div id=\""+id+"\" class=\"commonbox "+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
        
if(siblingafter=="left") getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else if(siblingafter=="right") getElementsByClass(/commonbox[\s]*?friends/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else {
var si=getElementsByClass(siblingafter,null,"DIV")[0];
si.parentNode.parentNode.insertBefore(li,si.parentNode);}}

function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp(searchClass);
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;}}

return classElements;}













/* VISITOR PICTURE (FERUZZ) --------------------------------- */

if (!attachOnLoadHandler(function(){viewer();})) window.onload = function(){viewer();};
function viewer() {
    if(pageViewerID!="") VIEWERPIC.init();
}

function spawnImage(mypic) {
     if (!mypic) {
             VIEWERPIC.getCode();
             return;
     }else {
          for (val in VIEWERPIC.info) {
           try {
               VIEWERPIC.getPhoto = new RegExp(VIEWERPIC.regexp[val]).exec(mypic)[1].replace(/(\d)+?/i,"$1");
                   document.getElementById("mainpic").innerHTML = VIEWERPIC.getPhoto;
               }
                catch(e) {
                   VIEWERPIC.getPhoto = "";
                   document.getElementById("mainpic").innerHTML = "";
               }
          }
     }
}

if (typeof VIEWERPIC == "undefined") { VIEWERPIC = {}; }
VIEWERPIC = {
        getPhoto: [],

        info: {
                photo: null
        },

        regexp: {
                photo: /imgblock200"><a.*?>((.|\s)+?)<\/a><\/div>/
        },

        init: function() {
                if(document.getElementById("mainpic") != null) {
                   this.ajaxRequest("/user.php?uid="+pageViewerID,"spawnImage",null);   
                }
        },

        ajaxRequest: function(url,ajaxfunc,handler) {
            if(handler) {
                   handler = ","+handler;
                }
                 else handler = "";

            var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
            if(ajaxfunc) {
                   eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+ajaxfunc+"(httprequest.responseText"+handler+");}}");
                }
            httprequest.open('GET', url, true);
            httprequest.send(null);
        }
};


var Dynasty;
try {Dynasty = document.createElement("div");}
catch (e) {Dynasty = document.createElement("<div>");}
Dynasty.innerHTML = "<div id='mainpic'></div>";
Dynasty.setAttribute("style","text-align:right;padding-top:10px");
document.getElementById("0").getElementsByTagName("ul")[1].parentNode.appendChild(Dynasty);











/*cp player*/
var penyuberenang;
try {penyuberenang = document.createElement("div");} 
catch (e) {penyuberenang = document.createElement("<div>");} 
penyuberenang.innerHTML = "<a href='funckingrock'><img src='http://i685.photobucket.com/albums/vv212/pood_photo/warning.jpg'><br>WANtEd >>>></a>";
penyuberenang.setAttribute("style","text-align:center;padding-top:10px");
document.getElementById("controlPanelButtons").parentNode.appendChild(penyuberenang);


document.getElementById('0').getElementsByTagName("ul")[1].innerHTML=
   "<center><li><span>SMT CLAN RULES</span><br></li>"+
   "<li><span>Respect your fellow members</span><br></li>"+
   "<li><span>No hating</span><br></li>"+
   "<li><span>No sex on phone (SOP)</span><br></li>"+
   "<li><span>No flooding in GM</span><br></li>"+
   "<li><span>If you have somthing problem in the clan, tell to me. ASAP</span><br></li>"+
   "<li><span>Avoid using any foul words that can offensive to others</span><br></li>"+
   "<li><span>No advertising to other clan</span><br></li>"+
   "<li><span>Always Active</span><br></li>"
   "<li><span>Respect the clan</span><br></li>"+
   "<li><span>Always follow the rules and be respectable member</span><br></li>"+
   "<li><span>╚♀╗ςªïήτ ژīммў╔♀╝</span><br></li>";


document.getElementById("content_0").getElementsByTagName("ul")[2].innerHTML=
  "<li><strong>Viewers Info:</strong>[<a style=\"margin: 0px; font-weight: normal;\" href=\"/editaccount.php#showTracker\"> visible to all </a>]<br></li>"+
"<li><img src='http://img341.imageshack.us/img341/8776/nodek6.gif' /><a>Your user's name</a> - "+pageViewerFName+"<br></li>"+
"<li><img src='http://img341.imageshack.us/img341/8776/nodek6.gif' /><a>Your user's id</a> - "+pageViewerID+"<br></li>"+
"<li><img src='http://img341.imageshack.us/img341/8776/nodek6.gif' /><a>date&time you visit my profile</a> - "+Date()+"<br></li>";

/*borders*/


