/*Javascripts written by Frank V Bonura. Please do not remove this authorship tag and ask
permission first before using these scripts. Thank you in advance for your cooperation.*/

switch(screen.width)
      {
        case 640:
          var pw=screen.width*.8;
          break
        case 720:
          var pw=screen.width*.8;
          break
        case 800:
          var pw=screen.width*.8;
          break
        case 848:
          var pw=screen.width*.8;
          break
        case 960:
          var pw=screen.width*.8;
          break
        default:
          var pw=820;
      }
var n3=(screen.width*.5)-203;
document.write('<style>#Title1, #Crumbs {display:none;} div.Page {margin:0;border:0px;padding:0;width:' + pw + 'px;} div.Nav3{margin:10px auto 10px ' + n3 + 'px;} </style>');

function PageSetup(tier,mode)
  {
    var t="";for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
    switch(mode)
      {
        case 0:
          Bible(tier);
          Search(tier);
          Facebook(tier);
          break
        case 1:
          Bible(tier);
          break
        case 2:
          /* Blank bottom on home page */
          break
        default:
          Bible(tier);
      }
  }

function Header(tier,home,wing,vehicle,corp,anchor)
  {
    var t="";
    for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
    document.write('<table style=\"border:0;padding:0;border-collapse:collapse;margin: 0px auto;\"><tr><td class=\"ULB\"></td><td class=\"TSB\">');
    Crumbs(t,home,wing,vehicle,corp,anchor);
    document.write('</td><td class=\"URB\"></td></tr><tr><td class=\"LSB\"></td><td style=\"margin:0;border:0;padding:0;background:#FFFFFF;\">');
  }

function Footer(tier,mode)
  {
    var t="";for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
    switch(mode)
      {
        case 0:
          document.write('');
          break
        case 1:
          Stripes(tier,'');
          break
        case 2:
          document.write('<div style=\"text-align:center;\" class=\"RE1\"><span class=\"RE1\">Hover mouse over image for descriptions. Click for additional information.</span></div>');
          break
        case 3:
          Stripes(tier,'This area is still under construction. Some pop up labels have not been installed yet.');
          document.write('<div class=\"RE1\"><span class=\"RE1\">Hover mouse over image for descriptions. Click for additional information.</span></div>');
          break
        case 4:
          Stripes(tier,'This area is being overhauled. This image will be replaced.');
          document.write('<div class=\"RE1\"><span class=\"RE1\">Hover mouse over image for descriptions. Click for additional information.</span></div>');
          break
        default:
          document.write('Error - mode type not known.');
    }
    document.write('</td><td class=\"RSB\"></td></tr><tr><td class=\"LLB\"></td><td class=\"BSB\"></td><td class=\"LRB\"></td></tr></table>');
  }



function Crown(t)
  {
    var b=document.title;
    var c=b.slice(33);
    document.write("<div style=\"padding:0px 7px;height:32px;background:url(\'" + t + "Graphics/RE_Header.gif\') repeat-x center;margin:0px 0px;\"><div style=\"float:left;width: 33px;height:32px;background:url(\'" + t + "Graphics/Imperial_Symbol_30.gif\') no-repeat top left;\"></div><div style=\"float:right;width: 33px;height:32px;background:url(\'" + t + "Graphics/Rebel_Symbol_30.gif'); no-repeat top right;\"></div></div>")
  }



function Crumbs(t,home,wing,vehicle,corp,anchor)
  {
    if (document.getElementById('Crumbs')) {var cs1=document.getElementById('Crumbs').innerHTML;document.write(cs1);}
    else {Crumbs1(t,home,wing,vehicle,corp,anchor);}
  }
