// ==UserScript==
// @name Battlefield Layout
// @namespace
// @description
// @include *main.gatewa.rs/battlefieldE.php*
// @include *main.gatewa.rs/battlelog.php*
// @include *main.gatewa.rs/attack.php*
// @version 1.2.1
// @author Devious Demolisher
// @grant none
// ==/UserScript==
///////////////////////////////////////////////////////////
///////////////HEADER BAR BUTTONS//////////////////////////
///////////////////////////////////////////////////////////
var FT = 0;
var tables = document.getElementsByTagName("table");
var BuyWeaponsTable;
var TrainTableCells;
var TargetTableCells;
if(document.URL.indexOf("ascended") == -1){
tables = document.getElementsByTagName("table");
for (var i = 0; i < tables.length; i++) {
if(tables[i].style.display == "none"){
FT++;
}
if(tables[i].innerHTML.indexOf('Buy Weapons') > -1 && tables[i].innerHTML.indexOf('Attack Weapons') > -1 && tables[i].innerHTML.indexOf('Defense Weapons') > -1) { BuyWeaponsCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('Rehabilitation Center') > -1 && tables[i].innerHTML.indexOf('Train Your Troops') > -1 && tables[i].innerHTML.indexOf('Training') > -1) { TrainTableCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('battlefieldE.php') > -1 && tables[i].innerHTML.indexOf('ENEMIES') > -1) { TargetTableCells = tables[i].getElementsByTagName("td"); }
}
//alert(FT);
var inputs = document.getElementsByTagName("input");
var alllinks = document.getElementsByTagName("a");
var imgs = document.getElementsByTagName("img");
imgs[0].height='0px';
imgs[1].height='0px';
tables[0+FT].height = "0px";
tables[0+FT].style.height = "0px";
tables[0+FT].style = "height: 0px;";
tables[1+FT].height = "0px";
tables[1+FT].style.height = "0px";
tables[1+FT].style = "height: 0px;";
var rows = tables[FT].getElementsByTagName("tr");
rows[0].height= "0px";
rows[0].style= "height:0px;";
var tcells = rows[0].getElementsByTagName("td");
tcells[0].height='0px';
//tcells[0].innerHTML = "";
tcells[1].height='0px';
tcells[2].height='0px';
tcells[3].height='0px';
tcells[4].height='0px';
tcells[5].height='0px';
tcells[6].height='0px';
tcells[7].height='0px';
//tcells[8].height='0px';
tcells[1].style="background-color: black; text-align: center;";
tcells[1].innerHTML = "";
tcells[2].innerHTML = "";
tcells[3].innerHTML = "";
tcells[4].innerHTML = "";
tcells[5].innerHTML = "";
tcells[6].style="background-color: black; text-align: center;";
tcells[6].innerHTML = "";
/*
tcells[6].innerHTML += "Attack Farm List ";
tcells[6].innerHTML += "Bank ";
tcells[6].innerHTML += "Armory ";
tcells[6].innerHTML += "MotherShip ";
tcells[6].innerHTML += "Training ";
tcells[6].innerHTML += "";
*/
var tcells = rows[1].getElementsByTagName("td");
tcells[0].innerHTML = "";
}
///////////////////////////////////////////////////////////
///////////////HEADER BAR BUTTONS//////////////////////////
///////////////////////////////////////////////////////////
var FT = 0;
var tables = document.getElementsByTagName("table");
var BuyWeaponsTable;
var TrainTableCells;
var TargetTableCells;
if(document.URL.indexOf("ascended") == -1){
tables = document.getElementsByTagName("table");
for (var i = 0; i < tables.length; i++) {
if(tables[i].style.display == "none"){
FT++;
}
if(tables[i].innerHTML.indexOf('Buy Weapons') > -1 && tables[i].innerHTML.indexOf('Attack Weapons') > -1 && tables[i].innerHTML.indexOf('Defense Weapons') > -1) { BuyWeaponsCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('Rehabilitation Center') > -1 && tables[i].innerHTML.indexOf('Train Your Troops') > -1 && tables[i].innerHTML.indexOf('Training') > -1) { TrainTableCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('battlefieldE.php') > -1 && tables[i].innerHTML.indexOf('ENEMIES') > -1) { TargetTableCells = tables[i].getElementsByTagName("td"); }
}
//alert(FT);
var inputs = document.getElementsByTagName("input");
var alllinks = document.getElementsByTagName("a");
var imgs = document.getElementsByTagName("img");
imgs[0].height='0px';
imgs[1].height='0px';
tables[0+FT].height = "0px";
tables[0+FT].style.height = "0px";
tables[0+FT].style = "height: 0px;";
tables[1+FT].height = "0px";
tables[1+FT].style.height = "0px";
tables[1+FT].style = "height: 0px;";
var rows = tables[FT].getElementsByTagName("tr");
rows[0].height= "0px";
rows[0].style= "height:0px;";
var tcells = rows[0].getElementsByTagName("td");
tcells[0].height='0px';
//tcells[0].innerHTML = "";
tcells[1].height='0px';
tcells[2].height='0px';
tcells[3].height='0px';
tcells[4].height='0px';
tcells[5].height='0px';
tcells[6].height='0px';
tcells[7].height='0px';
//tcells[8].height='0px';
tcells[1].style="background-color: black; text-align: center;";
tcells[1].innerHTML = "";
tcells[2].innerHTML = "";
tcells[3].innerHTML = "";
tcells[4].innerHTML = "";
tcells[5].innerHTML = "";
tcells[1].width='10%';
tcells[6].width='50%';
tcells[7].width='40%';
tcells[6].style="background-color: black; text-align: center;";
tcells[6].innerHTML = "";
tcells[6].innerHTML += "Command Center ";
tcells[6].innerHTML += "Attack Log ";
tcells[6].innerHTML += "Intel Log ";
tcells[6].innerHTML += "Bank ";
tcells[6].innerHTML += "";
tcells[7].style="background-color: black; text-align: center;";
tcells[7].innerHTML = "";
tcells[7].innerHTML += "Farm List ";
tcells[7].innerHTML += "Armory ";
tcells[7].innerHTML += "MotherShip ";
tcells[7].innerHTML += "Training ";
var rows = tables[FT+2].getElementsByTagName("map");
var tcells = rows[0].getElementsByTagName("area");
tcells[1].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[2].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[3].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[4].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[5].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[6].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[7].style="background-color: black; font-size: 12pt; text-align: center;";
tcells[1].innerHTML = "";
tcells[1].innerHTML += "";
tcells[2].innerHTML = "Farm List";
tcells[3].innerHTML = "";
tcells[4].innerHTML = "P 1 P 10 P 20 P 30";
tcells[5].innerHTML = "P 40 P 50 ";
tcells[6].innerHTML = "";
tcells[6].innerHTML += "";
tcells[7].innerHTML += "";
tcells[7].innerHTML += "P 60 P 70 P 80 P 90 P 100 P 110 ";
tcells[8].innerHTML = "Bank";
}
//new set
var rows = tables[FT+2].getElementsByTagName("tr");
var tcells = rows[0].getElementsByTagName("td");