var useWidth = 150;
var levelDepth =0;
var onLevel = -1;
var useBorder = 2;
var holdMenuLevel = "";
var paddingAmount = 2;
var borderAmount = 2;
var adjustTop = 0;
var menuIdi = 0;
var useFontSize = 14;
var useFontSizeS = "";
var divHeight = 0;
var heartBeat = 0;
var doActions = 0;
var heartBeatTimer = 0;
var menuActive = 0;
var menuLeveli = 0;
var menuRootId = "";
var menuWidths = new Array();
var menuUnderId = new Array();
var menuTableTitle = new Array();
var menuTableURL = new Array();
var menuTableLevel = new Array();
var menuTableHasChildren = new Array();
var menuTableUnderId = new Array();
var menuTableBackground = new Array();
var menuTableFontColor = new Array();
var menuTableBackgroundi = 0;
var onMenuTableBackgroundi = 0;
var fakeMenu = new Array();
var fakeMenui = 0;
var onFakeMenui = 0;
var textDoerOn=1;
var textDoerFinish=0;
var textDoerMessage = "GoldBorder was founded to offer services in technology and graphics.~~Thank you for visiting.";

function setMenuTableBackground(newBackValue,newFontColor)
{
menuTableFontColor[menuTableBackgroundi] = newFontColor;
menuTableBackground[menuTableBackgroundi++] = newBackValue;
}

function openMenu(useTitle,useURL)
{
menuTableTitle[menuIdi] = useTitle;
menuTableURL[menuIdi] = useURL;
menuTableLevel[menuIdi] = menuLeveli;
if (parseInt(menuLeveli)>levelDepth)
levelDepth = parseInt(menuLeveli);
menuTableHasChildren[menuIdi] = 0;
menuUnderId[menuLeveli] = menuIdi+"";
if (menuLeveli>0)
{
menuTableUnderId[menuIdi] = menuUnderId[menuLeveli-1];
menuTableHasChildren[parseInt(menuUnderId[menuLeveli-1])] = 1;
}
else
menuTableUnderId[menuIdi] = "";
menuIdi++
menuLeveli++;
}

function openDiv(useId,menuLevel)
{
var displayStr = "";
var targetStr = "";
var divId = "";
var tempi = parseInt(useFontSize)+4;
if (parseInt(menuLevel)!=0)
displayStr = "none";
divId = "menuDiv"+useId;

targetStr+="\n<style>";
targetStr+="\n#"+divId;
targetStr+="\n {";
if (menuLevel!="0")
targetStr+="\n position:absolute;";
targetStr+="\n z-index:"+menuLevel+";";
divHeight = parseInt(useFontSize)+(parseInt(useBorder)*3);
useFontSizeS = divHeight+"";
targetStr+="\n height:"+useFontSizeS+"px;";
targetStr+="\n width:330px;";
targetStr+="\n }";
targetStr+="\n</style>";

holdMenuLevel = menuLevel;
targetStr+="\n<div id=\""+divId+"\"";
targetStr+=" style=\"display:";
if (parseInt(menuLevel)!=0)
targetStr+="none";

if (menuTableURL[parseInt(useId)]!="")
targetStr+=";cursor:hand";
//else
//targetStr+=";font-weight:bold";
targetStr+=";text-align:right";
menuTableURL[menuIdi]
targetStr+="\"";
targetStr+=" class=\"";

if (menuTableBackgroundi==0 || parseInt(menuLevel)>=menuTableBackgroundi)
targetStr+="defaultStyle";
else
{
targetStr+="backStyle"+parseInt(menuLevel);
}
targetStr+="\"";
targetStr+=" onMouseout=\"deactivateMenu(this,"+parseInt(menuLevel)+")\" onMouseover=\"checkMenu('"+useId+"','"+menuLevel+"',this)\"";

if (menuTableURL[parseInt(useId)]!="")
{
targetStr+=" onClick=\"document.location='"+menuTableURL[parseInt(useId)]+"'\"";
}
targetStr+=">&nbsp;";
menuRootId=divId;
document.write(targetStr);
}


function closeMenus(whichId,menuLevel)
{
var looper = 0;
var displayStr = "";
var tempId = "";
displayStr = "none";
for (looper=0;looper<parseInt(menuIdi);looper++)
 {
 if (parseInt(menuTableLevel[looper])!=0
     && parseInt(menuTableLevel[looper])>menuLevel
    )
  {
  if (menuTableUnderId[looper]!=whichId)
   {
   tempId = "menuDiv"+looper;
   document.getElementById(tempId).style.display=displayStr;
   }
  }
 }
}