/* Remove Crumbs1 and the if/else condition in Crumbs after overhaul */
function Crumbs1(t,home,wing,vehicle,corp,anchor)
  {
    var Bt='<img style=\"margin:1px;vertical-align:middle;\" src=\"' + t + 'Graphics/Arrow_R_Small.gif\" />';
    var h=document.title;
    var a=h.slice(33);
    document.write('<div style=\"background:transparent;margin:0;padding:0;font-size:xx-small;color:#777777;\">' + Bt + '&nbsp;');
    if (home!=0)
      {
        document.write('<a href=\"' + t + 'Index.html\" title=\"Home\">Home</a>');
        switch(wing)
          {
            case 1:
              if(anchor!="Galleries")
                {
                  document.write(' ' + Bt + '&nbsp;<a href=\"' + t + 'Main/Galleries.html\" title=\"Galleries\">Galleries</a>');
                  switch(vehicle)
                    {
                      case 0:
                        var m=""; 
                      case 1:
                        var v="Space_Transports";
                        break
                      case 2:
                        var v="Starfighters";
                        break    
                      case 3:
                        var v="Walkers";
                        break    
                      case 4:
                        var v="Speeders";
                        break
                      case 5:
                        var v="Powersuits";
                        break         
                      default:
                        var v="Not Found";
                    }
                  if (vehicle!=0)
                    {
                      document.write(' ' + Bt + '&nbsp;<a href=\"' + t + 'Main/Galleries.html#' + v + '\" title=\"' + v + '\">' + v + '</a>');
                    }
                  switch(corp)
                    {
                      case 0:
                        var m="";               
                        break
                      case 6:
                        var m="Corellian_Engineering_Corp.";
                        break
                      case 10:
                        var m="Ghtroc_Industries";
                        break
                      case 16:
                        var m="Republic_Engineering_Corp.";
                        break           
                      case 20:
                        var m="Surronian";
                        break  
                      case 24:
                        var m="Telgorn";
                        break 
                      default:
                        var m="Not Found";
                    }
                  if (corp!=0)
                    {
                      document.write(' ' + Bt + '&nbsp;<a href=\"' + t + 'Main/Galleries.html#' + m + '\" title=\"' + m + '\">' + m + '</a>');
                    }  
                  if (anchor!=a&&a!="Galleries")
                    {
                  document.write(' ' + Bt + '&nbsp;<a href=\"#' + a + '\" title=\"' + a + '\">' + a + '</a>');
                    } 
                  document.write(' ' + Bt + '&nbsp;' + anchor);
                }
              else
                {
                  document.write(' ' + Bt + '&nbsp;Galleries');     
                }
              break
            case 2:
              if(anchor!="About Us")
                {
                  document.write(' ' + Bt + '&nbsp;<a href=\"' + t + 'Main/About_Us.html\" title=\"About Us\">About Us</a>');
                }
              document.write(' ' + Bt + '&nbsp;' + anchor);
              break    
            case 3:
              if(anchor!="News, Errata, and Updates")
                {
                  document.write(' ' + Bt + '&nbsp;<a href=\"' + t + 'Main/Updates.html\" title=\"News, Errata, and Updates\">News, Errata, and Updates</a>');
                }
              document.write(' ' + Bt + '&nbsp;' + anchor);
              break
            default:
              document.write(' ' + Bt + '&nbsp;Error Webpage - Not Found.'); 
          }
      }
    else
      {
      document.write('Home');      
      }
      document.write('</div>');

  }

function Stripes(tier,a)
  {
    var t="";
    for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
    if (a=='') {var a = 'This Area is Under Construction.';}
    document.write('<table style=\"margin:6px auto;\"><tr><td style=\"background:rgb(255,255,0) url(\'' + t + 'Graphics/Construction.gif\') repeat center center;padding:3px 8px;margin:6px auto;border:3px solid rgb(0,0,0);\"><div style=\"border:2px solid rgb(0,0,0);font-weight:bold;color:rgb(255,0,0);background-color:rgb(255,255,0);margin:6px auto;padding:2px 4px;text-align:center;\">' + a + '</div></td></tr></table>');
  }
