Free javascript Hosting


emoticons_exemple5.js

Uploaded on Jan 04 2010 09:01 by edward1-5

function showsbtext(id,index) {
var bookmarktext=document.getElementById(id);
var sbValues= new Array();
sbValues[0] = 'Bookmark:';
sbValues[1] = 'Add to <strong>Digg</strong>';
sbValues[2] = 'Add to <strong>Delicious</strong>';
sbValues[3] = 'Add to <strong>Blinklist</strong>';
sbValues[4] = 'Add to <strong>Yahoo Web</strong>';
sbValues[5] = 'Add to <strong>Netvouz</strong>';
sbValues[6] = 'Add to <strong>Ma.gnolia</strong>';
sbValues[7] = 'Add to <strong>Fark</strong>';
sbValues[8] = 'Add to <strong>Furl</strong>';
sbValues[9] = 'Add to <strong>Technorati</strong>';
sbValues[10] = 'Add to <strong>Simpy</strong>';
sbValues[11] = 'Add to <strong>Spurl</strong>';
sbValues[12] = 'Add to <strong>Newsvine</strong>';
sbValues[13] = 'Add to <strong>Blinkbits</strong>';
sbValues[14] = 'Add to <strong>Smarkings</strong>';
sbValues[15] = 'Add to <strong>Segnalo</strong>';
sbValues[16] = 'Add to <strong>De.lirio.us</strong>';
sbValues[17] = 'Add to <strong>Reddit</strong>';
sbValues[18] = 'Add to <strong>Wists</strong>';
sbValues[19] = 'Add to <strong>Google</strong>';
document.getElementById(bookmarktext.id).innerHTML = sbValues[index];
}


document.getElementsByClassName = function(clsName){
var retVal = new Array();
var elements = document.getElementsByTagName("*");
for(var i = 0;i < elements.length;i++){
if(elements[i].className.indexOf(" ") >= 0){
var classes = elements[i].className.split(" ");
for(var j = 0;j < classes.length;j++){
if(classes[j] == clsName)
retVal.push(elements[i]);
}
}
else if(elements[i].className == clsName)
retVal.push(elements[i]);
}
return retVal;
}

function addSmiley(dummy)
{
var d = [], i=0, def = ['post-body','entry-content','comment-body'];

for(i=0;i<def.length;i++)
{
var content = document.getElementsByClassName(def[i]);
for(var j=0;j<content.length;j++)
d.push(content[j]);
}

for(i=0;i<arguments.length;i++)
{
var content = document.getElementsByClassName(arguments[i]);
for(var m=0;m<content.length;m++)
d.push(content[m]);
}

for(var i=0;i<d.length;i++)
{
d[i].innerHTML = d[i].innerHTML.replace (/\\(\sun\)/ig,"<img style='border: 0; padding:0' src='http://img340.imageshack.us/img340/3090/sunh.gif'/>")


}
}

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(function(){
addSmiley();
});

Back to list