

function tabber(BTN)
{
   var continue_anyway = "yes";

   if(universal_error_flag == 0)
   {

      if((checkFontSize() == "problem")&&(fontsize_warned == 0))
      {
         window.document.button_factory.set_fontsize.style.backgroundColor = errorBoxColor;
         window.document.button_factory.set_fontsize.style.color = errorFontColor;

         if(confirm("You have specified a button width/height without specifying a font size. This could be a problem.\n\nIf a browser should happen to render the button using a larger default font size, part of your button text might get cut off. The best solution in this case is to define the font size in addition to the button dimensions.\n\nPress OK to stop and enter a font size, or press Cancel to continue regardless (If you choose to continue regardless, you won\'t be warned of this potential problem again. At least not during this session.)"))
         {
            continue_anyway = "no";
            window.document.button_factory.set_fontsize.focus();
         }
         else
         {
            continue_anyway = "yes";
            fontsize_warned = 1;
            window.document.button_factory.set_fontsize.style.backgroundColor = "";
            window.document.button_factory.set_fontsize.style.color = "";
         }
      }

      if((BTN == 'button1')&&(continue_anyway == "yes"))
      {
         tabber_sub(BTN);
         window.document.getElementById('testarea_div').style.display = 'block';
         window.document.getElementById('section1_div').style.display = 'block';
         if(filter_enabled_flag == "yes") { window.document.getElementById('gradient_controls').style.display = 'inline'; }

      }
      else if((BTN == 'button2')&&(continue_anyway == "yes"))
      {
         tabber_sub(BTN);
         window.document.getElementById('testarea_div').style.display = 'block';
         window.document.getElementById('section2_div').style.display = 'block';
         if(filter_enabled_flag == "yes") { window.document.getElementById('gradient_controls2').style.display = 'inline'; }
      }
      else if((BTN == 'button3')&&(continue_anyway == "yes"))
      {
         tabber_sub(BTN);
         window.document.getElementById('testarea_div').style.display = 'block';
         window.document.getElementById('section3_div').style.display = 'block';
      }
      else if((BTN == 'button4')&&(continue_anyway == "yes"))
      {
         tabber_sub(BTN);
         window.document.getElementById('testarea_div').style.display = 'none';
         window.document.getElementById('section4_div').style.display = 'block';
      }
      else if((BTN == 'button5')&&(continue_anyway == "yes"))
      {
         tabber_sub(BTN);
         window.document.getElementById('testarea_div').style.display = 'none';
         window.document.getElementById('section5_div_heading').style.display = 'block';
         window.document.getElementById('section5_div').style.display = 'block';
      }
   }
   else
   {
      alert("Please correct errors before proceeding.");
   }


}




function tabber_sub(BTN)
{
   window.document.tabform.button1.style.height = '18px';
   window.document.tabform.button2.style.height = '18px';
   window.document.tabform.button3.style.height = '18px';
   window.document.tabform.button4.style.height = '18px';
   window.document.tabform.button5.style.height = '18px';

   window.document.tabform.button1.style.borderBottomColor = '#aea998';
   window.document.tabform.button2.style.borderBottomColor = '#aea998';
   window.document.tabform.button3.style.borderBottomColor = '#aea998';
   window.document.tabform.button4.style.borderBottomColor = '#aea998';
   window.document.tabform.button5.style.borderBottomColor = '#aea998';

   window.document.tabform.button1.style.backgroundColor = '#e8e5d4';
   window.document.tabform.button2.style.backgroundColor = '#e8e5d4';
   window.document.tabform.button3.style.backgroundColor = '#e8e5d4';
   window.document.tabform.button4.style.backgroundColor = '#e8e5d4';
   window.document.tabform.button5.style.backgroundColor = '#e8e5d4';

   window.document.tabform.button1.style.color = '#7e7968';
   window.document.tabform.button2.style.color = '#7e7968';
   window.document.tabform.button3.style.color = '#7e7968';
   window.document.tabform.button4.style.color = '#7e7968';
   window.document.tabform.button5.style.color = '#7e7968';

   window.document.tabform.button1.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe2ddcc', EndColorStr='#FFf0eddc')";
   window.document.tabform.button2.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe2ddcc', EndColorStr='#FFf0eddc')";
   window.document.tabform.button3.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe2ddcc', EndColorStr='#FFf0eddc')";
   window.document.tabform.button4.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe2ddcc', EndColorStr='#FFf0eddc')";
   window.document.tabform.button5.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe2ddcc', EndColorStr='#FFf0eddc')";


   eval("window.document.tabform." + BTN + ".style.height = '22px'");
   eval("window.document.tabform." + BTN + ".style.backgroundColor = '#f7f5e8'");
   eval("window.document.tabform." + BTN + ".style.color = '#000000'");
   eval("window.document.tabform." + BTN + ".style.borderBottomColor = '#f7f5e8'");
   eval("window.document.tabform." + BTN + ".style.filter = \"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFe8e5d4', EndColorStr='#FFf7f5e8')\"");
   eval("window.document.tabform." + BTN + ".blur()");


   window.document.getElementById('section1_div').style.display = 'none';
   window.document.getElementById('section2_div').style.display = 'none';
   window.document.getElementById('section3_div').style.display = 'none';
   window.document.getElementById('section4_div').style.display = 'none';
   window.document.getElementById('section5_div').style.display = 'none';
   window.document.getElementById('section5_div_heading').style.display = 'none';
}






var btn_msg_flag = 0;
function btnMessage()
{
   if(btn_msg_flag == 0) { alert("These buttons don\'t really do anything... but they look kinda cool, don\'t you think?"); btn_msg_flag++; }
   else if(btn_msg_flag == 1) { alert("Like I said, these buttons don\'t really do anything."); btn_msg_flag++; }
   else if(btn_msg_flag == 2) { alert("Hey bucko... you can click them all you want, but they\'re still not gonna do anything."); btn_msg_flag++; }
   else if(btn_msg_flag == 3) { alert("Dude, you need a hobby."); btn_msg_flag++; }
   else if(btn_msg_flag == 4) { alert("Can anyone see you clicking the silly little buttons over and over?"); btn_msg_flag++; }
   else if(btn_msg_flag == 5) { alert("Are you at work?"); btn_msg_flag++; }
   else if(btn_msg_flag == 6) { alert("Are you wasting valuable company time?"); btn_msg_flag++; }
   else if(btn_msg_flag == 7) { alert("Look behind you."); btn_msg_flag++; }
   else if(btn_msg_flag == 8) { alert("Ha! Did you look?"); btn_msg_flag++; }
   else if(btn_msg_flag == 9) { alert("Ok, you and I both need to stop this nonsense."); btn_msg_flag++; }
   else if(btn_msg_flag == 10) { alert("On the count of three we\'ll stop."); btn_msg_flag++; }
   else if(btn_msg_flag == 11) { alert("One..."); btn_msg_flag++; }
   else if(btn_msg_flag == 12) { alert("Two..."); btn_msg_flag++; }
}


function initDesigner()
{
   if(window.document.getElementById('loading_message_div').style.filter)
   {
      filter_enabled_flag = "yes";
   }

   window.document.getElementById('loading_message_div').style.display = 'none';
   window.document.getElementById('wrapper_table').style.display = 'block';
   window.document.getElementById('section1_div').style.display = 'block';
}



function checkFontSize()
{
   if(((window.document.button_factory.set_buttonheight.value)||(window.document.button_factory.set_buttonwidth.value))&&(!window.document.button_factory.set_fontsize.value))
   {
      return "problem";
   }
   else
   {
      return "noproblem";
   }
}