function Bible(tier)
  {
    var a=Math.floor((Math.random()*35)+1);
    switch(a)
      {
        case 1:
          Scripture(tier,'In the beginning God created the heavens and the earth.','Genesis 1:1 NIV');
          break
        case 2:
          Scripture(tier,'For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord.','Romans 6:23 NIV');
          break
        case 3:
          Scripture(tier,'Jesus answered, \"I am the way and the truth and the life. No one comes to the Father except through me.\"','John 14:6 NIV');
          break
        case 4:
          Scripture(tier,'For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.','John 3:16 NIV');
          break
        case 5:
          Scripture(tier,'In the lips of him that hath understanding wisdom is found: but a rod is for the back of him that is void of understanding.','Proverbs 10:13 KJV');
          break
        case 6:
          Scripture(tier,'He that is void of wisdom despiseth his neighbour: but a man of understanding holdeth his peace.','Proverbs 11:12 KJV');
          break
        case 7:
          Scripture(tier,'He that tilleth his land shall be satisfied with bread: but he that followeth vain persons is void of understanding.','Proverbs 12:11 KJV');
          break
        case 8:
          Scripture(tier,'nor thieves nor the greedy nor drunkards nor slanderers nor swindlers will inherit the kingdom of God.','1 Corinthians 6:10 NIV');
          break
        case 9:
          Scripture(tier,'God made two great lights—the greater light to govern the day and the lesser light to govern the night. He also made the stars.','Genesis 1:16 NIV');
          break
        case 10:
          Scripture(tier,'I will make your descendants as numerous as the stars in the sky and will give them all these lands, and through your offspring all nations on earth will be blessed,','Genesis 26:4 NIV');
          break
        case 11:
          Scripture(tier,'Do not get drunk on wine, which leads to debauchery. Instead, be filled with the Spirit.','Ephesians 5:18 NIV');
          break
        case 12:
          Scripture(tier,'\"I see him, but not now; I behold him, but not near. A star will come out of Jacob; a scepter will rise out of Israel. He will crush the foreheads of Moab, the skulls of all the sons of Sheth.','Numbers 24:17 NIV');
          break
        case 13:
          Scripture(tier,'and asked, \"Where is the one who has been born king of the Jews? We saw his star in the east and have come to worship him\".','Matthew 2:2 NIV');
          break
        case 14:
          Scripture(tier,'He determines the number of the stars and calls them each by name.','Psalm 147:4 NIV');
          break
        case 15:
          Scripture(tier,'This was the appearance and structure of the wheels: They sparkled like chrysolite, and all four looked alike. Each appeared to be made like a wheel intersecting a wheel.','Ezekiel 1:16 NIV');
          break
        case 16:
          Scripture(tier,'He determines the number of the stars and calls them each by name.','Psalm 147:4 NIV');
          break
        case 17:
          Scripture(tier,'Saul then said to his attendants, \"Find me a woman who is a medium, so I may go and inquire of her.\" \"There is one in Endor,\" they said.','1 Samuel 28:7 NIV');
          break
        case 18:
          Scripture(tier,'So shall my word be that goeth forth out of my mouth: it shall not return unto me void, but it shall accomplish that which I please, and it shall prosper in the thing whereto I sent it.','Isaiah 55:11 KJV');
          break
        case 19:
          Scripture(tier,'I am not ashamed of the gospel, because it is the power of God for the salvation of everyone who believes: first for the Jew, then for the Gentile.','Romans 1:16 NIV');
          break
        case 20:
          Scripture(tier,'But I, when I am lifted up from the earth, will draw all men to myself.\"','John 12:32 NIV');
          break
        case 21:
          Scripture(tier,'All Scripture is God-breathed and is useful for teaching, rebuking, correcting and training in righteousness,','2 Timothy 3:16 NIV');
          break
        case 22:
          Scripture(tier,'Consequently, faith comes from hearing the message, and the message is heard through the word of Christ.','Romans 10:17 NIV');
          break
        case 23:
          Scripture(tier,'For the word of God is living and active. Sharper than any double-edged sword, it penetrates even to dividing soul and spirit, joints and marrow; it judges the thoughts and attitudes of the heart.','Hebrews 4:12 NIV');
          break
        case 24:
          Scripture(tier,'They replied, \"Believe in the Lord Jesus, and you will be saved — you and your household.\"','Acts 16:31 NIV');
          break
        case 25:
          Scripture(tier,'That if you confess with your mouth, \"Jesus is Lord,\" and believe in your heart that God raised him from the dead, you will be saved.','Romans 10:9 NIV');
          break
        case 26:
          Scripture(tier,'for, \"Everyone who calls on the name of the Lord will be saved.\"','Romans 10:13 NIV');
          break
        case 26:
          Scripture(tier,'for, \"For it is by grace you have been saved, through faith — and this not from yourselves, it is the gift of God — not by works, so that no one can boast.','Ephesians 2:8-9 NIV');
          break
        case 29:
          Scripture(tier,'In their fright the women bowed down with their faces to the ground, but the men said to them, \"Why do you look for the living among the dead? He is not here; he has risen! Remember how he told you, while he was still with you in Galilee:','Luke 24:5-6 NIV');
          break
        case 30:
          Scripture(tier,'Blessed are you when men hate you, when they exclude you and insult you and reject your name as evil, because of the Son of Man. Rejoice in that day and leap for joy, because great is your reward in heaven. For that is how their fathers treated the prophets.','Luke 6:22-23 NIV');
          break
        case 31:
          Scripture(tier,'Submit to God and be at peace with him; in this way prosperity will come to you.','JOB 22:21 NIV');
          break
        case 32:
          Scripture(tier,'Jesus answered them, "It is not the healthy who need a doctor, but the sick. I have not come to call the righteous, but sinners to repentance".','Luke 5:31-32 NIV');
          break
        case 33:
          Scripture(tier,'He who steals must steal no longer; but rather he must labor, performing with his own hands what is good, so that he will have something to share with one who has need.','Ephesians 4:28 NASB');
          break
        default:
          Scripture(tier,'For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.','John 3:16 NIV');
      }
  }

