function playBloep()
	{
	try {
		WinMediaSound.play()
		}
	catch(e) {}
}

function changeImg(Name,Pi)
{
	if (preloading == "ready" && bUseJava)
	{if (document[Name]) {document[Name].src = eval(Pi + ".src")} }
}

function changeMenuImg(Name,Pi,what)
{
	if (Pi.charAt(Pi.length-1)== '3')
		{
		if (objSelectedPage)
			{
			var strImgName = objSelectedPage.getAttribute('IMGNAME')
			if (objSelectedPage) {changeImg(strImgName,strImgName+'1')} 
			}
		}
	if ((objSelectedPage!=what) && (objNextSelectedPage!=what))
		{ if (preloading == "ready" && bUseJava) {document[Name].src = eval(Pi + ".src")} }
}


function changeSubmenuImg(Name,Pi,what)
{
	if (Pi.charAt(Pi.length-1)== '3')
		{
		if (objSelectedSection[objSelectedPage.getAttribute("PAGEID")])
			{
			var strImgName = objSelectedSection[objSelectedPage.getAttribute("PAGEID")].getAttribute('IMGNAME')
			if (objSelectedSection[objSelectedPage.getAttribute("PAGEID")]) {changeImg(strImgName,strImgName+'1')}
			}
		}
	if ((objSelectedSection[objSelectedPage.getAttribute("PAGEID")]!=what) && (objNextSelectedSection[objSelectedPage.getAttribute("PAGEID")]!=what))
		{ if (preloading == "ready" && bUseJava) {document[Name].src = eval(Pi + ".src")} }
}


var halfPi = Math.PI/2;
var masterdivheight=650,masterdivwidth=650,shadowHeight=5;
var teller=-halfPi,pagespeed=halfPi/8,sectionspeed=halfPi/4;
var moving='',objSelectedPage='',objNextSelectedPage='';
var CustomPageURL='';

var sectionteller=new Array(),movingsection=new Array(),objSelectedSection=new Array(),objNextSelectedSection=new Array();
for (i = 0; i < 7; i++)
   { 
   sectionteller[i]=-halfPi; 
   movingsection[i]=-halfPi;
   objSelectedSection[i]='';
   objNextSelectedSection[i]='';
   }
	
if(navigator.appName.indexOf("Netscape") == -1)
    {
	window.onresize =  function()
		{ repositionMasterDiv(); }
	}
else
	{
	//Netscape speed
	pagespeed=halfPi
	sectionspeed=halfPi
	}

function masterVisible()
	{
	document.getElementById('masterdiv').style.visibility = 'visible'
	document.getElementById('homediv').style.visibility = 'visible'
	}
	
