var cache = []; // Arguments are image paths relative to the current page. $.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--;) { var cacheImage = document.createElement('img'); cacheImage.src = arguments[i]; cache.push(cacheImage); } } function showEquipe(idEquipe) { $("#showEqp").remove(); $("
").appendTo("body") $("#showEqp").submit(); } //************************************************************************************************** //*********************************** Funções Gerais *********************************************** //************************************************************************************************** function zero(sStr) { return fRight("00" + sStr, 2) } /*********************** Data saida para tela (PT) *******************************/ function format_data_tela(sData) { if ( (sData == null) ) { return sData; } var oData = new Date(sData); if(oData=="NaN") {return sData} //alert(oData) sDia = fRight("00" + oData.getDate(), 2) sMes = fRight("00" + (oData.getMonth()+1), 2) sAno = oData.getUTCFullYear() sDataReturn = sDia + "/" + sMes + "/" + sAno //alert(sDataReturn) return sDataReturn } function format_datetime_tela(sData) { if ( (sData == null) ) { return sData; } var oData = new Date(sData); if(oData=="NaN") {return sData} //alert(oData) sDia = fRight("00" + oData.getDate(), 2) sMes = fRight("00" + (oData.getMonth()+1), 2) sAno = oData.getUTCFullYear() sHora = fRight("00" + oData.getHours(), 2) sMinuto = fRight("00" + oData.getMinutes(), 2) sDataReturn = sDia + "/" + sMes + "/" + sAno + " " + sHora + ":" + sMinuto //alert(sDataReturn) return sDataReturn } function format_time_tela(sData) { if ( (sData == null) ) { return sData; } var oData = new Date(sData); if(oData=="NaN") {return sData} //alert(oData) sDia = fRight("00" + oData.getDate(), 2) sMes = fRight("00" + (oData.getMonth()+1), 2) sAno = oData.getUTCFullYear() sHora = fRight("00" + oData.getHours(), 2) sMinuto = fRight("00" + oData.getMinutes(), 2) sDataReturn = sHora + ":" + sMinuto //alert(sDataReturn) return sDataReturn } /*********************** Data saida para banco *******************************/ function format_date_banco(sData) { if ( (sData == null) ) { return sData; } /* var oData = new Date(sData); //alert(oData) if(oData=="NaN") {return sData} sDia = fRight("00" + oData.getDate(), 2) sMes = fRight("00" + (oData.getMonth()+1), 2) sAno = oData.getUTCFullYear() */ //00/00/0000 sDia = sData.substring(0,2) sMes = sData.substring(3,5) sAno = sData.substring(6,10) sDataReturn = sAno + "/" + sMes + "/" + sDia //alert(sDataReturn) return sDataReturn } function validaData (data) { if ( (data == null) || (data.length < 10) ) { return false; } var jsDataValida = true; var jsDia = data.substring(0,2)-0; var jsMes = data.substring(3,5)-1; var jsAno = data.substring(6,10)-0; var oData = new Date(jsAno, jsMes, jsDia); if (jsDia != oData.getDate()) { jsDataValida = false } if (jsMes != oData.getMonth()) { jsDataValida = false } if (jsAno != oData.getFullYear()) { jsDataValida = false } return jsDataValida; } //var sender="event.srcElement" function mask_data(e){ var ch, input, valor; if (!e) var e = window.event; //pega o objeto input if (e.target) input = e.target; else if (e.srcElement) input = e.srcElement; if (input.nodeType==3) // previne bug do Safari input = e.parentNode; //pega o caracter digitado if (e.charCode) ch = e.charCode; else ch = e.keyCode; //valor do campo valor = input.value; sPermitidos = ",9,37,39,38,40,8,45,46,13,36,35," prok = sPermitidos.indexOf(","+ch+",") if( prok != -1 ) return true //if(document.all){ //alert(ch); //if ( (ch>47 && ch<58) ){ if ( (ch>47 && ch<58) || (ch>95 && ch<106) ) { if (ch>95) ch=ch-96 else ch=ch-48 if(valor==3 && ch > 1) { input.value= "0" + input.value + "/" return false; } if (valor.length==0) {if (ch>3){input.value="0"}} if (valor.length==2 ) {if (ch>1){input.value+="/0"}else{input.value+="/"}} if(valor.length==3) if (ch>1){input.value+="0"} if (valor.length==5){ if (ch>2){input.value+="/19"}else{ if (ch>0){input.value+="/"}else{input.value+="/20"} } } return true } //}else{ //if( (ch>47 && ch<58) || ( ch>95 && ch<106) ){return true} //if ( (ch>47 && ch<58) ){return true} //} return false } //*********************************** // XML HTTP // //*********************************** function GetXmlHttp() { var xmlhttp = false; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest() } else if (window.ActiveXObject)// code for IE { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") } catch (E) { xmlhttp=false } } } return xmlhttp; } function getResponse(sUrl) { var xmlhttp = GetXmlHttp() // new ActiveXObject("MSXML2.XMLHTTP"); xmlhttp.open("GET", sUrl, false); xmlhttp.send(null); return xmlhttp.responseText; } function trataResponse(oResponse) { var mTmp = oResponse.sRecebido.split("/\\") var mControle = mTmp[0].split("^") oResponse.nErr = eval(mControle[0]) oResponse.sMsg = unescape(mControle[1]) oResponse.sTxt = unescape(mTmp[1]) } //*********************************** function isNada(sStr) { sStr +="" for(var x = sStr; x [ ] | \ / if ((s.indexOf("{")>=0) || (s.indexOf("}")>=0) || (s.indexOf("(")>=0) || (s.indexOf(")")>=0) || (s.indexOf("<")>=0) || (s.indexOf(">")>=0) || (s.indexOf("[")>=0) || (s.indexOf("]")>=0) || (s.indexOf("|")>=0) || (s.indexOf("\"")>=0) || (s.indexOf("/")>=0) ) return false; // & * $ % ? ! ^ ~ ` ' " if ((s.indexOf("&")>=0) || (s.indexOf("*")>=0) || (s.indexOf("$")>=0) || (s.indexOf("%")>=0) || (s.indexOf("?")>=0) || (s.indexOf("!")>=0) || (s.indexOf("^")>=0) || (s.indexOf("~")>=0) || (s.indexOf("`")>=0) || (s.indexOf("'")>=0) ) return false; // , ; : = # if ((s.indexOf(",")>=0) || (s.indexOf(";")>=0) || (s.indexOf(":")>=0) || (s.indexOf("=")>=0) || (s.indexOf("#")>=0) ) return false; // procura se existe apenas um @ if ( (s.indexOf("@") < 0) || (s.indexOf("@") != s.lastIndexOf("@")) ) return false; // verifica se tem pelo menos um ponto após o @ e se o ponto está antes do fim if ( (s.lastIndexOf(".") < s.indexOf("@")) || (s.lastIndexOf(".") >= (s.length-1))) return false; return true; } function alertNewWindow(sStr) { x=window.open("", "x", "resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=no,location=no,top=0,left=0") x.resizeTo(screen.availWidth, screen.availHeight) x.moveTo(0,0) x.document.write( "" + "" + "" ) } function limpaFormPesq(oFrm) { for(var i=0; i < oFrm.length; i++) { oField = oFrm[i] bOk = false if(oField.name) {bOk = true} if(bOk) { bOk = false; if(fLeft(oField.name, 5)=="pesq_") { bOk=true; } } if(bOk) { oField.value="" } } } //*************************** verfica o nome de arquivos ou pastas function checaFileNm(sNm) { if(sNm==""){return true} sNm = sNm.toLowerCase() var sPermitidos = ",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,w,y,z,0,1,2,3,4,5,6,7,8,9,_," if( !isNaN(fLeft(sNm,1)) ) {return false} for( i=0; i< sNm.length; i++ ) { sChar = sNm.substring(i, i+1) nProk = sPermitidos.indexOf("," + sChar + ",") if(nProk==-1) {return false} } return true } //********************* trata valores para serem postados via url //thanks to http://cass-hacks.com/articles/code/js_url_encode_decode/ function urlEncode (clearString) { var output = ''; var x = 0; clearString = clearString.toString(); var regex = /(^[a-zA-Z0-9_.]*)/; while (x < clearString.length) { var match = regex.exec(clearString.substr(x)); if (match != null && match.length > 1 && match[1] != '') { output += match[1]; x += match[1].length; } else { if (clearString[x] == ' ') output += '+'; else { var charCode = clearString.charCodeAt(x); var hexVal = charCode.toString(16); output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase(); } x++; } } return output; } // ******************** checa Tamanho textarea function contaCarac(nLength, oTextarea, oCampoExibe) { if( oTextarea.value.length > nLength ) { alert("Máximo de caracteres aceito é \"" + nLength + "\".") sStr = oTextarea.value oTextarea.value = sStr.substring(0, nLength) } oCampoExibe.value = oTextarea.value.length } function formatCalc(nNr) { sTemp = nNr sTemp = repl(sTemp, ".", "") sTemp = repl(sTemp, ",", "") if( isNaN(sTemp) ){return 0} nNr = repl(nNr, ".", "") nNr = repl(nNr, ",", ".") return nNr } //*************** Moeda function formatMoeda(e) { var ch, input, valor; if (!e) var e = window.event; //pega o objeto input if (e.target) input = e.target; else if (e.srcElement) input = e.srcElement; if (e.nodeType==3) // previne bug do Safari input = e.parentNode; //pega o caracter digitado if (e.charCode) ch = e.charCode; else ch = e.keyCode; //valor do campo valor = input.value; sPermitidos = ",35,36,37,39,9,16,"; prok = sPermitidos.indexOf(","+ch+","); if( prok != -1 ) return true; /*if( ( event.keyCode >= 96 && event.keyCode <= 105 ) || ( event.keyCode >= 48 && event.keyCode <= 57 ) ) {return true}*/ valor = repl(valor, ",", ""); valor = repl(valor, ".", ""); if( isNaN(valor) ) valor=0; bVirg = false nNr = "" /*if( nCode==188 || nCode==110 )//, { return false } else*/ if( ch==8 )//<= valor = fLeft( valor, valor.length-1 ); else if( ch==46 )//del valor = ""; else if( ch >= 96 && ch <= 105 ) nNr = ch - 96; else if( ch >= 48 && ch <= 57 ) nNr = ch - 48; if( valor == ",") valor=""; if( isNaN(valor) ) return false; if( Math.ceil(valor) > 9999999999999 ) return false; valor = valor + "" + nNr; input.value = poeVirg(valor); return false; } function poeVirg(sStr) { var sZeros = ""; var sReturn = sStr; sReturn = repl(sReturn, ",", ""); sReturn = repl(sReturn, ".", ""); if( isNaN(sReturn) ) return "0,00"; //alert(sReturn) sReturn = Math.ceil(sReturn) + ""; //alert(sReturn) if( sReturn.length <= 2 ) { if( sReturn.length==1 ) sZeros="00"; if( sReturn.length==2 ) sZeros="0"; if( sReturn.length==3 ) sZeros=""; sReturn = sZeros + "" + sReturn; } var sIni = "" + fLeft(sReturn, sReturn.length-2); var sFim = "," + fRight(sReturn, 2); var sTemp = ""; var cont = 0; var i, s, sTemp, sPonto; for( i=sIni.length; i--; i>0 ) { cont++; sPonto = ""; if( cont == 3 ) { sPonto = "."; cont = 0; } //alert(i+" i") s = sIni.substring( i ,i+1 );//' + "|" //alert(s) sTemp = sPonto + s + "" + sTemp; } //alert(sTemp) if( sTemp=="" ) sTemp = sIni; if( fLeft(sTemp,1)=="." ) sTemp = fRight(sTemp, sTemp.length-1); sIni = sTemp; sReturn = sIni + "" + sFim; return sReturn; } //************************************************ function corta_fim( sStr, sFim ) { return fLeft( sStr, ( sStr.length-sFim.length ) ) } function fLeft(sStr,nQtd) { return sStr.substring(0,nQtd) } function fRight(sStr,nQtd) { sStr = sStr.toString() nLen = sStr.length star = nLen-nQtd if( star < 1 ){ star=0 } return sStr.substring(star,nLen) } function trim(sStr) { sStrRet = "" for( iY=0; iY < sStr.length; iY++ ) { s = sStr.substring(iY, iY+1) if(s!=" ") {break} } nIniX = iY for( iY=sStr.length; iY > 0; iY-- ) { s = sStr.substring(iY, iY-1) if( s != " " ) {break} } nFimX = iY if(nIniX >= nFimX){ return "" } sStrRet = sStr.substring(nIniX , nFimX) return sStrRet } function troca_class( oObj, sClass ) { oObj.classAnt = oObj.className oObj.className = sClass } function so_numero(e) { var ch; if (e.charCode) ch = e.charCode; else ch = e.keyCode; sPermitidos = ",9,37,39,38,40,8,46," prok = sPermitidos.indexOf(","+ch+",") if( prok != -1 ) return true; if(e.shiftKey) return false; if (( ch >= 96 && ch <= 105 ) || ( ch >= 48 && ch <= 57 )) return true; return false; } function so_numero_zero(e) { var ch; if (e.charCode) ch = e.charCode; else ch = e.keyCode; sPermitidos = ",9,37,39,38,40,8,46," prok = sPermitidos.indexOf(","+ch+",") if( prok != -1 ) return true; if (( ch >= 96 && ch <= 105 ) || ( ch >= 48 && ch <= 57)) return true; return false; } function repl( aonde, oque, por ) { prok=0 aonde = aonde.toString() oque = oque.toString() por = por.toString() while( prok != -1 ) { aonde = aonde.replace(oque,por) prok = aonde.indexOf(oque) } return aonde } /*********************** abrir liga de amigos chamada pelo flash (via Post) *******************************/ function abreLiga(nCodigo) { var oFrm = document.createElement('FORM'); oFrm.setAttribute('name',"frmTemp"); oFrm.setAttribute('action','../_jogos/liga_amigos_minhaliga.asp'); oFrm.setAttribute('method','post'); var input = document.createElement('INPUT'); input.setAttribute('type','hidden'); input.setAttribute('value',nCodigo); input.setAttribute('name','nCodigo'); oFrm.appendChild(input); document.body.appendChild(oFrm) oFrm.submit() } //funcao para incluir um flash na pagina sem o IE pedir pra ativar com o mouse function writeTag( url, width, height, wmode, align, bgcolor ) { document.write(''); } function writeTagJq(id, url, width, height, wmode, align, bgcolor ) { $(id).html(''); } //abrir uma nova janela centralizada na tela function openCenteredWindow(url, name, width, height, params) { var left = Math.floor( (screen.width - width) / 2); var top = Math.floor( (screen.height - height) / 2); var winParams = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width; if (params) { winParams += "," + params; } var win = window.open(url, name, winParams); if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } return win; } //Visual Box and buttons formatting /*Format a box with control id, icon path and filename and optional buttons buttons: 'controId,caption,href,[arrowposition]' arrowposition can be empty, left or right formatBox(controlId,[path/file.ext],'buttoncontroId,caption,href,[arrowposition]|button2|...|buttonN') */ /*function formatBox(id,icon,buttons) { var box = $('#'+id), htmlbuttons = '', defaultbox, buttonwidth; var carregando = document.getElementById('carregando'); var interval = 'formatBox("' + id + '","' + icon + '","' + buttons + '")'; if($(box).parent()){ if ($(box).parent().width() <= 0) { setTimeout(interval.toString(), 100) } else { title = $(box).attr('_title'); //get width if it exists else set it to 100% if ($(box).attr('width')) { width = $(box).attr('width'); //Opera Fix: width.value with % returns a negative number if (width < 0) { width = Math.abs(width) + '%' } } else width='100%'; //get margin if it exists else set it to 0 if ($(box).attr('margin')) margin = $(box).attr('margin') else margin=0; if (margin.split(" ").length == 4){ var summargin = parseInt(margin.split(" ")[1]) + parseInt(margin.split(" ")[3]); }else if ((margin.split(" ").length >= 2) && (margin.split(" ").length < 4)) var summargin = parseInt(margin.split(" ")[1]) * 2; else var summargin = 2*margin; if (width.match('%')){ width = Math.round(parseInt(width) / 100 * $(box).parent().width()) - summargin; }else{ width = width - summargin; } var marginsplit = margin.split(" "); var i; margin = ''; for (i=0;i < marginsplit.length;i++){ margin += " " + marginsplit[i] + "px "; } //calculate width for some elements //47 = icon + borderright //16 = borders bottom var titletopwidth = width - 47; var midbotwidth = width - 16; //Ie Fix: doesnt subtract padding/border if (ifIe()) contentwidth = width; else var contentwidth = width - 26; //get content var content = $(box).html(); //change icon if (icon == '') { var bgicon = '../imagens/quina_sup_esq.jpg'; } else var bgicon = icon; if (buttons != '') { //get buttons for (i=0; i < buttons.split('|').length;i++) htmlbuttons += '' } //create box defaultbox = '
' defaultbox += '' defaultbox += '' + title + '' defaultbox += '
' defaultbox += '' + content + '' defaultbox += '' defaultbox += '
' + htmlbuttons + '
' defaultbox += '
' //insert box in the right place $(box).html(defaultbox); fixHeight(); //format buttons if (htmlbuttons != '') { for (i=0; i < buttons.split('|').length;i++) { param = buttons.split('|')[i].split(','); formatButton(param[0], param[1], param[2], param[3], param[4]); } } $(box).css('visibility','visible') if (carregando) $(box).css('display','none') } } }*/ function formatBox(id,icon,buttons) { var box = document.getElementById(id), htmlbuttons = '', defaultbox, buttonwidth; var carregando = document.getElementById('carregando'); var interval = 'formatBox("' + id + '","' + icon + '","' + buttons + '")'; //alert($('#'+id).parent().width()) if ($('#'+id).parent().width() <= 0) { setTimeout(interval.toString(), 100) } else { title = box.attributes._title.value; //get width if it exists else set it to 100% if ($('#'+id).attr('width')) { width = $('#'+id).attr('width'); //Opera Fix: width.value with % returns a negative number if (width < 0) { width = Math.abs(width) + '%' } } else width='100%'; //get margin if it exists else set it to 0 if ($('#'+id).attr('margin')) margin = $('#'+id).attr('margin') else margin=0; if (margin.split(" ").length == 4) var summargin = parseInt(margin.split(" ")[1]) + parseInt(margin.split(" ")[3]); else if ((margin.split(" ").length >= 2) && (margin.split(" ").length < 4)) var summargin = parseInt(margin.split(" ")[1]) * 2; else var summargin = 2*margin; if (width.match('%')) width = Math.round(parseInt(width) / 100 * $('#'+id).parent().width()) - summargin; else width = width - summargin; //alert(id+' - '+width) var marginsplit = margin.split(" "); var i; margin = ''; for (i=0;i < marginsplit.length;i++) margin += " " + marginsplit[i] + "px "; //calculate width for some elements //47 = icon + borderright //16 = borders bottom var titletopwidth = width - 47; var midbotwidth = width - 16; //Ie Fix: doesnt subtract padding/border if (ifIe()) contentwidth = width; else var contentwidth = width - 26; //get content var content = box.innerHTML; //change icon if (icon == '') { var bgicon = '../imagens/quina_sup_esq.jpg'; } else var bgicon = icon; if (buttons != '') { //get buttons for (i=0; i < buttons.split('|').length;i++) htmlbuttons += '' } //create box defaultbox = '
' defaultbox += '' defaultbox += '' + title + '' defaultbox += '
' defaultbox += '' + content + '
' defaultbox += '' defaultbox += '
' + htmlbuttons + '
' defaultbox += '
' //insert box in the right place box.innerHTML = defaultbox; fixHeight(); //format buttons if (htmlbuttons != '') { for (i=0; i < buttons.split('|').length;i++) { param = buttons.split('|')[i].split(','); formatButton(param[0], param[1], param[2], param[3], param[4]); } } box.style.visibility = 'visible'; if (carregando) carregando.style.display = 'none'; } } /*Format a button with id, text, href and could have a arrow icon before ('left') or after ('right') formatButton(controId,caption,href,[left/right]) */ function formatButton(id,text,href,arrow, title) { var button = document.getElementById(id); var text = text; var defaultbutton; //gets text width to set button width, if its less then 40 sets its to 40 button.innerHTML = '
' + text + '
' if (document.getElementById('getWidth').clientWidth < 40) var textwidth = 40; else var textwidth = document.getElementById('getWidth').clientWidth; if (arrow == 'left') { text = ' ' + text; textwidth = textwidth + 8; } else if (arrow == 'right') { text = text + ' '; textwidth = textwidth + 8; } textwidth = textwidth + 24; defaultbutton = '
' textwidth = textwidth - 18; textwidth = textwidth + 'px'; defaultbutton += '' defaultbutton += '' + text + '' defaultbutton += '
' button.innerHTML = defaultbutton; if (title) $("#" + id).attr("title", title); else $("#" + id).attr("title", text); } function ifIe() { if (navigator.userAgent.match('MSIE')) return true } function fixHeight() { if ($('#divLateral').height() < $("#content__").height()) $('#divLateral').height($("#content__").height()) } //Code swiped from www.newgrounds.com function getInnerDimensions() { var dimensions = new Array(2); if(document.documentElement && document.documentElement.clientWidth) { dimensions[0] = document.documentElement.clientWidth; dimensions[1] = document.documentElement.clientHeight; } else if(self.innerWidth) { dimensions[0] = self.innerWidth; dimensions[1] = self.innerHeight; } else if(document.body) { dimensions[0] = document.body.clientWidth; dimensions[1] = document.body.clientHeight; } return(dimensions); } //Code swiped from www.newgrounds.com function getScrollDimensionsInfo() { var dimensions = new Array(2); if(window.innerHeight && window.scrollMaxY) { dimensions[0] = document.body.scrollWidth; dimensions[1] = window.innerHeight + window.scrollMaxY; } else if(document.body.scrollHeight > document.body.offsetHeight) { dimensions[0] = document.body.scrollWidth; dimensions[1] = document.body.scrollHeight; } else { dimensions[0] = document.body.offsetWidth; dimensions[1] = document.body.offsetHeight; } return(dimensions); } //Code swiped from www.newgrounds.com function getPageScrolledPosition() { var dimensions = new Array(2); if(self.pageYOffset) { dimensions[0] = self.pageXOffset; dimensions[1] = self.pageYOffset; } else if((document.documentElement) && (document.documentElement.scrollTop)) { dimensions[0] = document.documentElement.scrollLeft; dimensions[1] = document.documentElement.scrollTop; } else if(document.body) { dimensions[0] = document.body.scrollLeft; dimensions[1] = document.body.scrollTop; } return(dimensions); } function centerObject(id) { var obj = document.getElementById(id); var screenSize = getInnerDimensions(); var scrollPos = getPageScrolledPosition(); //center object in screen obj.style.left = ((screenSize[0] - obj.clientWidth) / 2) + scrollPos[0] + 'px'; obj.style.top = ((screenSize[1] - obj.clientHeight) / 2) + scrollPos[1] + 'px'; //checks if there's any negative value then set it to 0 if (parseInt(obj.style.top) < 0) obj.style.top = 0; if (parseInt(obj.style.left) < 0) obj.style.left = 0; } function fillObject(id) { var obj = document.getElementById(id); var scrollSize = getScrollDimensionsInfo(); obj.style.width = scrollSize[0] + 'px'; obj.style.height = scrollSize[1] + 'px'; } //Menu functions function sbmMenu(sUrl, sParam, sParam2) { document.getElementById("firstParam").value = sParam; document.getElementById("secParam").value = sParam2; formMenu = document.getElementsByName("frmMenu")[0]; formMenu.action = sUrl; formMenu.target = "_self"; formMenu.submit(); } //End function winOpen(sUrl, sParam) { window.open(sUrl, "SnapIn", 'toolbar=no, left=0, top=0, scrollbars=yes, resizeable=yes, width=797, height=520'); frmMenu.sParam.value = sParam } function findPos(obj) { var curleft = curtop = 0; if (obj) { if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } } return [curleft]; } function showMenu(idObj,show) { obj = document.getElementById(idObj); var nodes = obj.childNodes; var img; for (i=0;i= total) { menu[i].style.left = '-' + width + 'px'; } } for (i=0;i' + titulo + ''; document.getElementById('infocontent__').innerHTML = '' + msg + ''; boxinfo.style.display = 'block'; var sizebox = document.getElementById('gginfo__').clientHeight; setTimeout('triggerInfo(' + sizebox + ')',1000); } function reposinfo() { var boxinfo = document.getElementById('gginfo__'); var x_; if (getInnerDimensions()[0] >= 755) x_ = (getInnerDimensions()[0]-755)/2; else x_ = 0; boxinfo.style.right = x_ + 'px'; boxinfo.style.top = getInnerDimensions()[1] + getPageScrolledPosition()[1] - boxinfo.clientHeight; } function changeImage(x,obj) { obj.title = (x == 'ov' ? obj.title.replace('_up','_dw') : obj.title.replace('_dw','_up')); obj.style.background = 'url(' + obj.title + ')'; } function init() { hoverElement = document.getElementById('fecharTVGamegol'); hoverElement.onmouseover = function () { changeImage('ov',this) }; hoverElement.onmouseout = function () { changeImage('ou',this) }; hoverElement.style.cursor = 'pointer'; } function setTVGamegolPosition() { fillObject('backgroundTVGamegol'); centerObject('TVGamegol'); centerObject('flashTVGamegol'); } function showTVGamegol(iHTML) { var aObject = new Array(3); aObject = [ document.getElementById('backgroundTVGamegol'), document.getElementById('TVGamegol'), document.getElementById('flashTVGamegol') ]; //prevent scroll on small windows var screenSize = getInnerDimensions(); if (screenSize[1] >= 616) { window.onscroll = function() { setTVGamegolPosition(); } } window.onresize = function() { //clear onscroll event window.onscroll = null; //need to check screen size again setTimeout('showTVGamegol("resize");', 1); } //write flash content if (iHTML != 'resize') aObject[2].innerHTML = iHTML; //show objects for (i=0; i
' + sMsg + '
' } function _loading() { return "" } function carregarClans(){ var direcoes = []; var ids = []; $('.nomeEquipe[idClan]').each(function(i,e){ var id = $(e).attr('idClan'); var direcao = $(e).attr('direcao'); if(id) ids[ids.length] = id; direcoes[id] = direcao; }); if(ids.length > 0) $.ajax({ url: 'http://c1.gamegol.com.br/jsonClan.asp', data: {ids: ids.join(',')}, type: 'GET', dataType: 'jsonp', async: true, cache: false, success: function(d){ $.each(d.data, function(i, d){ if(d.nome) { if(direcoes[d.id] == 'direita') if (d.icone == 0) $('.nomeEquipe[idClan='+d.id+']').append(' '+d.nome+''); else $('.nomeEquipe[idClan='+d.id+']').append(' '+d.nome+''); else if (d.icone == 0) $('.nomeEquipe[idClan='+d.id+']').prepend(' '+d.nome+''); else $('.nomeEquipe[idClan='+d.id+']').prepend(' '+d.nome+''); } }); } }); } if(typeof($) != 'undefined') $(function(){ carregarClans(); });