function Scripture(tier,a,verse)
  {
    var t="";
    for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
    if (a=='') {var a = 'Please add a Bible verse.';}
    if (verse=='') {var verse = 'Please add a Bible verse.';}
    document.write('<table style=\"border:0;padding:0;border-collapse:collapse;margin:0px auto;\"><tr><td style=\"text-align:center;margin:0;padding:0 3px;background-color:#EFEFEF;border:solid 1px;border-color:#AFAFAF;color:black;font:small serif;\"><b>&ldquo;</b> ' + a +' <b>&rdquo;</b> - <span style=\"font:xx-small sans-serif;\">' + verse + '</span></td></tr></table>');
  }

function Search(tier)
  {
      document.write('<div class=\"RE1\" style=\"padding:1px 10px;margin:4px 4px -12px auto;float:right;clear:both;border:2px solid #7F7F7F;\">');
      document.write('<form style=\"margin:1px;padding:0px;\" method=\"get\" name=\"searchform\" action=\"http://www.google.com/search\" target=\"_blank\">')
      document.write('<span class=\"RE1\">Site Search&#58;&nbsp;</span>')
      document.write('<input type=\"hidden\" name=\"sitesearch\" value=\"Deckplans.00sf.com\" />')
      document.write('<input alt=\"search\" type=\"text\" style=\"width:300px\" name=\"as_q\" size=\"20\" />&nbsp;<input style=\"width:1em;\" type=\"submit\" value=\"&#187;\" />')
      document.write('</form>')
      document.write('</div>')
  }

function Facebook(tier)
  {
    var t="";
    for (i = 0; i <= (tier-1); i++) {var t=t + "../";};
      document.write('<a href="http://www.facebook.com/pages/STAR-WARS-Deckplans-Aliance/168372163249889" alt="Visit us on Facebook" title="Visit us on Facebook"><img src=\"' + t + 'Graphics/Facebook.png\" /></a>')
  }