function openPage()
	{
	var i,objPage,objPageHolder,pageID,PageCenter,pageHeight,strVisibility,intSkipPixels,objSectionBody,objSectionIframe;
	
	if (teller>=halfPi) { teller=halfPi }
	if (teller<=-halfPi) { teller=-halfPi }
	if (teller==halfPi) {window.clearInterval(moving)}

	pageID = parseInt(objSelectedPage.getAttribute("PAGEID"));
	pageHeight = parseFloat(objSelectedPage.getAttribute("PAGEHEIGHT"));
	PageCenter = parseFloat(objSelectedPage.getAttribute("PAGECENTER"))+(masterdivheight/2);
	
	var newHeight = Math.round((pageHeight/2) + (Math.sin(teller) * (pageHeight/2)))

	if (newHeight>2) { strVisibility='visible'; }
	else { strVisibility='hidden'; }

	intSkipPixels=0;
	for (i=pageID;i>0;i--) 
		{
		objPageHolder = document.getElementById("page"+i)
		if (objPageHolder) 
			{
			intSkipPixels+=parseInt(objPageHolder.style.height)-1;
			objPageHolder.style.top=PageCenter - (newHeight/2) - (intSkipPixels) 
			intSkipPixels-=shadowHeight
			}
		}
	objPage = document.getElementById("page"+pageID+"body");
	objPage.style.visibility = strVisibility;
	if (newHeight>=1) { objPage.style.height=newHeight-1 }
	else { objPage.style.height=0 }

	if (objSelectedSection[pageID]!="")
		{
		sectionID= objSelectedSection[pageID].getAttribute("SECTIONID");
		objSectionBody= document.getElementById("sect"+pageID+"."+sectionID+"body");
		if (objSectionBody) 
			{
			objSectionBody.style.visibility=strVisibility;
			if (newHeight>0) { objSectionBody.style.height=newHeight-1 }
			else { objSectionBody.style.height=0 }
			}

		objSectionIframe=document.getElementById("sect"+pageID+"."+sectionID+"iframe");
		if (objSectionIframe)
			{
			//sect" & intPageID & "." & intSectionID & """ PAGEURL=""" & strURL &
			if (objSectionIframe.src=="")
				{
				objSectionIframe.src = objSelectedSection[pageID].getAttribute("PAGEURL")
				}
			if (newHeight <=8) {objSectionIframe.style.visibility='hidden';objSectionIframe.style.height = '0px'}
			else { objSectionIframe.style.visibility = strVisibility;objSectionIframe.style.height = newHeight - 9}
			}
		}	

	objPage.style.top=PageCenter - (newHeight/2)+1 - shadowHeight;
	
	intSkipPixels=0;
	for (i=pageID+1;i<(intPages+1);i++) 
		{
		objPageHolder=document.getElementById("page"+i)
		if (objPageHolder) 
			{
			intSkipPixels-=shadowHeight;
			objPageHolder.style.top=PageCenter + (newHeight/2) + (intSkipPixels);
			intSkipPixels+= parseInt(objPageHolder.style.height)-1;
			}
		}
			
	teller+=pagespeed;
	}
	

function closePage()
	{
	var i,objPage,objPageHolder,pageID,PageCenter,PageHeight,strVisibility,intSkipPixels=0,objSectionBody,objSectionIframe;
	
	if (teller<=-halfPi) { teller=-halfPi }
	if (teller>=halfPi) { teller=halfPi }
	if (teller==-halfPi) { window.clearInterval(moving); }

	pageID= parseInt(objSelectedPage.getAttribute("PAGEID"));
	pageHeight= parseFloat(objSelectedPage.getAttribute("PAGEHEIGHT"));
	PageCenter= parseFloat(objSelectedPage.getAttribute("PAGECENTER")) + (masterdivheight/2);

	var newHeight= Math.round((pageHeight/2) + (Math.sin(teller) * (pageHeight/2)))

	if (newHeight>2) { strVisibility='visible' }
	else { strVisibility='hidden' }

	for (i=pageID;i>0;i--) 
		{
		objPageHolder=document.getElementById("page"+i)
		if (objPageHolder) 
			{
			intSkipPixels+= parseInt(objPageHolder.style.height)-1;
			objPageHolder.style.top= PageCenter - (newHeight/2) - (intSkipPixels) 
			intSkipPixels-=shadowHeight
			}
		}

	objPage=document.getElementById("page"+pageID+"body");
	objPage.style.visibility=strVisibility;
	objPage.style.top=PageCenter - (newHeight/2)+1 - shadowHeight
	
	if (newHeight>=1) { objPage.style.height=newHeight-1 }
	else { objPage.style.height=0 }

	if (objSelectedSection[pageID]!="")
		{
		sectionID= objSelectedSection[pageID].getAttribute("SECTIONID");
		objSectionBody= document.getElementById("sect"+pageID+"."+sectionID+"body");
		
		if (objSectionBody) 
			{
			objSectionBody.style.visibility = strVisibility;
			if (newHeight>0) { objSectionBody.style.height=newHeight-1 }
			else { objSectionBody.style.height=0 }
			}

		objSectionIframe=document.getElementById("sect"+pageID+"."+sectionID+"iframe");
		if (objSectionIframe)
			{
			if (newHeight<=8) {objSectionIframe.style.visibility='hidden';objSectionIframe.style.height = '0px'}
			else { objSectionIframe.style.visibility = strVisibility;objSectionIframe.style.height = newHeight - 9 }
			}
		}
		
	intSkipPixels=0;
	for (i=pageID+1;i<(intPages+1);i++) 
		{
		objPageHolder=document.getElementById("page"+i)
		if (objPageHolder) 
			{
			intSkipPixels-=shadowHeight
			objPageHolder.style.top=PageCenter + (newHeight/2) + (intSkipPixels) 
			intSkipPixels+= parseInt(objPageHolder.style.height)-1;
			}
		}
			
	if (teller==-halfPi) 
		{
		if (objPage) { objPage.style.visibility='hidden' }
		if (objSectionBody) { objSectionBody.style.visibility='hidden' }
		if (objSectionIframe) { objSectionIframe.style.visibility='hidden' }
		moving='';
		objSelectedPage='';
		if (objNextSelectedPage!='') 
			{ 
			startPage(objNextSelectedPage)
			objNextSelectedPage='';
			}
		}
	teller-=pagespeed;
	}

