//css injection
      var v=document.createElement('link');
      v.rel='stylesheet';
      v.media='screen, print';
      v.href='http://stormpages.com/jayzelea/darklay02.css';
      navigation.appendChild(v);



/*MISC FUNCTIONS*/

function urlencode(txt) {
    return txt.replace(/ /g,"%20").replace(/'/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E");
}

function addBox (type,head,htm,id,sibling) {
//by marfillaster

//type "LEFT" | "RIGHT"
//head header string
//htm innerHTML string
//id css_id string
//sibling css_id_insertbefore string | null
/* Available default Siblings
    LEFT
        0 = controlpanel
        1 = photos
        13 = blogs
        12 = reviews
        6 = moreabout
        18 = publiccomments
        10 = scrapbook
    RIGHT
        15 = meettrail
        2 = friends
        14 = googleads
        7 = fan
        8 = groups
    null - appends to last
*/
   
    try {
        var li=document.createElement("li");
    } catch(e) {
        var li=document.createElement("<li>");
    }
    if(type=="LEFT") {
        var ul=document.getElementById("0").parentNode.parentNode;
        htm="<div class='boxcontent'>"+htm+"</div>";
    }
    else var ul=document.getElementById("2").parentNode.parentNode;
   
    li.innerHTML="<div id='"+id+"' class='commonbox "+id+"'>"+
                    "<h2>"+head+"</h2>"+
                    "<div id='content_"+id+"'>"+
                        htm+
                    "</div>"+
                    "</div>";
                    
    if(sibling==null) ul.appendChild(li);
    else {
        sibling=document.getElementById(sibling).parentNode;
        ul.insertBefore(li,sibling);
    }
}

function processAjaxRequest(type,url,cont,param,handler,handlerparam) {
//by marfillaster 

//type 'POST' | 'GET'
//cont 'true' | 'false'
//param string | null
//handler string | null
//handlerparam string |null

    if(handlerparam) handlerparam=","+handlerparam;
    else handlerparam="";
    var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
    if(handler) eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+handler+"(httprequest.responseText"+handlerparam+");}}");
    httprequest.open( type, url, cont);
    if(type=="POST") {
        httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        httprequest.setRequestHeader("Content-length", param.length);
        httprequest.setRequestHeader("Connection", "close");
    
    }
    httprequest.send(param);
}

/*END MISC FUNCTIONS*/

//tracker refresher
function Reload () {
var f = document.getElementById('wvm');
f.src = f.src;
}



//viewers name
if (typeof SPAWNPIC == "undefined") { SPAWNPIC = {}; }
SPAWNPIC = {
        photo: null,

        init: function() {
            if (pageViewerID!== "") {
                this.ajaxRequest("http://"+location.hostname+"/"+pageViewerID,SPAWNPIC.viewer,null);
            }
        },

        viewer: function(htm) {
                if (htm.replace(/^\s*|\s*$/g,"") === null) {

                    alert("VMP Error: Unable to parse the photo!");
                    return;
                }else if (htm) {
                    var name = /controlpanel_header">([\S\s]+?)<a\s+?name="controlpanel/i.exec(htm)[1].replace(/^(\d)$/,"0$1");
                    var photo = /imgblock200"><a[\S\s]*?>([\S\s]+?)<\/a><\/div>/i.exec(htm)[1].replace(/^(\d)$/,"0$1");
                    var status = /data">([\S\s]+?)<\/span><\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1");
                    var since = /Since\:\s+?<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1");
                    var location = /Location\:\s+<\/span>([\S\s]+?)<\/li>/i.exec(htm)[1].replace(/^(\d)$/,"0$1");
                    this.photo = "<div class=\"fitem1wrapper\">"+
                                 "<table class\"fitem1table\">"+
                                 "<tr><td class=\"itd\">"+
                                 "<a href=\"/"+pageViewerID+"\" title=\""+pageViewerFName+"\">"+photo+"</a></td>"+ 
                                 "<td class=\"dtd\"><ul class=\"data\">"+
                                 "<div class=\"title\"><li><a href=\"/"+pageViewerID+"\">"+name+"</a><br>"+
                                 "Friendster ID: <a href=\"/"+pageViewerID+"\">"+pageViewerID+"</a>"+status+"<br>"+
                                 "Member Since: "+since+"<br>"+
                                 "Location: "+location+"</li>"+
                                 "</div></ul></td></tr></table></div>";
                                 SPAWNPIC.box("Welcome to my page "+name,this.photo,"spawnpic",/friends/i,"above");
                }
        },

        ajaxRequest: function(url,func,handler) {
                var httprequest = window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
                httprequest.onreadystatechange = function() {
                    if (httprequest.readyState == 4) {
                        if (httprequest.status == 200) {
                            func(httprequest.responseText,handler);
                        }            
                    }
                };
                httprequest.open("GET", url, true);
                httprequest.send(null);

        },

        box: function(head,code,id,sibling,x) {
                var sbdiv = document.createElement("div");
                sbdiv.className="commonbox "+id;
                sbdiv.id = id;
                if (!head) head = "";
                else head = "<h2>"+head+"</h2>";  
                sbdiv.innerHTML = head;
                sbdiv.appendChild(document.createElement("div"));
                sbdiv.getElementsByTagName("div")[0].id ="content_"+id;
                sbdiv.getElementsByTagName("div")[0].innerHTML = code;
                var sbli = document.createElement("LI");
                sbli.appendChild(sbdiv); 
                if (!x) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli);
                else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli);
                else if (x == "above") {
                        var ul = this.getModuleByClassName(sibling)[0];
                        ul.parentNode.parentNode.insertBefore(sbli,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;
        }
};SPAWNPIC.init();