function checkPage()
{
var looper;
var looper2;
var textLooper=0;
var returnStr="";
if (doActions!=0)
{
 if (menuActive==0)
 {
  heartBeatTimer++;
  if (heartBeatTimer>10)
  {
   heartBeatTimer = 0;
   closeMenus("",0);
  }
 }
}

if (textDoerOn>0)
{
for (textLooper=0;textLooper<=textDoerOn-textDoerFinish;textLooper++)
{
 if (textDoerMessage.charAt(textLooper)=='~')
  {
   returnStr+="<br>";
  }
 else
  {
if (textDoerFinish==0)
{
   if (textLooper==textDoerOn-14)
    {
     returnStr+="<span style=\"color:#110000\">";
    }
   if (textLooper==textDoerOn-13)
    {
     returnStr+="<span style=\"color:#220000\">";
    }
   if (textLooper==textDoerOn-12)
    {
     returnStr+="<span style=\"color:#330000\">";
    }
   if (textLooper==textDoerOn-11)
    {
     returnStr+="<span style=\"color:#440000\">";
    }
   if (textLooper==textDoerOn-10)
    {
     returnStr+="<span style=\"color:#550000\">";
    }
   if (textLooper==textDoerOn-9)
    {
     returnStr+="<span style=\"color:#660000\">";
    }
   if (textLooper==textDoerOn-8)
    {
     returnStr+="<span style=\"color:#770000\">";
    }
   if (textLooper==textDoerOn-7)
    {
     returnStr+="<span style=\"color:#880000\">";
    }
   if (textLooper==textDoerOn-6)
    {
     returnStr+="<span style=\"color:#990000\">";
    }
   if (textLooper==textDoerOn-5)
    {
     returnStr+="<span style=\"color:#AA0000\">";
    }
   if (textLooper==textDoerOn-4)
    {
     returnStr+="<span style=\"color:#BB0000\">";
    }
   if (textLooper==textDoerOn-3)
    {
     returnStr+="<span style=\"color:#CC0000\">";
    }
   if (textLooper==textDoerOn-2)
    {
     returnStr+="<span style=\"color:#DD0000\">";
    }
   if (textLooper==textDoerOn-1)
    {
     returnStr+="<span style=\"color:#EE0000\">";
    }
   if (textLooper==textDoerOn)
    {
     returnStr+="<span style=\"text-decoration:underline;color:#FF0000\">";
    }
}
   returnStr+=textDoerMessage.charAt(textLooper);
if (textDoerFinish==0)
{
   if (textLooper==textDoerOn-14
       || textLooper==textDoerOn-13
       || textLooper==textDoerOn-12
       || textLooper==textDoerOn-11
       || textLooper==textDoerOn-10
       || textLooper==textDoerOn-9
       || textLooper==textDoerOn-8
       || textLooper==textDoerOn-7
       || textLooper==textDoerOn-6
       || textLooper==textDoerOn-5
       || textLooper==textDoerOn-4
       || textLooper==textDoerOn-3
       || textLooper==textDoerOn-2
       || textLooper==textDoerOn-1
       || textLooper==textDoerOn
      )
    {
     returnStr+="</span>";
    }
}
  }
}
document.getElementById("textDoerDiv").innerHTML=returnStr;
if (textDoerFinish==1)
{
textDoerOn++;
}
if (textDoerOn==textDoerMessage.length)
 {
  textDoerFinish=1;
 }
else if (textDoerOn>textDoerMessage.length)
 {
  textDoerOn=0;
  textDoerFinish=0;
 }
else
 {
  textDoerOn++;
 }
}

heartBeat++;
flipThumbs();
setTimeout("checkPage()",30);
}

function switchColors(whichDiv,flag)
{
if (flag==0)
{
}
else
{
}
}