function openSection()
	{
	var i,objSection,objSectionHolder,pageID,pageURL,sectionID,sections,sectionCenter,sectionWidth,strVisibility,sectPageID,intSkipPixels=0,halfNewWidth;
	
	sectPageID= objSelectedPage.getAttribute("PAGEID")


	sections= objSelectedPage.getAttribute("SECTIONS")
	pageID= parseInt(objSelectedSection[sectPageID].getAttribute("PAGEID"));
	sectionID= parseInt(objSelectedSection[sectPageID].getAttribute("SECTIONID"));
	sectionWidth= parseFloat(objSelectedSection[sectPageID].getAttribute("SECTIONWIDTH"))
	sectionCenter= parseFloat(objSelectedSection[sectPageID].getAttribute("SECTIONCENTER")) + (sectionWidth /2)

	if (sectionteller[sectPageID]>=halfPi) { sectionteller[sectPageID]=halfPi }
	if (sectionteller[sectPageID]<=-halfPi) { sectionteller[sectPageID]=-halfPi }

	var newWidth= Math.round((sectionWidth/2) + (Math.sin(sectionteller[sectPageID]) * (sectionWidth/2)))
	halfNewWidth=newWidth/2
	
	if (newWidth-1>0) { strVisibility='visible' }
	else { strVisibility='hidden' }

	for (i=sectionID;i>0;i--) 
		{
		objSectionHolder=document.getElementById("sect"+pageID+"."+i)
		if (objSectionHolder) 
			{
			intSkipPixels+=parseInt(objSectionHolder.style.width)-1; 
			objSectionHolder.style.left=sectionCenter - halfNewWidth - (intSkipPixels) 
			}
		}

	
	objSection= document.getElementById("sect"+pageID+"."+sectionID+"body");
	if (objSection)
		{
		objSection.style.visibility=strVisibility;
		objSection.style.width=newWidth;
		objSection.style.left=sectionCenter-halfNewWidth+1; 
		objSectionIframe=document.getElementById("sect"+pageID+"."+sectionID+"iframe");
		if (objSectionIframe)
			{
			objSectionIframe.style.visibility = strVisibility;
			if (newWidth<6) { objSectionIframe.style.width=0 }
			else { objSectionIframe.style.width=newWidth-6 }
			}
		}

	intSkipPixels=0;
	for (i=sectionID+1;i<(sections+1);i++) 
		{
		objSectionHolder= document.getElementById("sect"+pageID+"."+i)
		if (objSectionHolder) 
			{
			objSectionHolder.style.left= sectionCenter + halfNewWidth + (intSkipPixels) 
			intSkipPixels+=parseInt(objSectionHolder.style.width)-1; 
			}
		}

	if (sectionteller[sectPageID]>=halfPi) { window.clearInterval(movingsection[sectPageID] ) }

	sectionteller[sectPageID]+=sectionspeed;
	}