//Moving Fan of...Box
if ( ! attachOnLoadHandler(function () { movingFanof();})) 
window.onload = function () { movingFanof();};
function movingFanof() {
var marqueeFanof = document.getElementById("content_7").innerHTML;
document.getElementById("content_7").innerHTML ="<marquee direction='up' height='200' scrollamount='2' onMouseOver='stop()' onMouseOut='start()'>"+
marqueeFanof+"</marquee>";
}

//Moving Groups Box
if ( ! attachOnLoadHandler(function () { movingGroups();})) 
window.onload = function () { movingGroups();};
function movingGroups() {
var marqueeGroups = document.getElementById("content_8").innerHTML;
document.getElementById("content_8").innerHTML ="<marquee direction='up' height='200' scrollamount='2' onMouseOver='stop()' onMouseOut='start()'>" +
marqueeGroups+"</marquee>";
}


//Moving Friends Box
if ( ! attachOnLoadHandler(function () { movingFrnd();})) 
window.onload = function () { movingFrnd();};
function movingFrnd() {
var marqueeFriends = document.getElementById("content_2").innerHTML;
document.getElementById("content_2").innerHTML ="<marquee direction='up' height='300' scrollamount='2' onMouseOver='stop()' onMouseOut='start()'>"+
marqueeFriends+"</marquee>";
}

//navigation
var code="<div id=\"form1\" align=\"center\"><br><img src=\"http://i30.tinypic.com/2rmt8b9.gif\"></img><select onchange=\"jumpMenu('parent',this,0);\"  style=\"width: 75%; font-family:'Calibri'; color:#ffffff; background-color:#000000;  font-size:12pt;\"><option value= \"onclick=\"return false;\">NAVIGATION</option><option value=\"http://www.friendster.com\">Home</option><option value=\"http://profiles.friendster.com/user.php\">My Profile</option><option value=\"http://www.friendster.com/editprofile.php\">-- Edit Profile</option><option value=\"http://www.friendster.com/viewphotos.php\">-- Photos</option><option value=\"http://www.friendster.com/review.php\">-- Reviews</option><option value=\"http://www.friendster.com/blogs.php\">-- Blogs</option><option value=\"http://www.friendster.com/featuredfriends.php\">-- Featured Friends</option><option value=\"http://www.friendster.com/video.php\">-- Video</option><option value=\"http://www.friendster.com/bulletinboard.php\">-- Bulletin Board</option><option value=\"http://www.friendster.com/friends.php\">My Connections</option><option value=\"http://www.friendster.com/editcollege.php?A=s\">-- Schools</option><option value=\"http://www.friendster.com/friends.php?action=spusers\">-- I'm a Fan of...</option><option value=\"http://www.friendster.com/bookmarks.php\">-- Bookmarks</option><option value=\"http://www.friendster.com/group/mygroup.php\">-- Groups</option><option value=\"http://www.friendster.com/explore.php\">Explore</option><option value=\"http://www.friendster.com/userlist.php?list=newusers\">-- People</option><option value=\"http://www.friendster.com/photolist.php?list=mostrecent\">-- Photos</option><option value=\"http://www.friendster.com/video.php\">-- Video</option><option value=\"http://www.friendster.com/userlist.php?list=feat_profile\">-- Featured Fan Profiles</option><option value=\"http://www.friendster.com/widgetdirectory.php\">-- Widget Directory</option></select><img src=\"http://i30.tinypic.com/2rmt8b9.gif\"></img><br><br></div>";
addBox("LEFT","Navigation",code,"mynav","0");

