// +----------------------------------------------+ //
// |  Copyright©2009, Steven Douglas Huddleston   | //
// |             All Rights Reserved              | //
// | No portion of this code can be copied, used, | //
// | published or reproduced in any way without   | //
// | the expressed written consent of the author. | //
// +----------------------------------------------+ //
// |       VibraCorp 3077 Catalogue Control       | //
// +----------------------------------------------+ //

NUM=0;
LNK=0;
BLNK=1;
IWL='' + window.location;
if (IWL.lastIndexOf("vcglobes") > 0) NUM=1;
if (IWL.lastIndexOf("projectr") > 0) NUM=2;
if (IWL.lastIndexOf("audiovis") > 0) NUM=3;
if (IWL.lastIndexOf("autochef") > 0) NUM=4;
if (IWL.lastIndexOf("translat") > 0) NUM=5;
if (IWL.lastIndexOf("mmessage") > 0) NUM=6;
if (IWL.lastIndexOf("pultrong") > 0) NUM=7;
if (IWL.lastIndexOf("globbots") > 0) NUM=8;

link=new Array;
link[ 0]=new Image; link[ 0].src="img/igtb0.gif";
link[ 1]=new Image; link[ 1].src="img/igtb1.gif";
link[ 2]=new Image; link[ 2].src="img/notice0.gif";
link[ 3]=new Image; link[ 3].src="img/notice1.gif";
link[ 4]=new Image; link[ 4].src="menu/vcg0.gif";
link[ 5]=new Image; link[ 5].src="menu/vcg1.gif";
link[ 6]=new Image; link[ 6].src="menu/pro0.gif";
link[ 7]=new Image; link[ 7].src="menu/pro1.gif";
link[ 8]=new Image; link[ 8].src="menu/aud0.gif";
link[ 9]=new Image; link[ 9].src="menu/aud1.gif";
link[10]=new Image; link[10].src="menu/aut0.gif";
link[11]=new Image; link[11].src="menu/aut1.gif";
link[12]=new Image; link[12].src="menu/tra0.gif";
link[13]=new Image; link[13].src="menu/tra1.gif";
link[14]=new Image; link[14].src="menu/mme0.gif";
link[15]=new Image; link[15].src="menu/mme1.gif";
link[16]=new Image; link[16].src="menu/pul0.gif";
link[17]=new Image; link[17].src="menu/pul1.gif";
link[18]=new Image; link[18].src="menu/glo0.gif";
link[19]=new Image; link[19].src="menu/glo1.gif";
link[20]=new Image; link[20].src="img/order0.gif";
link[21]=new Image; link[21].src="img/order1.gif";

var ImgSrc = new Array( "", "vcglobes.gif", "projectr.gif", "audiovis.gif", "autochef.gif", "translat.gif", "mmessage.gif", "pultrong.jpg", "globbots.jpg" );
var ImgTtl = new Array( document.title, "Personal Vibracon Globes", "Vibra Image Projector", "Audio Visual Unit", "Automatic Chef", "Vibra Pocket Translator", "The Magic Message", "Pultron Gun Stunner", "Globe Robots" );
var ImgNdx = new Array( "", "vcg", "pro", "aud", "aut", "tra", "mme", "pul", "glo" );
var ImgLnk = new Array( 0, 4, 6, 8, 10, 12, 14, 16, 18 );
var vibralogo = '<img id="vibracorp" src="igtbscan/vibrasml.gif" alt="Vibracorp Logo" /><br />';
var vibrastmp = '<img id="vibraweb" onload="FadeIn();" src="img/vibra.gif" alt="Vibra Corporation, Dept. 7Y, Vibra Corporation, Vibra Dome, Africas, New Earth 3" /><br />';

function setnpage(U) {NUM=U; setpage();}