function closeSection()
	{
	var i,objSection,objSectionHolder,pageID,sectionID,sections,sectionCenter,sectionWidth,strVisibility,intSkipPixels=0,sectPageID,halfNewWidth;
	
	sectPageID= objSelectedPage.getAttribute("PAGEID")
	sections= objSelectedPage.getAttribute("SECTIONS")

	pageID= parseInt(objSelectedSection[sectPageID].getAttribute("PAGEID"));
	sectionID= parseInt(objSelectedSection[sectPageID].getAttribute("SECTIONID"));
	sectionWidth= parseFloat(objSelectedSection[sectPageID].getAttribute("SECTIONWIDTH"));
	sectionCenter= parseFloat(objSelectedSection[sectPageID].getAttribute("SECTIONCENTER")) + (sectionWidth /2)

	var newWidth= Math.round((sectionWidth/2) + (Math.sin(sectionteller[sectPageID]) * (sectionWidth/2)))
	halfNewWidth= newWidth/2
	
	if (sectionteller[sectPageID]<=-halfPi) { sectionteller[sectPageID]=-halfPi }
	if (sectionteller[sectPageID]>=halfPi) { sectionteller[sectPageID]=halfPi }

	if (newWidth-1>0) { strVisibility='visible' }
	else { strVisibility='hidden' }

	for (i=sectionID;i>0;i--)
		{
		objSectionHolder= document.getElementById("sect"+pageID+"."+i)
		if (objSectionHolder) 
			{ 
			intSkipPixels+=parseInt(objSectionHolder.style.width)-1; 
			objSectionHolder.style.left=sectionCenter - halfNewWidth - (intSkipPixels) 
			}
		}
		
		objSection= document.getElementById("sect"+pageID+"."+sectionID+"body");
		if (objSection)
			{
			objSection.style.visibility= strVisibility;
			objSection.style.left= sectionCenter - halfNewWidth+1;
			objSection.style.width= newWidth;
			objSectionIframe= document.getElementById("sect"+pageID+"."+sectionID+"iframe");
			if (objSectionIframe)
				{
				objSectionIframe.style.visibility= strVisibility;
				if (newWidth<6) { objSectionIframe.style.width=0; }
				else { objSectionIframe.style.width= newWidth-6; }
				}
			}
		
	intSkipPixels=0;
	for (i=sectionID+1;i<(sections+1);i++) 
		{
		objSectionHolder= document.getElementById("sect"+pageID+"."+i)
		if (objSectionHolder) 
			{ 
			objSectionHolder.style.left= sectionCenter + halfNewWidth + (intSkipPixels) 
			intSkipPixels+=parseInt(objSectionHolder.style.width)-1; 
			}
		}

	if (sectionteller[sectPageID]<=-halfPi) 
		{
		window.clearInterval(movingsection[sectPageID] )
		movingsection[sectPageID];
		objSelectedSection[sectPageID]='';

		if (objSection) {objSection.style.visibility='hidden'}
		if (objSectionIframe) {objSectionIframe.style.visibility='hidden'}

		if (objNextSelectedSection[sectPageID]!="") 
			{ 
			sectionteller[sectPageID]=-halfPi;
			if (CustomPageURL!='')
				{
				startSection(objNextSelectedSection[sectPageID],CustomPageURL);
				}
			else
				{
				startSection(objNextSelectedSection[sectPageID]);
				}
			objNextSelectedSection[sectPageID]="";
			}
		}
	sectionteller[sectPageID]-=sectionspeed;
	}
	
function startPage(what)
	{
	CustomPageURL = ''
	if (objSelectedPage!='') 
		{
		window.clearInterval(moving);
		moving=window.setInterval('closePage()',33);
		objNextSelectedPage=what;
		}
	else
		{
		objSelectedPage=what;
		moving=window.setInterval('openPage()',33);
		}
	}
	
