
 /**************************************************
  *                                                *
  *  Welcome to Sharp Tricks - Projects by carb0n  *
  *  --------------------------------------------  *
  *                                                *
  *  The following javascript was made by me but   *
  *  is free to use / edit / whatever without      *
  *  restriction.  Enjoy my site!! :-)             *
  *                                                *
  **************************************************/
  

orgTitle = document.title;
current_tab = "websites_tab";
cycle_up = true;

r1 = 230;
g1 = 230;
b1 = 230;

r2 = 230;
g2 = 230;
b2 = 230;

websites_html =
"<h2>Available Web Applications:</h2>" + 
"<div class=\"indented\">" + 
  "<table>" + 
    "<tr>" + 
      "<td class=\"web_select\"><a href=\"Locate/locate.aspx\"><img src=\"locate.png\" alt=\"IP Location Tool\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"tagmaker/\"><img src=\"tagmkr.jpg\" alt=\"Ares Tag Maker\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"HashTools/HashTools.aspx\"><img src=\"hash.png\" alt=\"HashTools Web Interface\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"Unicode/unicode.aspx\"><img src=\"unicode.png\" alt=\"Unicode Text Convertor v.2\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"ChannelList/ChannelList.aspx\"><img src=\"cl.jpg\" alt=\"UDP Web Channel List\" /></a></td>" + 
    "</tr>" + 
    "<tr>" + 
      "<td class=\"web_select\">IP Location Tool</td>" + 
      "<td class=\"web_select\">Ares Tag Maker</td>" + 
      "<td class=\"web_select\">HashTools Web Interface</td>" + 
      "<td class=\"web_select\">Unicode Text Convertor</td>" + 
      "<td class=\"web_select\">UDP Web Channel List</td>" + 
    "</tr>" + 
  "</table>" + 
"</div>";

software_html =
"<h2>Available Software:</h2>" + 
"<div class=\"indented\">" + 
  "<table>" + 
    "<tr>" + 
      "<td class=\"web_select\"><a href=\"grab.aspx?file=cb0t\"><img src=\"cbot.png\" alt=\"cb0t Ares Chat Client 2.26\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"grab.aspx?file=aresamp\"><img src=\"aresamp.png\" alt=\"Ares Amp 1.4\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"grab.aspx?file=scriptupdater\"><img src=\"supdate.png\" alt=\"ARCA Eclipse Script Updater\" /></a></td>" + 
      "<td class=\"web_select\"><a href=\"grab.aspx?file=sb0t\"><img src=\"sb0t.jpg\" alt=\"sb0t Ares TCP/UDP Chat Server 4.26\" /></a></td>" + 
    "</tr>" + 
    "<tr>" + 
      "<td class=\"web_select\">cb0t 2.26</td>" + 
      "<td class=\"web_select\">Ares Amp 1.4</td>" + 
      "<td class=\"web_select\">AE Script Updater</td>" + 
      "<td class=\"web_select\">sb0t 4.26 TCP/UDP<br /><a href=\"sb0t_update_history.txt\">click here for update log</a></td>" + 
    "</tr>" + 
  "</table>" + 
"</div>";

function GetTime() {

  time = new Date();
  timeArray = new Array(time.getHours(), time.getMinutes(), time.getSeconds());
  
  for (i = 0; i < timeArray.length; i++) {
    if (timeArray[i] < 10) {
      timeArray[i] = "0" + timeArray[i];
    }
  }
  
  return timeArray.join(":");
  
}

function UpdateTopicColor() {

  if (cycle_up) {
    if (r1 == r2 && g1 == g2 && b1 == b2) {
      cycle_up = false;
    } else {
      if (r2 != r1) r2--;
      if (g2 != g1) g2--;
      if (b2 != b1) b2--;
    }
  } else {
    if (r2 == 230 && g2 == 230 && b2 == 230) {
      cycle_up = true;
      r1 = Random(20, 220);
      g1 = Random(20, 220);
      b1 = Random(20, 220);
    } else {
      if (r2 != 230) r2++;
      if (g2 != 230) g2++;
      if (b2 != 230) b2++;
    }
  }

  result = new String("#");
  tmp = parseInt(r2).toString(16).toUpperCase();
  if (tmp.length < 2) tmp = "0" + tmp;
  result += tmp;
  tmp = parseInt(g2).toString(16).toUpperCase();
  if (tmp.length < 2) tmp = "0" + tmp;
  result += tmp;
  tmp = parseInt(b2).toString(16).toUpperCase();
  if (tmp.length < 2) tmp = "0" + tmp;
  result += tmp;
  
  return result;
  
}

function Timer1() {

  setTimeout("Timer1();", 1000);
  document.title = "[" + GetTime() + "] " + orgTitle;
  
}

function Timer2() {

  setTimeout("Timer2();", 10);
  document.getElementById("main_title").style.color = UpdateTopicColor();

}

function Random(min, max) {

  return min + Math.floor(Math.random() * ((max - min) + 1));

}

function Initialise() {

  document.getElementById("tab_screen_content").innerHTML = websites_html;
  Timer1();
  Timer2();
  
}

function Tabs_OnMouseOver(id) {

  document.getElementById(id).style.color = "#FF0000";
  
}

function Tabs_OnMouseOut(id) {

  document.getElementById(id).style.color = "#000000";
  
}

function Tabs_OnClick(id) {

  if (id == current_tab) return;
  
  current_tab = id;
  
  switch (current_tab) {
    case "websites_tab":
      document.getElementById("software_tab").style.backgroundColor = "#DDDDDD";
      document.getElementById("software_tab").style.borderColor = "#DDDDDD";
      document.getElementById("websites_tab").style.backgroundColor = "#999999";
      document.getElementById("websites_tab").style.borderColor = "#000000";
      document.getElementById("tab_screen_content").innerHTML = websites_html;
      break;
    case "software_tab":
      document.getElementById("websites_tab").style.backgroundColor = "#DDDDDD";
      document.getElementById("websites_tab").style.borderColor = "#DDDDDD";
      document.getElementById("software_tab").style.backgroundColor = "#999999";
      document.getElementById("software_tab").style.borderColor = "#000000";
      document.getElementById("tab_screen_content").innerHTML = software_html;
      break;
    default:
      break;
  }
  
}