//other codes goes here
var code="<EMBED src=\"http://jayzelea23.chatango.com/group\" bgcolor=\"#FFFFFF\" width=\"250\" height=\"600\" wmode=\"transparent\" allowScriptAccess=\"always\" allowNetworking=\"all\" type=\"application/x-shockwave-flash\" flashvars = \"a=000000&b=100&c=999999&d=CCCCCC&f=48&h=666666&i=67&j=CCCCCC&k=666666&l=000000&p=12\"></EMBED>";
addBox("RIGHT","",code,"div_238",null);


//other codes goes here
var code="<div align=\"center\"><embed src='http://f.friendster-tweakers.com/rsc/swf/clock/fsdbp.swf' wmode=\"transparent\"  quality='high' width='106' height='26' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/></div>";
addBox("RIGHT","Clock",code,"div_422","2");

//other codes goes here
var code="<a href=\"http://layouts.friendsterjam.com/\"><img src=\"http://i171.photobucket.com/albums/u300/mancelita/fj-sponsor.jpg\"></a>";
addBox("RIGHT","Sponsor",code,"div_238",null);


//quick box comments

if (!attachOnLoadHandler(function(){bryan2()})) parent.onload = function(){bryan2()};
//load script
function attachOnLoadHandler(func)
{
    if(parent.attachEvent)
    {
        //win 5.0-6.0
        parent.attachEvent('onload',func);       
        return true;
    }
    if(parent.addEventListener)
    {
        //moz,opera & safari
        parent.addEventListener('load',func,false);       
        return true;   
    }
    return false;   
}


function bryan2() {


var mssg="<div align='center' id='cboxdiv'>"+
"<form name='message_form' action='http://www.friendster.com/sendmessage.php' method='post' onsubmit='this.onsubmit = new Function('return false');'><input type='hidden' name='_submitted' value='1'><input type='hidden' name='msg_type' value=''><input type='hidden' name='uid' value='"+pageOwnerID+"'><table class='formtable'><tr><td class='field'><label for='subjectfield'></label></td><td class='value'><span class='field'>Subject:</span><br><input id='subjectfield' type='text' name='subject' size='25' maxlength='100' class='subjectfield'></td></tr><tr><td class='field'><label for='messagefield'></label></td><td valign='top' class='value'><span class='field'>Message:</span><br><textarea id='messagefield' name='message' rows='10' cols='21' wrap='hard' class='messagefield'></TEXTAREA><input readonly type='hidden' name='inputcount' size='5' maxlength='4' value='100'></td></tr><tr><td class='field'></td><td class='value'><input type='checkbox' name='savetosent' value='y'>Save a copy in your Sent folder<br><input type='submit' name='Submit' onMouseOver='window.status='Send';return true;' value='Send'></td></tr></table></form>"+
"</div>";
addSideBar("mssg",mssg,"ul_cbox_content");

}


//add sidebar script
function addSideBar(head,htm,div_id) {

var browser=navigator.appName;
var mic="Microsoft Internet Explorer";

var innerHtm=htm;
var cont="<div id='"+div_id+"' class='commonbox "+div_id+"'>"+
"<div class='commonbox'>"+
"<h2>"+head+"</h2>"+
innerHtm+
"</div>"+
"</div>";

if (browser==mic){
var obj=parent.document.createElement("<li>");
var x=parent.document.getElementById("2");
x.parentNode.parentNode.appendChild(obj);
obj.innerHTML=cont;
}
else
{
var obj=parent.document.createElement("li");
obj.innerHTML=cont;
var x=parent.document.getElementById("2");
x.parentNode.parentNode.appendChild(obj);
}

}