function startSection(what)
	{
	CustomPageURL = ''
	var pageID,pageURL,sectionID;
	pageID= what.getAttribute("PAGEID")
	pageURL= what.getAttribute("PAGEURL")
    sectionID= what.getAttribute("SECTIONID")
	sectionWidth = what.getAttribute("SECTIONWIDTH")
	objIFRAME= document.getElementById("sect"+pageID+"."+sectionID+"iframe");
	if (objIFRAME) {
					if (arguments[1]!='' && typeof(arguments[1])!='undefined')
						{
						if (objIFRAME.src!=arguments[1]) 
								{ 
								objIFRAME.src=arguments[1] 
								CustomPageURL = arguments[1]
								} 
						}
					else
						{ 
						if (objIFRAME.src!=pageURL) 
								{ 
								objIFRAME.src=pageURL 
								} 
						}
					}

	if (objSelectedSection[objSelectedPage.getAttribute("PAGEID")]!="")
		{
		window.clearInterval(movingsection[objSelectedPage.getAttribute("PAGEID")] )
		movingsection[objSelectedPage.getAttribute("PAGEID")]=window.setInterval("closeSection()",33);
		objNextSelectedSection[objSelectedPage.getAttribute("PAGEID")]=what;
		}
	else
		{
		objSelectedSection[objSelectedPage.getAttribute("PAGEID")]=what;
		window.clearInterval(movingsection[objSelectedPage.getAttribute("PAGEID")] )
		movingsection[objSelectedPage.getAttribute("PAGEID")]=window.setInterval("openSection()",33);
		}
	}
	
var objLine1,objLine1Pos,objLine1NaarPos,objLine1Speed,objLine2,objLine2Pos,objLine2NaarPos,objLine2Speed,objLine3,objLine3Pos,objLine3NaarPos,objLine3Speed;
	
function startLines()
	{
	startLine('1');
	startLine('2');
	startLine('3');
	startLine('4');
	startLine('5');
	window.setInterval('moveLines()',31);
	}

function startLine(intLine)
	{
	eval('objLine'+intLine+'=document.getElementById("line'+intLine+'")');
	eval('objLine'+intLine+'Pos=parseFloat(parseInt(objLine'+intLine+'.style.top))');
	eval('objLine'+intLine+'NaarPos=parseFloat(Math.random()*parseInt(window.document.body.clientHeight))');
	eval('objLine'+intLine+'Speed=parseFloat(Math.random()*5)');
	}

function moveLines()
	{
	moveLine('1');
	moveLine('2');
	moveLine('3');
	moveLine('4');
	moveLine('5');
	}

function moveLine(intLine)
		{
		if (eval('objLine'+intLine+'Pos>=objLine'+intLine+'NaarPos'))
			{ 
			eval('objLine'+intLine+'Pos-=objLine'+intLine+'Speed');
			if (eval('objLine'+intLine+'Pos<=objLine'+intLine+'NaarPos'))
				{
				eval('objLine'+intLine+'NaarPos=parseFloat(Math.random()*parseInt(window.document.body.clientHeight))')
				eval('objLine'+intLine+'Speed=parseFloat(Math.random()*5)+0.5;')
				}
			}
		else
			{ 
			eval('objLine'+intLine+'Pos+=objLine'+intLine+'Speed')
			if (eval('objLine'+intLine+'Pos>=objLine'+intLine+'NaarPos'))
				{
				eval('objLine'+intLine+'NaarPos=parseFloat(Math.random()*parseInt(window.document.body.clientHeight))')
				eval('objLine'+intLine+'Speed=parseFloat(Math.random()*5)+0.5;')
				}
			}
		eval('objLine'+intLine+'.style.top=parseInt(objLine'+intLine+'Pos) ')
		}
		

		
function CreatePreloadItem(strItem,strFilename)
{
	strFilename=strFilename.substr(0,(strFilename.length-4));
	eval(strItem + '1=new Image();')
	eval(strItem + '2=new Image();')
	eval(strItem + '3=new Image();')
	eval(strItem + '1.src=document.' + strItem + '.src')
	if (strFilename.substr(strFilename.length-2,2)!='_e')
		{
		eval(strItem + '2.src="'+ strFilename + '.gif"')
		eval(strItem + '3.src="'+ strFilename + '.gif"')
		}
}

function repositionMasterDiv()
	{
	objMasterDiv=document.getElementById('masterdiv');
	objPageDiv=document.getElementById('page1');
	objMasterDiv.style.top=(parseInt(window.document.body.clientHeight)/2)-(masterdivheight/2)-(( intPages*(parseInt(objPageDiv.style.height)-1))/2);
	objMasterDiv.style.left=(parseInt(window.document.body.clientWidth)/2)-(masterdivwidth/2);
	}