// some variables...
d = document;
iLoveUncaBill = 0;
Ready = 0;

// browsercheck
if ((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 4))
    {
iLoveUncaBill = 1;
d.write('<LINK HREF="../css/ie.css" REL="stylesheet" REV="stylesheet" TYPE="text/css">');
    }

// aditional image for >17" screens    
if (screen.width > 1000)
	{
d.write('<LINK HREF="../css/back.css" REL="stylesheet" REV="stylesheet" TYPE="text/css">');
	}
    
// get actual chapter and page from URL
function GetActivePage()
    {
SettingsURL     = parent.document.URL.indexOf('?');
TheSettings     = new Array();
if (SettingsURL != -1)
    {
AllSettings = parent.document.URL.substring(SettingsURL+1, parent.document.URL.length).split('&');
for (i=0; i<AllSettings.length; i++)
    {
OneSetting = AllSettings[i].split('=');
TheSettings[OneSetting[0]] = OneSetting[1];
    }
    }
return TheSettings;
    }

GetActivePage();
TheChapter = TheSettings['chapter'];
ThePage = TheSettings['page'];
TheLanguage = TheSettings['language'];
Xtra = TheSettings['xtra'];

// preload mouse-over images
Icon0			= new Image();
Icon0.src		= '../img/iconz/chapter0icon.gif';
Icon1			= new Image();
Icon1.src		= '../img/iconz/chapter1icon.gif';
Icon2			= new Image();
Icon2.src		= '../img/iconz/chapter2icon.gif';
Icon3			= new Image();
Icon3.src		= '../img/iconz/chapter3icon.gif';
Icon4			= new Image();
Icon4.src		= '../img/iconz/chapter4icon.gif';
Icon5			= new Image();
Icon5.src		= '../img/iconz/chapter5icon.gif';
Icon6			= new Image();
Icon6.src		= '../img/iconz/chapter6icon.gif';
Icon7			= new Image();
Icon7.src		= '../img/iconz/chapter7icon.gif';
Icon8			= new Image();
Icon8.src		= '../img/iconz/chapter8icon.gif';
Icon9			= new Image();
Icon9.src		= '../img/iconz/chapter9icon.gif';
Icon10			= new Image();
Icon10.src		= '../img/iconz/chapter10icon.gif';
Icon11			= new Image();
Icon11.src		= '../img/iconz/chapter11icon.gif';
Arrow1			= new Image();
Arrow1.src		= '../img/buttz/arrow1.gif';
Arrow2			= new Image();
Arrow2.src		= '../img/common/bullet2.gif';
if(iLoveUncaBill != 1)
    {
Gradient		= new Image();
Gradient.src	= '../img/common/gradient.gif';
    }

// highlight button on mousemovement
function HighLight(WhichButt,TheMovement)
    {
if(Ready == 1)
    {

ActiveID = 'Chapter' + TheChapter;

if (TheMovement == 1) // incoming mouse event
    {
    if (ActiveID != WhichButt.id)
        {
    TheSrc = '../img/buttz/active.gif';
    d.getElementById(WhichButt.id + 'Arrow').src = '../img/buttz/arrow2.gif';
    d.getElementById('ChapterIcon').src = '../img/iconz/' + WhichButt.id.toLowerCase() + 'icon.gif';
        }
    else
        {
    TheSrc = '../img/common/pix.gif';
    d.getElementById(WhichButt.id + 'Arrow').src = '../img/buttz/arrow1.gif';
        }
    }

else // outgoing mouse event
    {
    if (ActiveID != WhichButt.id)
        {
    TheSrc = '../img/common/pix.gif';
    d.getElementById(WhichButt.id + 'Arrow').src = '../img/common/pix.gif';
    d.getElementById('ChapterIcon').src = '../img/iconz/chapter' + TheChapter + 'icon.gif';
        }
    else
        {
    TheSrc = '../img/buttz/active.gif';
    d.getElementById(WhichButt.id + 'Arrow').src = '../img/buttz/arrow2.gif';
        }
    }

d.getElementById(WhichButt.id + 'Img').src = TheSrc;

    }
    }
    
// show / hide language division on layer 3
function Language(TheVision)
	{
location.href = "#top";
if(TheVision == 1)
    {
TheShow = 'block';
d.getElementById('LanguageChoise').style.backgroundImage = 'url("../img/common/language.gif")';
    }
else{TheShow = 'none';}
d.getElementById('LanguageChoise').style.display = TheShow;
    }
    