function checkMenu(underId,menuLevel,whichDiv)
{
var looper = 0;
var tempId = "";
var tempId2 = "";
var displayStr = "";
var lastLevel = 0;
var tempVal = "";
var firstFound = 0;

menuActive = 1;
heartBeatTimer = 0;
closeMenus(underId,menuLevel);

whichDiv.style.borderLeft = "#000000 2px solid";
whichDiv.style.borderTop = "#000000 2px solid";
whichDiv.style.borderRight = "#BBBBBB 2px solid";
whichDiv.style.borderBottom = "#BBBBBB 2px solid";
whichDiv.style.backgroundColor = "#960000";
whichDiv.style.color="#ffffff";

displayStr = "";
ajustTop=0;
firstFound=0;
for (looper=0;looper<parseInt(menuIdi);looper++)
 {
 if (parseInt(menuTableLevel[looper])!=0)
  {
  if (menuTableUnderId[looper]==underId)
   {
   if (firstFound==0)
    adjustTop=0;
   firstFound++;
   tempId = "menuDiv"+looper;
   tempId2 = "menuDiv"+underId;
   document.getElementById(tempId).style.top=parseInt(document.getElementById(tempId2).offsetTop)+adjustTop;

   document.getElementById(tempId).style.left=parseInt(document.getElementById(tempId2).offsetLeft)+parseInt(document.getElementById(tempId2).clientWidth);


   adjustTop+=parseInt(document.getElementById("menuDiv0").clientHeight);
   adjustTop+=(parseInt(useBorder)*2);
   if (navigator.appName=="Microsoft Internet Explorer")
   adjustTop-=1;

   document.getElementById(tempId).style.display=displayStr;
   lastLevel = parseInt(menuTableLevel[looper]);
   if (document.getElementById(tempId).style.zIndex!=2)
    {
    if (looper%2)
    slideOpenMenu(parseInt(looper),parseInt(useWidth));
    else
    slideOpenMenu(parseInt(looper),0);
    }
   }
  }
 }
}

function slideOpenMenu(whichDiv,usingWidth)
{
var commandStr = "";
var tempId = "menuDiv"+whichDiv;
var divi = parseInt(whichDiv);
var widthi = parseInt(usingWidth);
document.getElementById(tempId).style.zIndex = 2;
if (divi%2)
document.getElementById(tempId).style.clip = "rect(0px "+useWidth+"px 24px "+widthi+"px)";
else
document.getElementById(tempId).style.clip = "rect(0px "+widthi+"px 24px 0px)";
if (divi%2)
usingWidth=parseInt(usingWidth)-10;
else
usingWidth=parseInt(usingWidth)+10;
divi = parseInt(whichDiv);
widthi = parseInt(usingWidth);
if (divi%2)
{
if (widthi>0)
setTimeout("slideOpenMenu("+divi+","+widthi+",1)",30);
else
{
document.getElementById(tempId).style.zIndex = 1;
document.getElementById(tempId).style.clip = "rect(0px "+useWidth+"px 24px 0px)";
}
}
else
{
if (widthi<=parseInt(useWidth))
setTimeout("slideOpenMenu("+divi+","+widthi+",1)",30);
else
{
document.getElementById(tempId).style.zIndex = 1;
document.getElementById(tempId).style.clip = "rect(0px "+useWidth+"px 24px 0px)";
}
}
}

function writeTitle(useTitle,useURL)
{
var targetStr = "";
targetStr+="\n";
//if (useURL!="")
//targetStr+="<a href=\""+useURL+"\" class=\"noStyle\">";
targetStr+=useTitle;
//if (useURL!="")
//targetStr+="</a>";
document.write(targetStr);
}

function menuItem(useTitle,useURL)
{
}
function closeMenu()
{
menuLeveli--;
}

function closeDiv()
{
document.write("\n&nbsp;</div>");
}

