//menu tabs and items: tabs with d=0, items after d++
items=Array();
items_de=Array();
items_fr=Array();
links=Array();
targets=Array();
types=Array();
pages=Array();

//new tab
c=0;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
items[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Home';
links[c][d]='/';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Anmelden';
links[c][d]='/index/login.html';
targets[c][d]='_self';
d++;
items[c][d]='Login to your account';
items_de[c][d]='Login to your account';
items_fr[c][d]='Connectez vous a votre compte';
links[c][d]='/index/login.html';
targets[c][d]='_self';
d++;
items[c][d]='Create an Account';
items_de[c][d]='Create an Account';
items_fr[c][d]='Cr&eacute;ez un compte';
links[c][d]='/index/join.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='iSoftPhone';
links[c][d]='/isoftphone/description.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Features';
links[c][d]='/isoftphone/features.html';
targets[c][d]='_self';
d++;
items[c][d]='Features';
links[c][d]='/isoftphone/features.html';
targets[c][d]='_self';
d++;
items[c][d]='Tour';
links[c][d]='/isoftphone/tour.html';
targets[c][d]='_self';
d++;
items[c][d]='Awards';
links[c][d]='/isoftphone/awards.html';
targets[c][d]='_self';
d++;
items[c][d]='License';
links[c][d]='/isoftphone/license.html';
targets[c][d]='_self';
d++;
items[c][d]='Online Guide';
links[c][d]='/isoftphone/manual/';
targets[c][d]='_blank';
d++;
items[c][d]='Report a bug';
links[c][d]='/isoftphone/bugreport.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='A1';
links[c][d]='/isoftphoneA1/beschreibung.html';
targets[c][d]='_self';
d++;
items[c][d]='Beschreib -ung';
links[c][d]='/isoftphoneA1/beschreibung.html';
targets[c][d]='_self';
d++;
items[c][d]='Funktionen';
links[c][d]='/isoftphoneA1/funktionen.html';
targets[c][d]='_self';
d++;
items[c][d]='Galerie';
links[c][d]='/isoftphoneA1/galerie.html';
targets[c][d]='_self';
d++;
items[c][d]='A1 Innovation Days in Krems';
links[c][d]='/isoftphoneA1/innovationdays.html';
targets[c][d]='_self';
d++;
items[c][d]='Der Bericht vom ORF';
links[c][d]='/isoftphoneA1/orfbericht.html';
targets[c][d]='_self'; 
d++;
items[c][d]='Heise Bericht ct\'Magazin';
links[c][d]='/isoftphoneA1/heisebericht.html';
targets[c][d]='_self';
d++;
items[c][d]='Presse -Spiegel';
links[c][d]='/isoftphoneA1/pressespiegel.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Partner Program';
links[c][d]='/index/business.html';
targets[c][d]='_self';
d++;
items[c][d]='Mehr Geschäft';
links[c][d]='/index/business.html';
targets[c][d]='_self';
d++;
items[c][d]='Vorteile';
links[c][d]='/index/benefits.html';
targets[c][d]='_self';
d++;
items[c][d]='Partner werden';
links[c][d]='/index/partner.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Support';
links[c][d]='/index/support.html';
targets[c][d]='_self';
d++;
items[c][d]='Online Help Topics';
links[c][d]='/index/support.html';
targets[c][d]='_self';
d++;
items[c][d]='Mac Produkte Tour';
links[c][d]='/index/tour.html';
targets[c][d]='_self';
d++;
items[c][d]='Contact Us';
links[c][d]='/index/contact.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='topbar';
pages[c]=Array();
d=0;
items[c][d]='Über Xnet';
links[c][d]='/index/aboutus.html';
targets[c][d]='_self';
d++;
items[c][d]='About us';
links[c][d]='/index/aboutus.html';
targets[c][d]='_self';
d++;
items[c][d]='Why Xnet?';
links[c][d]='/index/whyxnet.html';
targets[c][d]='_self';
d++;
items[c][d]='5 reasons';
links[c][d]='/index/5reasons.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='btn_freetrial';
pages[c]=Array();
pages[c]['/index/mirrors.html']='/index/download.html';
d=0;
items[c][d]='Download & Try';
links[c][d]='/index/download.html';
targets[c][d]='_self';
d++;
items[c][d]='Download & Try';
links[c][d]='/index/download.html';
targets[c][d]='_self';
//d++;
//items[c][d]='Archives';
//links[c][d]='/index/download.html?archive';
//targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='btn_buynow';
pages[c]=Array();
pages[c]['/shop/confirm.html']='/shop/buy.html';
pages[c]['/shop/info.html']='/shop/buy.html';
pages[c]['/shop/success.html']='/shop/buy.html';
pages[c]['/shop/failed.html']='/shop/buy.html';
d=0;
items[c][d]='Buy';
items_de[c][d]='Kaufen';
items_fr[c][d]='Achetez';
links[c][d]='/shop/buy.html';
targets[c][d]='_self';
d++;
items[c][d]='Buy';
items_de[c][d]='Kaufen';
items_fr[c][d]='Achetez';
links[c][d]='/shop/buy.html';
targets[c][d]='_self';
d++;
items[c][d]='Coupon guide';
items_de[c][d]='Coupon- Anleitung';
items_fr[c][d]='Guide coupon';
links[c][d]='/shop/couponguide.html';
targets[c][d]='_self';
d++;
items[c][d]='Payment Options without Credit Card';
items_de[c][d]='Zahlung ohne Kreditkarte';
items_fr[c][d]='Modes de paiement sans carte de crédit';
links[c][d]='/shop/po.html';
targets[c][d]='_self';
d++;
items[c][d]='Ihr Warenkorb';
links[c][d]='/shop/confirm.html';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='bottombar';
pages[c]=Array();
d=0;
items[c][d]='iSoftPhone';
links[c][d]='/isoftphone/';
targets[c][d]='_self';
d++;
items[c][d]='Daylite';
links[c][d]='/daylite/';
targets[c][d]='_self';
d++;
items[c][d]='Captain FTP';
links[c][d]='/cftp/';
targets[c][d]='_self';
d++;
items[c][d]='Go2Device';
links[c][d]='/go2device/';
targets[c][d]='_self';

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='userbar';
pages[c]=Array();
pages[c]['/index/seeyou.html']='/logout.php';
d=0;
items[c][d]='User menu';
links[c][d]='/index/usermenu.html';
targets[c][d]='_self';
d++;
items[c][d]='User menu';
links[c][d]='/index/usermenu.html';
targets[c][d]='_self';
d++;
items[c][d]='Your Invoices';
links[c][d]='/index/userinvoices.html';
targets[c][d]='_self';
d++;
items[c][d]='Logout';
links[c][d]='/logout.php';
targets[c][d]='_self';

//menu functions
function initMenu() {
var found=false;
var iii,jjj;
	//searching in sections
	for (ii=0;ii<items.length;ii++) {
		if (types[ii]=='topbar') {
			for (jj=0;jj<items[ii].length;jj++) {
				if (document_root+links[ii][jj]==PHP_SELF || document_root+links[ii][jj]==PHP_SELF+'?'+QUERY_STRING) {
					if (!found || jjj==0 || QUERY_STRING!='') {
						iii=ii;
						jjj=jj;
					}
					found=true;
				}
			}
		}
	}
	//searching in hidden tabs when not found
	if (!found) {
		for (ii=0;ii<items.length;ii++) {
			for (var obj in pages[ii]) {				
				if (document_root+obj==PHP_SELF ||  document_root+obj==PHP_SELF+'?'+QUERY_STRING) {
					if (!found || QUERY_STRING!='') {
						iii=ii;
						//showing visible tab when hidden points to it
						if (pages[ii][obj]!='') {
							PHP_SELF=pages[ii][obj];
							QUERY_STRING='';
							return initMenu();
						} else jjj=0;
					}
					found=true;
				}
			}
		}
	}
	if (!found) {
		iii=0;
		jjj=0;
	}
	return Array(iii,jjj);

}