/*
	<a href="index.html">kaustic machines</a>
	<a href="z.html">kaustic machines Z / Signal Buffer</a>
	<a href="kaiser.html">kaustic machines Kaiser Mk1 / Dark-Grain Overdrive</a>
	<a href="kaiser-kult.html">kaustic machines Kaiser Kult / Classic Overdrive</a>
	<a href="vanishing-moon.html">kaustic machines Vanishing Moon / Tremolo Sequencer</a>
	<a href="komrad.html">kaustic machines Komrad Modular / Modular Optical Theremin</a>
	<a href="apc.html">kaustic machines Atari Punk Console / Komrad Module</a>
	<a href="robot.in.a.jar.html">kaustic machines Robot in a Jar / SpeakJet Synth</a>
*/
	var nav=new Array()
	var toolTipTimer
	var toolTip	= new Array()
		nav[0]		='z'
		toolTip[0] = 'Z / Signal Buffer'
		nav[1]		='kaiser'
		toolTip[1] = 'Kaiser Mk1 / Dark-Grain Overdrive'
		nav[2]		='kaiser-kult'
		toolTip[2] = 'Kaiser Kult / Classic Overdrive'
		nav[3]		='vanishing-moon'
		toolTip[3] = 'Vanishing Moon / Tremolo Sequencer'
		nav[4]		='komrad'
		toolTip[4] = 'Komrad Modular / Modular Optical Theremin'
		nav[5]		='apc'
		toolTip[5] = 'Atari Punk Console / Komrad Module'
		nav[6]		='robot.in.a.jar'
		toolTip[6] = 'Robot in a Jar / SpeakJet Synth'
	var init=false

function popup(url,w,h){
	var popup=window.open(url,'popup','width='+w+',height='+h+',status=0,resizable=0,scrollbars=1,menubar=0,locationbar=0')
	if(popup.opener)popup.focus()
	else popup.opener=window
}

function imgZoom(imgObj){
	w=imgObj.width*2
	h=imgObj.height*2
	var popup=window.open('about:blank','popup','width='+(w+32)+',height='+(h+32)+',status=0,resizable=0,scrollbars=1,menubar=0,locationbar=0')
	if(popup.opener)popup.focus()
	else popup.opener=window
	popup.document.write('<html><title>kaustic machines</title><body style="margin:8px;text-align:center;vertical-align:middle;background-color:#98A59E"><img src="'+imgObj.src+'" width="'+w+'" height="'+h+'"/></body>')
}

	dspNav=function(){
		document.write('<div id="nMain" onClick="document.location=\'index.html\'"></div>')
		me=self.location.href.split('/')
		if(me.length<2)me=self.location.href.split('\\')
		id=me[me.length-1].split('.html')[0]
		id=id.split('_')[0]
		for(i=0;i<nav.length;i++){
			if(nav[i]==id)document.write('<div id="nHigh"></div>')
			else document.write('<div id="nLow" onMouseOver="nOver(this);toolTipOver('+i+')" onMouseOut="nOut(this);toolTipOut()" onClick="document.location=\''+nav[i]+'.html\'"></div>')
		}
		document.write('<div id="nBack" onMouseOver="nOver(this)" onMouseOut="nOut(this)" onClick="document.location=\'back.html\'"></div>')
		document.write('<div id="toolTipDiv"></div>')
	}

	nOver=function(obj){
		obj.style.backgroundColor='#FFF'
	}
	nOut=function(obj){
		obj.style.backgroundColor='#000'
	}

	toggleDiv=function(id){
		if(document.getElementById){
			if(document.getElementById(id).style.display=='none')showDiv(id)
			else hideDiv(id)
		}
	}
	showDiv=function(id){
		if(document.getElementById)document.getElementById(id).style.display='';
	}
	hideDiv=function(id){
		if(document.getElementById)document.getElementById(id).style.display='none';
	}





////////////////////////////////////////////////////////////////////////////////
/// Generic Client Browser Object

is=[]
is.dom=document.getElementById?1:0
is.op=(navigator.userAgent.indexOf('Opera')>-1)?1:0
is.n4=document.layers?1:0
is.e4=document.all?1:0
is.n6=(is.dom&&!is.e4&&!is.op)?1:0

////////////////////////////////////////////////////////////////////////////////
/// Generic Minimal Cell Object

Cell=function(elmId){
	if(is.dom)this.elm=document.getElementById(elmId)
	else if(is.e4)this.elm=document.all[elmId]
	if(is.n4)this.elm=this.css=document.layers[elmId]
	else this.css=this.elm.style
	this.doc=is.n4?this.elm.document:document
	this.visible=false
	init=true
}
Cell.prototype.show=function(){this.css.visibility=is.n4?'show':'visible';this.visible=true}
Cell.prototype.hide=function(){this.css.visibility=is.n4?'hide':'hidden';this.visible=false}
Cell.prototype.setBgColor=function(bgColor){
	if(is.n4)this.doc.bgColor=bgColor
	else this.css.backgroundColor=bgColor?bgColor:'transparent'
}
Cell.prototype.write=function(str){
	if(is.n4){
		this.doc.open()
		this.doc.write(str)
		this.doc.close()
	}
	else this.elm.innerHTML=str
}
Cell.prototype.setX=function(x){
	if(is.dom)this.css.left=x+'px'
	else if(is.e4||is.op)this.css.pixelLeft=x
	if(is.n4)this.css.left=x
}
Cell.prototype.setY=function(y){
	if(is.dom)this.css.top=y+'px'
	else if(is.e4||is.op)this.css.pixelTop=y
	if(is.n4)this.css.top=y
}
Cell.prototype.setW=function(w){
	if(is.n4)this.css.width=w
	else this.css.width=w+'px'
}

////////////////////////////////////////////////////////////////////////////////
/// Generic Cursor Object

Cursor=[]
document.onmousemove=function(e){
	if(is.op)
	{   Cursor.x=event.clientX
		Cursor.y=event.clientY
	}
	else if(is.e4)
	{   Cursor.x=event.clientX+document.body.scrollLeft
		Cursor.y=event.clientY+document.body.scrollTop
	}
	else
	{	Cursor.x=e.pageX
		Cursor.y=e.pageY
	}
	if(Cursor.onmove)Cursor.onmove()
}
if(is.n4)document.captureEvents(Event.MOUSEMOVE)

////////////////////////////////////////////////////////////////////////////////
/// Tooltip

Cursor.onmove=function(){
	if(init&&toolTipCell.visible){
		toolTipCell.setX(Cursor.x+16)
		toolTipCell.setY(Cursor.y-16)
	}
}

toolTipOver=function(t){
	if(!init)return
	clearTimeout(toolTipTimer)
	toolTipCell.write(toolTip[t])
	toolTipCell.setX(Cursor.x+16)
	toolTipCell.setY(Cursor.y-16)
	toolTipCell.show()
}

toolTipOut=function(){
	if(!init)return
	clearTimeout(toolTipTimer)
	toolTipTimer=window.setTimeout('toolTipCell.hide()',100)
}