function displayMenu()
{
var looper = 0;
var looper2 = 0;
var holdMenuTableLevel = 0;
var tempId = "";
var tempId2 = "";
var targetStr = "";

var statStr = "";
statStr+=navigator.appCodeName;
statStr+="\n";
statStr+=navigator.appName
statStr+="\n";
statStr+=navigator.appMinorVersion
statStr+="\n";
statStr+=navigator.cpuClass
statStr+="\n";
statStr+=navigator.platform
statStr+="\n";
statStr+=navigator.plugins
statStr+="\n";
statStr+=navigator.opsProfile
statStr+="\n";
statStr+=navigator.userProfile
statStr+="\n";
statStr+=navigator.systemLanguage
statStr+="\n";
statStr+=navigator.userLanguage
statStr+="\n";
statStr+=navigator.appVersion
statStr+="\n";
statStr+=navigator.userAgent
statStr+="\n";
//alert(statStr);

targetStr+="\n<style>";
for (looper=0;looper<parseInt(menuTableBackgroundi);looper++)
{
targetStr+="\n.backStyle"+looper;
targetStr+="\n {";
if (menuTableBackground[looper].charAt(0)=='u')
targetStr+="\n background-image:"+menuTableBackground[looper]+";";
else
targetStr+="\n background-color:"+menuTableBackground[looper]+";";
targetStr+="\n color: "+menuTableFontColor[looper]+";";
targetStr+="\n border-left: #BBBBBB "+borderAmount+"px solid;";
targetStr+="\n border-top: #BBBBBB "+borderAmount+"px solid;";
targetStr+="\n border-right: #000000 "+borderAmount+"px solid;";
targetStr+="\n border-bottom: #000000 "+borderAmount+"px solid;";
targetStr+="\n padding: "+paddingAmount+"px";
targetStr+="\n text-decoration:none;";
useFontSizeS = useFontSize;
targetStr+="\n font-size:"+useFontSizeS+"px;";
targetStr+="\n }";
}
targetStr+="\n</style>";
document.write(targetStr);

for (looper=0;looper<parseInt(menuIdi);looper++)
 {
 openDiv(looper,menuTableLevel[looper]);
 writeTitle(menuTableTitle[looper],menuTableURL[looper]);
 if (menuTableHasChildren[looper]!=0)
 document.write(" &#187;");
 closeDiv();
 onLevel = parseInt(menuTableLevel[looper]);
 }

for (looper=0;looper<parseInt(menuIdi);looper++)
 {
tempId = "menuDiv"+looper;
document.getElementById(tempId).style.width = parseInt(useWidth);
}

doActions = 1;
}

function deactivateMenu(whichDiv,levelUsed)
{
if (menuTableBackground[parseInt(levelUsed)].charAt(0)=='u')
{
whichDiv.style.background = menuTableBackground[parseInt(levelUsed)];
//alert(menuTableBackground[parseInt(levelUsed)]);
}
else
whichDiv.style.backgroundColor = menuTableBackground[parseInt(levelUsed)];
whichDiv.style.color=menuTableFontColor[parseInt(levelUsed)];
whichDiv.style.borderLeft = "#BBBBBB 2px solid";
whichDiv.style.borderTop = "#BBBBBB 2px solid";
whichDiv.style.borderRight = "#000000 2px solid";
whichDiv.style.borderBottom = "#000000 2px solid";
switchColors(whichDiv,1);
menuActive = 0;
}

function setFontSize(newSize)
{
useFontSize = parseInt(newSize);
}

function setBorder(newSize)
{
useBorder = newSize;
}

function setWidth(newSize)
{
useWidth = newSize;
}


function highlightChoice(theObject,flag,cellId,theMessage)
 {
 if (startActions==1)
  {
 if (!flag)
  {
 if (theMessage)
  {
//  theObject.style.backgroundColor = "#FDC53A";
  theObject.style.color = "red";
  document.getElementById('guySpeaks').style.visibility = 'visible';
  document.getElementById('guySpeaksBack').style.visibility = 'visible';
  document.getElementById('guySpeaks').style.top = theObject.offsetTop+50;
  document.getElementById('guySpeaksBack').style.top = theObject.offsetTop+55;
  document.getElementById('guySpeaks').style.left = document.getElementById('menuDiv').offsetLeft-360;
  document.getElementById('guySpeaksBack').style.left = document.getElementById('menuDiv').offsetLeft-355;
  guySpeaksLeft = parseInt(document.getElementById('guySpeaks').style.left);
  document.getElementById('guySpeaksMessage').innerHTML = theMessage;
  document.getElementById('guySpeaksMessageBack').innerHTML = theMessage;
  colorTable[0] = 0;
  colorTable[1] = 0;
  colorTable[2] = 0;
  colorTable[3] = 0;
  colorTable[4] = 0;
  colorTable[5] = 0;
  document.getElementById('guySpeaksMessage').style.color = "#ffffff";
  document.getElementById('guySpeaksMessage').style.fontSize = "2px";
}
  }
 else
  {
//  theObject.style.backgroundImage = "pattern6b.jpg";
  theObject.style.color = "#ffffff";

  document.getElementById('guySpeaks').style.visibility = 'hidden';
  document.getElementById('guySpeaksBack').style.visibility = 'hidden';
  }
}
 }