function setpage() {
   fdr = document.getElementById('fader')
   if (IEBrowser) { fdr.style.filter = "alpha(opacity=0)"; } else { fdr.style.opacity=0; }

   obj = document.getElementById('footer');
   obj.src = 'img/3077-f' + NUM + '.gif';
   obj.className = 'f'  + NUM;
   
   if (LNK > 0) document[DNS].src = link[LNK].src;
   
   vibraitem = '<img class="item" onload="FadeIn();" src="igtbscan/' + ImgSrc[NUM] + '" alt="" />'

   switch(NUM) {
         case 0:
            contents  = '<center><h1 class="flush" style="color:#808080; text-align:center;">The 3077 Vibra Catalogue</h1>' + vibralogo + vibrastmp + '</center>';
            break;
         case 1:
            contents  = '<div style="position:relative; top:5px; height:0; text-align:center;"><h1 class="flush">Personal Vibracon Globe</h1>';
            contents += '<h3 class="flush">Now you can own a true Globe&mdash;right in your own home.<br />Know the pleasures that helped discover the planets.<br />Price&mdash;1000 Drimes (pure Globe)</h3></div>';
            contents += vibraitem;
            contents += '<div style="position:relative; top:-60px; height:0; padding:0px 25px; text-align:center;"><h4 class="flush">Please note: All personal VIBRACON GLOBES must be ordered three months in advance. Also make sure you include your latest Psychostatus report in your order. No VIBRACON GLOBE can be purchased by anyone with Vibra emotional trace instability. The Corporation reserves the right to refuse sale.</h3></div>';
            break;
         case 2:
            contents  = '<div style="position:relative; top:5px; height:0; text-align:center;"><h1 class="flush">Vibra Image Projector</h1>';
            contents += '<h3 class="flush">Watch your favorite dances and shows being performed live in your own home unit. Be amazed how the images actually move through you.<br />Price&mdash;156 Drimes</h3></div>';
            contents += vibraitem;
            break;
         case 3:
            contents  = '<div style="position:relative; top:25px; height:0; text-align:center;"><h1 class="flush">Audio Visual</h1></div>';
            contents += '<div style="position:relative; top:95px; height:0; padding:0px 45px; text-align:center;"><h3 class="flush">Your own VIBRA leisure unit&mdash;video screens, laser light theatre, and optical disc scanner, plus as a special bonus, the legendary Passport Records anthology.<br />Price&mdash;250 Drimes</h3></div>';
            contents += vibraitem;
            break;
         case 4:
            contents  = '<div style="position:relative; top:30px; left:40px; height:0px; text-align:left;"><h1 class="flush">Automatic Chef</h1></div>';
            contents += vibraitem;
            contents += '<div style="position:relative; top:-210px; left:25px; height:0px; text-align:left;"><h3 class="flush">Don\'t give your Robot<br />all the work, leave it free<br />to do other household duties.<br />Let the VIBRA automatic chef cook<br />your meals and surprise even the most<br />expert gourmets. In our miniature<br />oven  your meals will be ready in<br />just 3 <i>star secs</i>!!<br />Price&mdash;74 Drimes (per month)</h3></div>';
            break;
         case 5:
            contents  = '<div style="position:relative; top:30px; height:0; text-align:center;"><h1 class="flush">Vibra Pocket Translator</h1></div>';
            contents += '<div style="position:relative; top:75px; height:0; padding:0px 45px; text-align:center;"><h3 class="flush">Includes the latest alien laguage analytical circuits.<br />Price&mdash;46 Drimes (extra Codes&mdash;8 Drimes each)</h3></div>';
            contents += vibraitem;
            break;
         case 6:
            contents  = '<div style="position:relative; top:5px; height:0; text-align:left;"><h1 class="flush">The Magic Message</h1>';
            contents += '<h3 class="flush">&quot;You don\'t have to be there to be near.&quot;</h3></div>';
            contents += '<div style="position:relative; top:120px; left:10px; height:0; text-align:left;"><h3 class="flush" style="padding-left:8px;">Send your personal message to<br />your loved ones (no corporation<br />screening necessary).<br />Price&mdash;12 Drimes</h3></div>';
            contents += vibraitem;
            break;
         case 7:
            contents  = '<center>' + vibralogo;
            contents += '<h1 class="flush">Pultron Gun Stunner</h1>';
            contents += '<h2>Not on sale to the public and made under license<br />for the use of <i>Space Commando</i> units only.</h2></center>';
            break;
         case 8:
            contents  = '<center>' + vibralogo;
            contents += '<h2>DUE TO CIRCUMSTANCES<br />BEYOND OUR CONTROL,<br />WE HAVE WITHDRAWN GLOBE ROBOTS<br />FROM THE MARKET.</h2></center>';
            break;
      }

   fdr.innerHTML = contents;
   document.title = ImgTtl[NUM];
   DNS = ImgNdx[NUM];
   LNK = ImgLnk[NUM];
   if (NUM > 6) {FadeIn();}
   }

function blinker()
   {
   if (NUM > 0)
      {
      document[DNS].src = link[(LNK + BLNK)].src;
      BLNK = (BLNK == 1) ? 0 : 1;
      }
   }

setInterval("blinker()",100);

function getalt(x) {
   switch(x) {
      case 71: return 'Audio Visual'; break;
      case 74: return 'Globe Robots'; break;
      case 86: return 'Automatic Chef'; break;
      case 88: return 'Image Projector'; break;
      case 89: return 'Magic Message'; break;
      case 91: return 'Vibracon Globes'; break;
      case 98: return 'Pocket Translator'; break;
      case 111: return 'Pultron Gun Stunner'; break;
      default:
         if (confirm('Error in Vibra Catalogue Navigation Mainframe\nPlease inform the Webmaster!'))
            { KongaBuzz('RE: Error in Vibra Catalogue Navigation Mainframe'); }
         else
            { alert('We appologize for the inconvenience.'); }
      }
   }

function vcmenu() {
   ismenu( 91, 4,'vcglobes',1);
   ismenu( 88, 6,'projectr',2);
   ismenu( 71, 8,'audiovis',3);
   ismenu( 86,10,'autochef',4);
   document.write ('&nbsp;<br />&nbsp;');
   ismenu( 98,12,'translat',5);
   ismenu( 89,14,'mmessage',6);
   ismenu(111,16,'pultrong',7);
   ismenu( 74,18,'globbots',8);
   }

function ismenu(W,X,Z,U){document.write ('&nbsp;<img class="sel" src="menu/' + Z.substr(0,3) + '0.gif" alt="' + (getalt(W)) + '" onmouseover="src=link[' + (X + 1) + '].src" onmouseout="src=link[' + X + '].src" onclick="setnpage(' + U + ')" name="' + Z.substr(0,3) + '" width=' + W + '>&nbsp;')}
function nextpage() {if (NUM == 8) {document.location = 'coupon.html#catalog';} else {NUM++; setpage();}}
function backpage() {if (NUM == 0) {history.back();} else {NUM--; setpage();}}

// +-------------------+ //
// | Page Fader Events | //
// +-------------------+ //

function FadeIn()
   {
   var fade = 0;
   var page = document.getElementById("fader").style;
   var pace = setInterval(Fade,20);
   function Fade()
      {
      if(fade<100)
         {
         fade++;
         if(IEBrowser)
            {
            page.filter = "alpha(opacity=" + fade + ")";
            }
         else 
            {
            page.opacity = (fade/100)
            }
         }
      else clearInterval(pace)
      }
   };

// +------------+ //
// | C'est Fini | //
// +------------+ //

