function resize(clientWidth) { var elements = document.getElementsByClassName('resize'); for (var i = 0; i < elements.length; i++) { var elem = elements.item(i); var mySize = elem.getAttribute('data-resize'); if (mySize != undefined) { elem.style.width = Math.round(clientWidth * (mySize / 100) * 100) / 100 + 'px'; elem.style.height = Math.round(clientWidth * (mySize / 100) * 100) / 100 + 'px'; } } } function tournamentTable(clientWidth) { var elements = document.getElementsByClassName('tournamentTable'); for (var i = 0; i < elements.length; i++) { var elem = elements.item(i); var tmp = elem.getAttribute('data-tournament'); if (tmp != undefined) { var tmpArray = tmp.split(','); var mySizeX = parseFloat(tmpArray[0]); var mySizeY = parseFloat(tmpArray[1]); elem.style.width = Math.round(clientWidth * (mySizeX / 100) * 100) / 100 + 'px'; elem.style.height = Math.round(clientWidth * (mySizeY / 100) * 100) / 100 + 'px'; } } } function tournamentLine(clientWidth) { var elements = document.getElementsByClassName('tournamentLine'); for (var i = 0; i < elements.length; i++) { var elem = elements.item(i); var tmp = elem.getAttribute('data-tournamentline'); if (tmp != undefined) { var tmpArray = tmp.split(','); var myTopRange = parseFloat(tmpArray[0]); var myBottomRange = parseFloat(tmpArray[1]); var myRightRange = parseFloat(tmpArray[2]); var myLeftRange = parseFloat(tmpArray[3]); var redFlg = parseFloat(tmpArray[4]); if (redFlg == 1) { elem.style.borderTop = Math.round(clientWidth * (myTopRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderBottom = Math.round(clientWidth * (myBottomRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderRight = Math.round(clientWidth * (myRightRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderLeft = Math.round(clientWidth * (myLeftRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderColor = "#ff0000"; } else { elem.style.borderTop = Math.round(clientWidth * (myTopRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderBottom = Math.round(clientWidth * (myBottomRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderRight = Math.round(clientWidth * (myRightRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderLeft = Math.round(clientWidth * (myLeftRange / 100) * 100) / 100 + 'px' + ' solid'; elem.style.borderColor = "#b9b9b9"; } } } }