var css;
try {
css = document.createElement("link");
}catch(e) {
css = document.createElement("<link>");
}
css.setAttribute("type","text/css");
css.setAttribute("rel","stylesheet");
css.setAttribute("href","URL_CSS_KAMU");
css.setAttribute("media","screen, print");
document.getElementsByTagName("head")[0].appendChild(css);
//onload handler
function onProfileLoad() {
//addboxes here
// Right Menu
var rightdee;
try {rightdee = document.createElement(”div”);}
catch (e) {rightdee = document.createElement(”<div>”);}
rightdee.innerHTML = “<div id=’dee_rm’ class=’rm_face’ onMouseover=’rm_highlight(event)’ onMouseout=’rm_lowlight(event)’ onClick=’rm_jump(event)’ display:none>”+
“<div class=’head_rm’ align=’center’>dEe’s Menu</div>”+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“<hr>“+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“<div class=’body_rm’ url=’URL‘ target=’newwin‘>Text</div>”+
“</div>”;
rightdee.setAttribute(”style”,”text-align:center;padding-top:10px”);
document.getElementById(”18″).parentNode.appendChild(rightdee);
}
<<<<< (KURANG INI KYKNYA )----------------------------FUNGSI BOX------------------------
/*MISC FUNCTIONS*/
<<<< (ADD BOXNYA JG KURANG LENGKAP )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*/
--------------------------------------AKHIR BOX-----------------------------------------------
// Right Click Menu
var display_url=0
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById(”dee_rm”)
function showmenuie5(e){
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY
//if the horizontal distance isn’t enough to accomodate the width of the context menu
if (rightedge<menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it’s width
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX
//same concept with the vertical position
if (bottomedge<menuobj.offsetHeight)
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
else
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY
menuobj.style.visibility=”visible”
return false
}
function hidemenuie5(e){
menuobj.style.visibility=”hidden”
}
function rm_highlight(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className==”body_rm”||ns6&&firingobj.parentNode.className==”body_rm”){
if (ns6&&firingobj.parentNode.className==”body_rm”) firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor=”4A93DD” // hover bg color on body
firingobj.style.color=”white” // hover bg color on body
if (display_url==1)
window.status=event.srcElement.url
}
}
function rm_lowlight(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className==”body_rm”||ns6&&firingobj.parentNode.className==”body_rm”){
if (ns6&&firingobj.parentNode.className==”body_rm”) firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor=”" // visited bg color on body
firingobj.style.color=”white” // visited color on body
window.status=”
}
}
function rm_jump(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className==”body_rm”||ns6&&firingobj.parentNode.className==”body_rm”){
if (ns6&&firingobj.parentNode.className==”body_rm”) firingobj=firingobj.parentNode
if (firingobj.getAttribute(”target”))
window.open(firingobj.getAttribute(”url”),firingobj.getAttribute(”target”))
else
window.location=firingobj.getAttribute(”url”)
}
}
if (ie5||ns6){
menuobj.style.display=”
document.oncontextmenu=showmenuie5
document.onclick=hidemenuie5
}