//http://www.mon-beulogue.com/domel-la-manipulation-magique-du-dom-en-javascript.html //domEl() function - painless DOM manipulation //written by Pawel Knapik // pawel.saikko.com var domEl = function(e,c,a,p,x) { if (!c) c=''; if(e||c) { //c=(typeof c=='string'||(typeof c=='object'&&!c.length))?[c]:c; //commentaire 84 sur pawel.saikko.com if (typeof c=='string') { c = c.length ? [c] : []; } else if (typeof c=='object' && !c.length) { c = [c]; } //fin commentaire 84 e=(!e&&c.length==1)?document.createTextNode(c[0]):e; var n = (typeof e=='string')?document.createElement(e) : !(e&&e===c[0])?e.cloneNode(false):e.cloneNode(true); if(typeof e=='string' || e.nodeType!=3) { c[0]===e?c[0]='':''; for(var i=0,j=c.length;i=0;k--) { if(x){while(p[k].firstChild)p[k].removeChild(p[k].firstChild); if(!e&&!c&&p[k].parentNode)p[k].parentNode.removeChild(p[k]);} if(n) p[k].appendChild(n.cloneNode(true)); } return true; } // getElementsByClass - algorithm by Dustin Diaz, shortened by Pawel Knapik function getElementsByClass(s,n,t) { var c=[], e=(n?n:document).getElementsByTagName(t?t:'*'),r=new RegExp("(^|\\s)"+s+"(\\s|$)"); for (var i=0,j=e.length;i