// ==UserScript==
// @name Main Layout
// @namespace
// @description
// @include *main.gatewa.rs/bank.php*
// @include *main.gatewa.rs/armory.php*
// @include *main.gatewa.rs/attacklog.php
// @include *main.gatewa.rs/intel.php
// @include *main.gatewa.rs/inbox.php*
// @version 1.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 ";
}
//new set
var rows = tables[FT+2].getElementsByTagName("tr");
var tcells = rows[0].getElementsByTagName("td");