// show / hide language division on layer 2
function SlideShow(TheVision)
	{
location.href = "#top";
if(TheVision == 1)
    {
InitializeSlide = 1;
setTimeout("d.getElementById('SlideImg').src = '../_content/chapter' + TheChapter + '/img/slideshow' + ThePage + '/slide1.jpg'",1000);
TheShow = 'block';
    }
else{TheShow = 'none';}
d.getElementById('SlideShow').style.display = TheShow;
FirstShow = 1;
ShowActive = 0;
PausePressed = 1;
    }

// somethings 2 do when page is loaded...
function Ready2Rumble()
    {
Ready = 1;
d.getElementById('ChapterIcon').src = '../img/iconz/chapter' + TheChapter + 'icon.gif';
    }
    
// explorer like menu-tree
OldContainer = 0;
function Container(NewContainer)
    {

if(OldContainer != NewContainer)
    {
d.getElementById('Container'+OldContainer).style.display = 'none';
d.getElementById('Bullet'+NewContainer).src = '../img/common/bullet2.gif';
d.getElementById('Container'+NewContainer).style.display = 'block';
d.getElementById('Bullet'+OldContainer).src = '../img/common/bullet1.gif';
d.getElementById('BulletAni'+NewContainer).src = '../img/common/bullet_ani.gif';
OldContainer = NewContainer
    }

else
    {
    if(d.getElementById('Container'+NewContainer).style.display == 'block')
        {
    d.getElementById('Container'+NewContainer).style.display = 'none';
    d.getElementById('Bullet'+NewContainer).src = '../img/common/bullet1.gif';
        }
    else
        {
    d.getElementById('Container'+NewContainer).style.display = 'block';
    d.getElementById('Bullet'+NewContainer).src = '../img/common/bullet2.gif';
        }
    }

    }
    
function XtraContainer(TheContainer)
    {
if(TheContainer != 0)
    {
Container(TheContainer);
location.href = '#ctr' + TheContainer;
    }
    }

/////////////////////////////////////////////////////////
//    SHOW PREVIEW WINDOW
/////////////////////////////////////////////////////////

function Prices(TheLanguage)
    {
ThePage = '../prices/index.php?l='+TheLanguage;

WinWidth  = 440;
WinHeight = 600;

    if (navigator.appVersion.indexOf('3.') == -1)
        {
    WinLeft = (screen.width - WinWidth) / 2;
    WinTop  = (screen.height - WinHeight) / 2;
        }
    else
        {
    WinLeft = 50;
    WinTop  = 50;
        }

RemoteWindow = window.open(ThePage,'xtra','height=' + WinHeight + ',width=' + WinWidth + ',alwaysLowered=1,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=0,z-lock=0,screenX=1,screenY=1,left=' + WinLeft + ',top=' + WinTop);
    }
    
/////////////////////////////////////////////////////////////////////////////////////
//	 SHOW THE MAP POPUP-WINDOW
/////////////////////////////////////////////////////////////////////////////////////

function kbbmap()
   {
WindowHeight = 636;
CanvasHeight = window.screen.height; // d.body.clientHeight
WinTop		 = Math.floor((CanvasHeight-WindowHeight)/2)-100;

WindowWidth  = 900;
CanvasWidth	 = window.screen.width; // d.body.clientWidth
WinLeft		 = Math.floor((CanvasWidth-WindowWidth)/2);

PicWin = window.open('map.htm','kbbmap','height=' + WindowHeight + ',width=' + WindowWidth + ',alwaysLowered=1,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0,z-lock=0,screenX=1,screenY=1,left=' + WinLeft + ',top=' + WinTop);

PicWin.focus();
	}
	
function movie()
   {
WindowHeight = 475;
CanvasHeight = window.screen.height; // d.body.clientHeight
WinTop		 = Math.floor((CanvasHeight-WindowHeight)/2)-100;

WindowWidth  = 750;
CanvasWidth	 = window.screen.width; // d.body.clientWidth
WinLeft		 = Math.floor((CanvasWidth-WindowWidth)/2);

MovWin = window.open('../movie/index.htm','kbbmov','height=' + WindowHeight + ',width=' + WindowWidth + ',alwaysLowered=1,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=1,toolbar=0,z-lock=0,screenX=1,screenY=1,left=' + WinLeft + ',top=' + WinTop);

MovWin.focus();
	}
