[quote=army]oh iyah lupa hehehehe. . .[/quote]
kamu pilih, mo ini [spoiler]function show_hide(the_box) {
if (document.getElementById(the_box)) {
if (document.getElementById(the_box).style.display == 'none') {
document.getElementById(the_box).style.display = 'block';
}
else {
document.getElementById(the_box).style.display = 'none';
}
}
}[/spoiler] ato ini [spoiler]/**
* Show Hide Effects
* Copyright: FeRuZZ ©
http://profiles.friendster.com/feruzz
* Effects animation by
http://wiki.script.aculo.us/scriptaculous/show/Effect.toggle
* Updates: May 28, 2008
* You are free:
* to copy, distribute, display, and perform the work
* to make derivative works
**/
/*global EventHandler, window, event, document*/
(function () {
EventHandler = {
add: function (obj, type, fn) {
if (obj.addEventListener) {
obj.addEventListener(type, fn, false);
} else if (obj.attachEvent) {
obj["e" + type + fn] = fn;
obj[type + fn] = function () {
obj["e" + type + fn](window.event);
};
obj.attachEvent("on" + type, obj[type + fn]);
} else {
obj["on" + type] = obj["e" + type + fn];
}
},
remove: function (obj, type, fn) {
try {
obj.removeEventListener(type, fn, false);
} catch (e) {
try {
obj.detachEvent("on" + type, fn);
} catch (er) {
obj["on" + type] = null;
}
}
}
};
})();
/*global exJS*/
(function () {
exJS = {
loader: function (src, fn, sid) {
var i,
j,
x,
id,
d = document,
s = typeof d.scripts !== "undefined" ? d.scripts: d.getElementsByTagName("script");
if (!sid) {
id = src.replace(/^([\-\/\w]+\/)/, "").replace(/\.[\-=\?\&\w]+$/, "");
} else {
id = sid;
}
for (i = 0, j = s.length; i < j; i += 1) {
if (s[i].id === id) {
x = s[i];
}
}
if (!x) {
s = d.createElement("script");
s.src = src;
d.getElementsByTagName("head")[0].appendChild(s);
exJS.regScript(src, fn);
if (typeof debug !== "undefined") {
status += "," + id;
}
}
},
regScript: function (src, fn) {
if (typeof fn === "function" && isObject(document.body)) {
fn();
} else if (typeof fn === "string") {
window.setTimeout(function () {
exJS.regScript(src, fn);
},
10);
}
}
};
})();
/*global EFFECTS*/
(function () {
EFFECTS = {
x: null,
effect: "blind", //optional: "slide", "blind" & "appear"
ownername: document.getElementById("controlpanel_header").innerHTML.replace(/<a[\S\s]*?><\/a>/g, ""),
image: {
"effectsbox": ["http://i94.photobucket.com/albums/l116/feruzz/show.png",
"http://i94.photobucket.com/albums/l116/feruzz/hide.png"]
},
toggleHide: function (obj) {
var el = EFFECTS.$(obj);
el.style.display = "none";
},
init: function () {
var contentbox = ["0", "1", "13", "12", "6", "18", "10", "14", "2", "7", "8"];
var x, y;
for (x = 0, y = contentbox.length; x < y; x += 1) {
try {
EFFECTS.toggleHide("content_" + contentbox[x] + "");
} catch (e) {}
}
for (var val in EFFECTS.image) {
if (typeof EFFECTS.image[val] !== "function") {
try {
//Controlpanel
EFFECTS.x = EFFECTS.boxClassName(/controlpanel/i)[0].getElementsByTagName("h1")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_0','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Controlpanel\"></a>" + "</div>" + EFFECTS.ownername + "";
} catch (Controlpanel) {
EFFECTS.x = "";
} try {
//Photos
EFFECTS.x = EFFECTS.boxClassName(/photos/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_1','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Photos\"></a>" + "</div>" + EFFECTS.ownername + "'s Photo Gallery";
} catch (Photos) {
EFFECTS.x = "";
} try {
//Blogs
EFFECTS.x = EFFECTS.boxClassName(/blogs/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_13','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Blogs\"></a>" + "</div>" + EFFECTS.ownername + "'s Blogs";
} catch (Blogs) {
EFFECTS.x = "";
} try {
//Reviews
EFFECTS.x = EFFECTS.boxClassName(/reviews/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_12','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Reviews\"></a>" + "</div>" + EFFECTS.ownername + "'s Reviews";
} catch (Reviews) {
EFFECTS.x = "";
} try {
//Moreabout
EFFECTS.x = EFFECTS.boxClassName(/moreabout/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_6','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Moreabout\"></a>" + "</div>More About " + EFFECTS.ownername + "";
} catch (Moreabout) {
EFFECTS.x = "";
} try {
//Publiccomments
EFFECTS.x = EFFECTS.boxClassName(/publiccomments/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_18','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Publiccomments\"></a>" + "</div>Testimonials and Comments for " + EFFECTS.ownername + "";
} catch (Publiccomments) {
EFFECTS.x = "";
} try {
//Media Box
EFFECTS.x = EFFECTS.boxClassName(/scrapbook/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_10','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Media Box\"></a>" + "</div>" + EFFECTS.ownername + "'s Media Box";
} catch (Media) {
EFFECTS.x = "";
} try {
//Friends
EFFECTS.x = EFFECTS.boxClassName(/friends/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_2','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Friends\"></a>" + "</div>" + EFFECTS.ownername + "'s Friends";
} catch (Friends) {
EFFECTS.x = "";
} try {
//Fan of
EFFECTS.x = EFFECTS.boxClassName(/fanof/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_7','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Fan of\"></a>" + "</div>" + EFFECTS.ownername + "'s a Fan Of...";
} catch (Fan) {
EFFECTS.x = "";
} try {
//Groups
EFFECTS.x = EFFECTS.boxClassName(/groups/i)[0].getElementsByTagName("h2")[0];
EFFECTS.x.innerHTML = "<div style=\"float: right;padding: 4px 11px;\" class=\"" + val + "\">" + "<a href=\"javascript:void(0);\" onclick=\"EFFECTS.boxFX(this,'content_8','" + EFFECTS.effect + "','" + EFFECTS.image[val][0] + "','" + EFFECTS.image[val][1] + "');\">" +
"<img src=\"" + EFFECTS.image[val][0] + "\" title=\"Groups\"></a>" + "</div>" + EFFECTS.ownername + "'s Groups";
} catch (Groups) {
EFFECTS.x = "";
}
}
}
},
$: function () {
var elements = [];
for (var i = 0, j = arguments.length; i < j; i += 1) {
var element = arguments[i];
if (typeof element === "string") {
element = document.getElementById(element);
}
if (arguments.length === 1) {
return element;
}
elements.push(element);
}
return elements;
},
boxFX: function (srcElm, divid, effect, fImg, sImg) {
Effect.toggle(divid, effect, {
afterFinish: function () {
var image = srcElm.getElementsByTagName("img")[0];
image.src = image.src.match(fImg) ? sImg: fImg;
}
});
return true;
},
boxClassName: function (sClass, parentElement) {
var children = (EFFECTS.$(parentElement) || document.body).getElementsByTagName("*");
var elements = [], child;
var length = children.length;
for (var x = 0, y = length; x < y; x += 1) {
child = children[x];
if (new RegExp(sClass).test(child.className)) {
elements.push(child);
}
}
return elements;
}
};
})();
//For IE5.0
if (![].push) {
Array.prototype.push = function () {
for (var x = 0, y = arguments.length; x < y; x += 1) {
this[this.length] = arguments[x];
}
return this.length;
};
}
exJS.loader("http://script.aculo.us/prototype.js", 0);
exJS.loader("http://script.aculo.us/effects.js", 0);
EventHandler.add(window, "load", EFFECTS.init);
//--------------------------[/spoiler]pilih salah satu aja, gak bole dua fungsi minmax nya
trus ini taro d dalam onload handler <">hapus ini yang d css [quote]div{
color:#ffffff ;
font: 11px comic sans MS;
}[/quote]