Array.prototype.unique = function () { var r = new Array(); o:for(var i = 0, n = this.length; i < n; i++) { for(var x = 0, y = r.length; x < y; x++) { if(r[x]==this[i]) { continue o; } } r[r.length] = this[i]; } return r; } Array.prototype.clean = function(to_delete) { var a; for (a = 0; a < this.length; a++) { if (this[a] == to_delete) { this.splice(a, 1); a--; } } return this; }; Array.prototype.shuffle = function (){ for(var rnd, tmp, i=this.length; i; rnd=parseInt(Math.random()*i), tmp=this[--i], this[i]=this[rnd], this[rnd]=tmp); }; Array.prototype.remove = function(from, to) { var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, rest); }; function sortByName(a, b) { var x = a.name.toLowerCase(); var y = b.name.toLowerCase(); return ((x < y) ? -1 : ((x > y) ? 1 : 0)); } function popWin (url) { this.url=url; help=window.open (url,'_blank','scrollbars=no,menubar=no,status=no,resizable=yes,width=490,height=200,alwaysRaised'); } // Load XML Docs function loadXMLDoc(dname) { if (window.XMLHttpRequest){xhttp=new XMLHttpRequest();} else {xhttp=new ActiveXObject("Microsoft.XMLHTTP");} xhttp.open("GET",dname,false); xhttp.send(""); return xhttp.responseXML; } // Get Url Vals var qs = location.search.substring(1); var nv = qs.split('&'); var url = new Object(); for(i = 0; i < nv.length; i++) { eq = nv[i].indexOf('='); url[nv[i].substring(0,eq)] = unescape(nv[i].substring(eq + 1)); } // OR Get Url Vars function get_urlVars(sVal) { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars[sVal]; } // Cookies Manipulations function setCookie (name, value) { var curCookie = name + "=" + escape(value); document.cookie = curCookie; } function getCookie (name) { var prefix = name + '='; var c = document.cookie; var nullstring = ''; var cookieStartIndex = c.indexOf(prefix); if (cookieStartIndex == -1) return nullstring; var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = c.length; return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex)); } // Last Modified function lastMod() { var monthNames = new Array(); monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] var dayNames = new Array(); dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] update = new Date(document.lastModified); year = update.getYear()+1900; month = monthNames[update.getMonth()]; date = update.getDate(); day = dayNames[update.getDay()]; time = update.getTime(); hours = update.getHours(); mins = update.getMinutes(); if (mins<10) {mins = "0"+mins} theDate = "Last update: "+day+", "+month+" "+date+" "+year+", "+hours+":"+mins+"h"; return theDate; } // Hide / Show ID function do_showHide(sId) { if ($(sId).hasClass("hide")) { $(sId).removeClass("hide").addClass("show"); } else { $(sId).removeClass("show").addClass("hide"); } } function tog_showHide(sId,sStyle){ var div = $("div_"+sId+""); var img = $("img_"+sId+""); tHide = div.hasClass("hide"); if(sStyle=='fade'){tHide=!div.getStyle('opacity');} //if(sStyle=='up'){tHide=div.getStyle('height')+1;} //if (sStyle!="none") {togFx = new Fx.Morph(div, {duration: 1000});} if (tHide==1) { //if (sStyle=='up') {togFx.start({'height': '0px'});} if(sStyle=='fade'){div.fade("in");} else{div.removeClass("hide").addClass("show");} img.src = 'images/icons/arr_minus.gif'; } else { if(sStyle=='fade'){div.fade("out");} else{div.removeClass("show").addClass("hide");} img.src = 'images/icons/arr_plus.gif'; } } // TOGGLE TABS/PANES function tog_tabPane(sId) { tId = sId.split("_"); totTabs = $$('td.tab'); for (i=1; i<=totTabs.length; i++) { if ($("td_"+tId[1]+"_"+i)) {$("td_"+tId[1]+"_"+i).removeClass("tab_on").addClass("tab_off");} if ($("div_"+tId[1]+"_"+i)) {$("div_"+tId[1]+"_"+i).removeClass("show").addClass("hide");} } $("td_"+tId[1]+"_"+tId[2]).removeClass("tab_off").addClass("tab_on"); $("div_"+tId[1]+"_"+tId[2]).removeClass("hide").addClass("show"); } // Add commas to numbers function commaNumb(numb) { var result = ""; numb = Math.floor(parseInt(numb)); var numbStri = ("" + numb); var numbLeng = numbStri.length; // Build Array var arrNumb = new Array() var iMax = numbLeng; var iLoop = 0; var iStart = 0; while (iMax>0) { iStart = (numbLeng-3-(3*iLoop)) if (iStart<=0) {iStart=0;} arrNumb[iLoop] = numbStri.slice(iStart,(numbLeng-(3*iLoop))) iMax = iMax-3 iLoop++ } // Build String var iMax = arrNumb.length; var iLoop = 1; numbStri = arrNumb[0]; while (iMax>iLoop) { numbStri = arrNumb[iLoop]+","+numbStri; iLoop++ } result += numbStri; return result; } function do_nickise(sName) { var tName = sName.split(' ').join(''); tName = tName.split('-').join(''); tName = tName.toLowerCase(); tName = tName.replace("é","e"); //document.getElementById("selNick").value = tName; //setCookie ("username", tName.toLowerCase()); return tName; } function stripHTML2Array(sArg){ var re = /(>([^<]+)<)/gi; var resArr = sArg.match(re); for (i=0; i < resArr.length; i++) { resArr[i] = resArr[i].replace("<", ""); resArr[i] = resArr[i].replace(">", ""); resArr[i] = resArr[i].replace("/", ""); } resArr = resArr.clean(""); //alert(resArr.length); //for (i=0; i < resArr.length; i++) { //alert(resArr[i]); //} return resArr; } function stripHTML(sArg){ //alert("asd"); var re= /<\S[^>]*>/g; res = sArg.replace(re,""); //alert(res); return res; } function stripChars(sArg){ var re = /([0-9])/gi; sArg = sArg.match(re); sArg = sArg.join(''); //sArg = parseFloat(sArg); return sArg; } function convChars(sFrom,sTo,sStr) { arrAscii = new Array("á","à","â","ä","é","è","ê","ë","í","ì","ï","î","ó","ò","ö","ô","ú","ù","û","ü","ç","Á","À","Â","Ä","É","È","Ê","Ë","Í","Ì","Ï","Î","Ó","Ò","Ö","Ô","Ú","Ù","Û","Ü","Ç") arrHtml = new Array("á","à","â","ä","é","è","ê","ë","í","ì","ï","î","ó","ò","ö","ô","ú","ù","û","ü","ç","Á","À","Â","Ä","É","È","Ê","Ë","Í","Ì","Ï","Î","Ó","Ò","Ö","Ô","Ú","Ù","Û","Ü","Ç") if (sFrom=="ascii") {sFrom=arrAscii;} if (sFrom=="html") {sFrom=arrHtml;} if (sTo=="ascii") {sTo=arrAscii;} if (sTo=="html") {sTo=arrHtml;} for (i=0; i