function ChangePic(thePic) {
  if (thePic.src.indexOf("_Off") != -1) thePic.src = thePic.src.replace("_Off","_On");
  else thePic.src = thePic.src.replace("_On","_Off");
}

function FixedNum(num) {
  if (num<10) return "0"+num;
  else return num;
}

function ReturnDate() {
  var date = new Date();
  var returnStr = FixedNum(date.getDate())+"."+FixedNum(date.getMonth()+1)+"."+date.getFullYear();
  return returnStr;
}

var supportContent = new Array(16);
for (i=0;i<16;i++) {
  supportContent[i] = new Array(2);
}

function LoadContent(id) {
  document.getElementById("ContentTitle").innerHTML = supportContent[id][0];
  document.getElementById("ContentText").innerHTML = supportContent[id][1];
}

function Download_OS(OSName) {
  if (OSName!="Windows") OpenPopup(462,189,'Note.asp');
  else OpenPopup(195,104,'/tools/Download.asp?OSName=' + OSName)
//  document.getElementById("DownloadForm").OSName.value = OSName;
//  document.getElementById("DownloadForm").submit();
}

function OpenPopup(width,height,link) {
  
  window.open(link,"popupNum"+Math.floor(Math.random()*1000),"width="+width+",height="+height);
}

var visibleLayer="Introduction";
function ChangeTechContent(content) {
  document.getElementById("B_"+visibleLayer).onmouseover = function() {ChangePic(this);};
  document.getElementById("B_"+visibleLayer).onmouseout = function() {ChangePic(this);};
  document.getElementById("B_"+visibleLayer).src="images/B_"+visibleLayer+"_Off.jpg";

  document.getElementById("B_"+content).onmouseover = function() {void(0);};
  document.getElementById("B_"+content).onmouseout = function() {void(0);};
  document.getElementById("B_"+content).src="images/B_"+content+"_On.jpg";

  if (content=="TheSolution") document.getElementById("TechImg").src="images/Img_Technologies2.jpg";
  else if (content=="Introduction") document.getElementById("TechImg").src="images/Img_Technologies.jpg";
  else document.getElementById("TechImg").src="images/spacer.gif";
  document.getElementById("Content_Title").src="images/T_Technologies_"+content+".jpg";

  document.getElementById("Content_"+visibleLayer).style.visibility="hidden";
  document.getElementById("Content_"+visibleLayer).style.display="none";

  document.getElementById("Content_"+content).style.visibility="visible";
  document.getElementById("Content_"+content).style.display="block";

  visibleLayer=content;
}

function CreateFlashObject(source,width,height,trans) {
  document.writeln("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' align='middle'>");
  document.writeln("  <param name='allowScriptAccess' value='sameDomain' />");
  if (trans) document.writeln("  <param NAME='wmode' VALUE='transparent' />");
  document.writeln("  <param name='movie' value='"+source+"' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' />");
  document.writeln("  <embed src='"+source+"' quality='high' bgcolor='#ffffff' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
  document.writeln("</object>");
}

var lastButton;
function ChangeButtonStatus(button) {
  if (lastButton==null) lastButton=document.getElementById("HomePage");
  lastButton.onmouseover = function() {ChangePic(this);};
  lastButton.onmouseout = function() {ChangePic(this);};
  lastButton.src=lastButton.src.replace("_On","_Off");

  button.onmouseover = function() {void(0);};
  button.onmouseout = function() {void(0);};
  button.src=button.src.replace("_Off","_On");

  lastButton = button;
}