// Floating Menu
// (c) 2001 Obo Baginski
//
// DO USE ONLY AFTER CONTACTING drobo@bagnet.de
// Thank You!

// layout setup

mainLeft=100;		// pixel border left
selSubLeft=10;		// pixel border left of selected submenu
mainTop=58;		// pixel border top
imgWidth=82;		// Image size
imgWidth2=164;		// Image size
imgHeight=27;
gapWidth=3;		// Gap size
gapHeight=3;
imgPath="../images/"	// path for all images
subTop=mainTop+imgHeight+gapHeight;	// top of the sub menus

// see below for Menu Definition . . .

mainImages=new Array();
mainLinks=new Array();
mainMOs=new Array();
mainColors=new Array();
mainSelColors=new Array();
subSubColors=new Array();
subMenuTitles=new Array();
subMenuLinks=new Array();
mainAnz=0;	// number of main entries
mi=-1;si=-1;mlm=-1;mls=-1;
function addmenu(image,link,motext,color,selcolor,subsubcolor){
	mainAnz++;
	mi++;si=-1;
	mainImages[mi]=image;
	mainLinks[mi]=link;
	mainMOs[mi]=motext;
	mainColors[mi]=color;
	mainSelColors[mi]=selcolor;
	subSubColors[mi]=selcolor;
	if(subsubcolor)subSubColors[mi]=subsubcolor;
	subMenuTitles[mi]=new Array();
	subMenuLinks[mi]=new Array();
}
function addsub(title,link){
	si++;
	subMenuTitles[mi][si]=title;
	subMenuLinks[mi][si]=link;
}

// #######################
// Definition of main menu
// #######################

// addmenu 1) Image. Used are xx.gif and xx_bunt.gif. Size MUST be "imgWidth" wide, "imgHeight" high
//         2) Link. Optional "". ALL LINKS MUST BE UNIQUE!
//         3) MouseOver Text. Explain the link
//         4) Colors. Used for the sub menu tds
//         5) Selected Colors. Used for selected entries in sub menus
//         6) SubSubColors. Used for the sub menu tds if link is #relative. May be empty
// addsub  1) Title. Caption displayed for menu entry
//         2) Link. Must be given. ALL LINKS MUST BE UNIQUE!

addmenu("home","../home/index.htm", "home sweet home","#ff99cc","#ff6699","#FBD5E0");
  addsub("CD of the month","http://cdbaby.com/cd/klauswiese3/from/aquarius");
//  addsub("CHARTS bestellen und h&ouml;ren","../home/charts.htm");

  addsub("Company contact","../home/contact.htm");
//  addsub("Tour dates","../home/termine.htm");
//  addsub("Kongresse","../home/termine.htm#kongresse");
//  addsub("Konzerte","../home/termine.htm#konzerte");
//  addsub("Workshops","../home/termine.htm#workshops");

  addsub("Newsletter","../home/newsletter.htm");

// addmenu("catalog","../catalog/index.htm", "the catalog","#ffcc88","#bb9955");

addmenu("musicjournal","../aim/media.htm", "Aquarius Media info!","#ffcc66","#ff9900");
//  addsub("Archiv","../amj/pdf_amj.htm");
//  addsub("Charts","../amj/charts.htm");
  addsub("Radio","../aim/radio.htm");
    addsub("Press","../aim/press.htm");

addmenu("aquintl","../aim/index.htm","Aquarius International Music","#ccff99","#33cc33");
  addsub("artists","../aim/index.htm");
  addsub("about AIM","../aim/about.htm");
  //addsub("Nhanda Devi","../nhandadevi/index.htm");
//  addsub("Vision Earth","../visionearth/index.htm");
//  addsub("Poumi","../poumi/index.htm");
//  addsub("Gabrielle Roth","../gabrielleroth/index.htm");
//  addsub("Disco-graphie","../gabrielleroth/discographie.htm");
//  addsub("CDs","../gabrielleroth/discographie.htm#CDs");
//  addsub("DVDs","../gabrielleroth/discographie.htm#DVDs");
//  addsub("Videos","../gabrielleroth/discographie.htm#Videos");
//  addsub("Gary Thomas","../garythomas/index.htm");
//  addsub("Kali-Meditation","../kalimeditation/index.htm");
//  addsub("Steve McDonald","../stevemcdonald/index.htm");
//  addsub("Lelonek","../lelonek/index.htm");
//  addsub("Habib","../habib/index.htm");
//  addsub("Wesak-CD","../aim/wesak.htm");
//  addsub("John McDowell","../mcdowell/index.htm");
//  addsub("Vladiswar Nadishana","../vladiswar/index.htm");
//  addsub("Sha","../sha/index.htm");
//  addsub("CDs","../aim/cds_aim.htm");
//  addsub("Impressum","../aim/impressum_aim.htm");

// XXX addmenu("aquarius","../aquarius/index.htm","this is the age of aquarius","#88ccff","#5599bb");

addmenu("services","../services/index.htm","super service!","#a5d7f3","#0285d2");
 // addsub("CD-Press-Service","../services/pressangebot.htm");
//  addsub("CD-Opener","../services/cd_opener.htm");
//  addsub("CD- Produktion","../services/cd_produktion.htm");
//  addsub("K&uuml;nstler- Betreuung","../services/betreuung.htm");
//  addsub("Referenzen","../services/referenzen.htm");
  addsub("Consulting-Coaching","../services/consulting.htm");
  addsub("Marketing & Promotion","../services/consulting.htm");

addmenu("friends","../friends/index.htm","great links","#e7a1fc","#cb5dc2");
//  addsub("K&uuml;nstler","../friends/kuenstler_fr.htm");
//  addsub("Labels","../friends/label_fr.htm");
//  addsub("Radio","../friends/internetradio.htm");
//  addsub("Studios","../friends/studios.htm");
//  addsub("Zeitschriften","../friends/zeitschriften.htm");
//  addsub("Verlage","../friends/verlage.htm");
//  addsub("Reise- veranstalter","../friends/reisen.htm");
//  addsub("Therapeuten","../friends/therapeuten.htm");
//  addsub("Tantra","../friends/tantra.htm");
//  addsub("B&uuml;cher","../friends/buecher.htm");



// Program Engine :-) IGNORE . . . 
v4=(parseInt(navigator.appVersion)>=4&&parseInt(navigator.appVersion)<=5)?1:0
ie=(document.all&&v4)?1:0
ns=(document.layers&&v4)?1:0
if(!ie)ns=1;
function nReload(){
        location.reload();
        return false;
}
if(ns){
	window.captureEvents(Event.RESIZE);
	window.onresize=nReload;
	ypos="window.pageYOffset";
	doc="document.getElementById('";
	//doc="";
	//st="')";
	st="').style";
	yprop=".top";
	xprop=".left";
	vis="\'show\'";
	vis="\'visible\'";
	hid="\'hide\'";
	hid="\'hidden\'";
}else{
	ypos="document.body.scrollTop";
	doc="";
	st=".style";
	yprop=".pixelTop";
	xprop=".pixelLeft";
	vis="\'visible\'";
	hid="\'hidden\'";
}
function ani(){
	y=eval(ypos);
	zz=eval(doc+"mm"+st+yprop)-mainTop;
	xx=y;
	if(y-zz>150)xx=zz+45;else if(y-zz<-150)xx=zz-45;
	else if(y-zz>50)xx=zz+25;else if(y-zz<-50)xx=zz-25;
	else if(y-zz>15)xx=zz+5;else if(y-zz<-15)xx=zz-5;
	else if(y-zz>5)xx=zz+2;else if(y-zz<-5)xx=zz-2;
	else if(y-zz>0)xx=zz+1;else if(y-zz<0)xx=zz-1;
	eval(doc+"mm"+st+yprop+"="+(xx+mainTop));
	if(mlm!=-1)
		eval(doc+"dm"+mlm+st+yprop+"="+(xx+subTop));
	setTimeout("ani()",20);
}
function sm(l){
	keep=l; hideall(); showitnow=1
	showit(l)
}
function showit(l){
	eval(doc+"dm"+l+st+".visibility="+vis);
	eval(doc+"dm"+l+st+yprop+"="+ypos+"+"+subTop); 
	return true;
}
function hm(){
	keep=-1; setTimeout('hideall()',500);
	return true;
}
keep=-1
function hideall(){
	for(i=0;i<mainAnz;i++){  
		if(i!=mlm){
			hideit=0; checkmousepos(i)
			if(keep!=i){ 
				if(hideit){ 
					eval(doc+'dm'+i+st+'.visibility='+hid);
					if (ie) document.images[mainImages[i]].src=imgPath+mainImages[i]+".gif";
					if (ns) document.images[mainImages[i]].src=imgPath+mainImages[i]+'.gif';

				} 
			}
		}
	}
}
document.onmousemove = getmousepos
if (ns) document.captureEvents(Event.MOUSEMOVE)
function getmousepos(e){
	if(ns){mousex=e.pageX; mousey=e.pageY}
	if(ie){mousex=event.clientX; mousey=event.clientY;}
}
function checkmousepos(i){          
	if(ns){     
		x_min=eval("document.getElementById('dm"+i+"').left")
		x_max=x_min+eval("document.getElementById('dm"+i+"').style.pixelWidth")
		y_min=eval("document.getElementById('dm"+i+"').top")
		y_max=y_min+eval("document.getElementById('dm"+i+"').style.pixelHeight")
	}    
	if(ie){     
		x_min=eval('dm'+i+'.style.pixelLeft')
		x_max=x_min+eval('dm'+i+'.style.pixelWidth')
		y_min=eval('dm'+i+'.style.pixelTop')
		y_max=y_min+eval('dm'+i+'.style.pixelHeight')
	}
	if (mousex>=x_min && mousex<=x_max && mousey>=y_min && mousey<=y_max){
		hideit=0; setTimeout('hideall()',500)
	}
	else { hideit=1 }
	return hideit
}
function createmain(){
	openmain();
	for(i=0;i<mainAnz;i++){
		if(mlm==-1&&mainLinks[i]&&mainLinks[i]!=""){
			if( (location.href.indexOf(mainLinks[i].substring(2,mainLinks[i].length))!=-1)
			 || ((location.href+'index.htm').indexOf(mainLinks[i].substring(2,mainLinks[i].length))!=-1) )
				mlm=i;
		}
		if(mlm==-1&&subMenuLinks[i])
			for(j=0;j<subMenuLinks[i].length;j++){
				if(location.href.indexOf(subMenuLinks[i][j].substring(2,subMenuLinks[i][j].length))!=-1){
					mlm=i;mls=j;
				}
			}
		if(i!=mlm)
			addtomain(i,mainImages[i],mainLinks[i],mainMOs[i],false);
		else{
			if(mls!=-1)
				addtomain(i,mainImages[i],mainLinks[i],mainMOs[i],true);
			else
				addtomain(i,mainImages[i],"",mainMOs[i],true);
		}
	}
	closemain();
}
function openmain(){
	if(ie){
		d=document;
	}else{
		d=document;
		// d=eval("document.mm.document");
	}
	eval(doc+"mm"+st+xprop+"="+mainLeft);
	d.write('<table border=0 cellspacing=0 cellpadding=0><tr>');
}
function dummy(){
	return true;
}
function addtomain(nr,image,link,motext,selected)
{
	d.write('<td width='+(nr==2?imgWidth2:imgWidth)+' height='+imgHeight+'>');
	d.write('<a href=\"');
	if(link!="")
		d.write(link)
	else
		d.write('javascript:void dummy();');
	if(!selected){
		d.write('\" title=\"'+motext+'\" onmouseover=\"'+image+'.src=\''+imgPath+image+'_bunt.gif\';sm('+nr+');window.status=\''+motext+'\';return true\" onmouseout=\"window.status=\'\';hm();\">');
		d.write('<img name=\"'+image+'\" alt=\"'+motext+'\" src=\"'+imgPath+image+'.gif\" width='+(nr==2?imgWidth2:imgWidth)+' height='+imgHeight+' border=0>');
	}else{
		d.write('\" title=\"'+motext+'\" onmouseover=\"sm('+nr+');window.status=\''+motext+'\';return true\" onmouseout=\"window.status=\'\';hm();\">');
		d.write('<img name=\"'+image+'\" alt=\"'+motext+'\" src=\"'+imgPath+image+'_bunt.gif\" width='+(nr==2?imgWidth2:imgWidth)+' height='+imgHeight+' border=0>');
	}
	d.write('</a></td>');
	d.write('<td width='+gapWidth+' height='+imgHeight+'><img src=\"'+imgPath+'fill.gif\" width='+gapWidth+' height='+imgHeight+' border=0></td>');
}
function closemain(){
	d.write('</tr></table>');
}
function createsub(nr){
	openmenu(nr);
	if(subMenuTitles[nr])
		for(i=0;i<subMenuTitles[nr].length;i++){
			if(nr==mlm&&i==mls){
				addtomenu(subMenuTitles[nr][i],"",mainSelColors[nr],nr);
			}else{
				if (subMenuLinks[nr][i].indexOf("#")==-1)
					addtomenu(subMenuTitles[nr][i],subMenuLinks[nr][i],mainColors[nr],nr);
				else if (mls!=-1 && mlm!=-1
				    &&	subMenuLinks[nr][i].indexOf(subMenuLinks[mlm][mls])!=-1)
					addtomenu(subMenuTitles[nr][i],subMenuLinks[nr][i],subSubColors[nr],nr);
			}
		}
	closemenu(nr);
}
function openmenu(nr){
	if(ie){
		d=document;
	}else{
		d=document;
		// d=eval("document.getElementById('dm"+nr+"').document");
	}
	d.write('<table width='+((nr==2&&mlm!=2)?imgWidth2:imgWidth)+' border=0 cellspacing=0 cellpadding=0>');
}
function addtomenu(title,link,color,nr){
	d.write('<tr align=\"center\">');
	if(link!="")
		d.write('<td bgcolor=\"'+color+'\"><a href=\"'+link+'\" class=\"dropitem\">'+title+'</a></td>');
	else
		d.write('<td bgcolor=\"'+color+'\" class=\"dropitemsel\">'+title+'</td>');
	d.write('</tr>');
	d.write('<tr align=\"center\">');
	d.write('<td><img src=\"'+imgPath+'fill.gif\" height='+gapHeight+'></td>');
	d.write('</tr>');
}
function closemenu(nr){
	d.write('</table>');
	if(nr==mlm){
		eval(doc+"dm"+nr+st+xprop+"="+selSubLeft);
		eval(doc+'dm'+nr+st+'.visibility='+vis);
	}else
		eval(doc+"dm"+nr+st+xprop+"="+(nr*(imgWidth+gapWidth)+(nr>2?imgWidth:0)+mainLeft));
}
