//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();
icons=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]='Login/Join';
links[c][d]='/isoftphone/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]='/isoftphone/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]='/isoftphone/join.html';
targets[c][d]='_self';
d++;
items[c][d]='Invite a friend';
items_de[c][d]='Invite a friend';
items_fr[c][d]='Invitez un(e) ami(e)';
links[c][d]='/isoftphone/invite.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/whatsnew.html';
targets[c][d]='_self';
d++;
items[c][d]='Description';
links[c][d]='/isoftphone/description.html';
targets[c][d]='_self';
d++;
items[c][d]='Features';
links[c][d]='/isoftphone/features.html';
targets[c][d]='_self';
d++;
items[c][d]='Benefits';
links[c][d]='/isoftphone/benefits.html';
targets[c][d]='_self';
d++;
items[c][d]='What\'s new';
links[c][d]='/isoftphone/whatsnew.html';
targets[c][d]='_self';
d++;
items[c][d]='Tour';
links[c][d]='/isoftphone/tour.html';
targets[c][d]='_self';
//d++;
//items[c][d]='License';
//inks[c][d]='/isoftphone/license.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]='SIP/VoIP';
links[c][d]='/isoftphone/providers.html';
targets[c][d]='_self';
d++;
items[c][d]='SIP Providers';
links[c][d]='/isoftphone/providers.html';
targets[c][d]='_self';
d++;
items[c][d]='How to configure?';
links[c][d]='/isoftphone/howtoconfigure.html';
targets[c][d]='_self';
d++;
items[c][d]='SIP Hardware';
links[c][d]='/isoftphone/hardware.html';
targets[c][d]='_self';
d++;
items[c][d]='How does VoIP work?';
links[c][d]='/isoftphone/voip.html';
targets[c][d]='_self';
d++;
items[c][d]='About SIP';
links[c][d]='/isoftphone/sip.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]='Partners/Resellers';
links[c][d]='/isoftphone/business.html';
targets[c][d]='_self';
d++;
items[c][d]='Grow your business';
links[c][d]='/isoftphone/business.html';
targets[c][d]='_self';
d++;
items[c][d]='iSoftPhone Solutions';
links[c][d]='/isoftphone/solutions.html';
targets[c][d]='_self';
d++;
items[c][d]='Partner Program Sign Up';
links[c][d]='/isoftphone/partner.html';
targets[c][d]='_self';
//d++;
//items[c][d]='Application Form';
//links[c][d]='/isoftphone/joinpartners.html';
//targets[c][d]='_self';
d++;
items[c][d]='Download iSoftPhone Pro';
links[c][d]='/isoftphone/partnerdownload.html';
targets[c][d]='_self';
d++;
items[c][d]='Press Kit';
links[c][d]='/isoftphone/presskit.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();
icons[c]=Array();
d=0;
items[c][d]='Support';
links[c][d]='/isoftphone/support.html';
targets[c][d]='_self';
d++;
items[c][d]='Trouble- shoot';
links[c][d]='/isoftphone/support.html';
targets[c][d]='_self';
icons[c][d]='troubleshoot';
d++;
items[c][d]='Connection problem';
links[c][d]='/isoftphone/connectionproblem.html';
targets[c][d]='_self';
icons[c][d]='connect';
d++;
items[c][d]='Built-In help';
links[c][d]='/isoftphone/builtinhelp.html';
targets[c][d]='_self';
icons[c][d]='manuals';
d++;
items[c][d]='Provider solutions';
links[c][d]='/isoftphone/providersolutions.html';
targets[c][d]='_self';
icons[c][d]='provider';
d++;
items[c][d]='iSoftPhone crash';
links[c][d]='/isoftphone/bugreport.html';
targets[c][d]='_self';
icons[c][d]='crash';
d++;
items[c][d]='Configura- tion guide';
links[c][d]='/isoftphone/howtoconfigure.html';
targets[c][d]='_self';
icons[c][d]='config';
d++;
items[c][d]='FAQ';
links[c][d]='/isoftphone/faq.html';
targets[c][d]='_self';
icons[c][d]='faq';
d++;
items[c][d]='Lost key';
links[c][d]='/isoftphone/lostkey.html';
targets[c][d]='_self';
icons[c][d]='key';
d++;
items[c][d]='Lost pass';
links[c][d]='/isoftphone/lostpass.html';
targets[c][d]='_self';
icons[c][d]='login';
d++;
items[c][d]='Invoice need';
links[c][d]='/isoftphone/invoiceneed.html';
targets[c][d]='_self';
icons[c][d]='invoice';
//d++;
//items[c][d]='iSoftPhone directory';
//links[c][d]='/isoftphone/directory.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();
icons[c]=Array();
d=0;
items[c][d]='About Xnet';
links[c][d]='/isoftphone/aboutus.html';
targets[c][d]='_self';
d++;
items[c][d]='About us';
links[c][d]='/isoftphone/aboutus.html';
targets[c][d]='_self';
d++;
items[c][d]='Why Xnet?';
links[c][d]='/isoftphone/whyxnet.html';
targets[c][d]='_self';
d++;
items[c][d]='5 reasons';
links[c][d]='/isoftphone/5reasons.html';
targets[c][d]='_self';
d++;
items[c][d]='Awards';
links[c][d]='/isoftphone/awards.html';
targets[c][d]='_self';
d++;
items[c][d]='References';
links[c][d]='/isoftphone/references.html';
targets[c][d]='_self';
d++;
items[c][d]='User Reviews';
links[c][d]='/isoftphone/userreviews.html';
targets[c][d]='_self';
d++;
items[c][d]='iSoftPhone News';
links[c][d]='/isoftphone/news.html';
targets[c][d]='_self';
d++;
items[c][d]='Case Study A1';
links[c][d]='/isoftphone/casestudyA1.html';
targets[c][d]='_self';
d++;
items[c][d]='Press Echoes';
links[c][d]='/isoftphone/pressechoes.html';
targets[c][d]='_self';
d++;
items[c][d]='Comment our blog';
links[c][d]='/isoftphone/usercommunity.html';
targets[c][d]='_self';
d++;
items[c][d]='Contact Us';
links[c][d]='/isoftphone/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]='btn_freetrial';
pages[c]=Array();
pages[c]['/isoftphone/mirrors.html']='/isoftphone/download.html';
d=0;
items[c][d]='Download & Try';
links[c][d]='/isoftphone/download.html';
targets[c][d]='_self';
d++;
items[c][d]='Download iSoftPhone';
links[c][d]='/isoftphone/download.html';
targets[c][d]='_self';
d++;
items[c][d]='Archives';
links[c][d]='/isoftphone/download.html?archive';
targets[c][d]='_self';
d++;
items[c][d]='Other products';
links[c][d]='http://www.captainftp.com';
targets[c][d]='_blank';

//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 iSoftPhone';
items_de[c][d]='Buy iSoftPhone';
items_fr[c][d]='Achetez iSoftPhone';
links[c][d]='/shop/buy.html';
targets[c][d]='_self';
d++;
items[c][d]='Buy iSoftPhone';
items_de[c][d]='Buy iSoftPhone';
items_fr[c][d]='Achetez iSoftPhone';
links[c][d]='/shop/buy.html';
targets[c][d]='_self';
//d++;
//items[c][d]='Upgrade iSoftPhone';
//links[c][d]='/shop/upgrade.html';
//targets[c][d]='_self';
d++;
items[c][d]='Coupon guide';
items_de[c][d]='Coupon guide';
items_fr[c][d]='Guide coupon';
links[c][d]='/shop/couponguide.html';
targets[c][d]='_self';
d++;
items[c][d]='Promo';
items_de[c][d]='Promo';
items_fr[c][d]='Promo';
links[c][d]='/isoftphone/promo.html';
targets[c][d]='_self';
d++;
items[c][d]='Earn discount credits';
items_de[c][d]='Earn discount credits';
items_fr[c][d]='Obtenez des ristournes';
links[c][d]='/isoftphone/refer.html';
targets[c][d]='_self';
d++;
items[c][d]='Payment Options without Credit Card';
items_de[c][d]='Payment Options without Credit Card';
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]='Your basket';
//links[c][d]='/shop/'+(button_clicked!='' ? button_clicked : 'buy')+'.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]='CRM Integration';
links[c][d]='/isoftphone/daylite.html';
targets[c][d]='_self';
d++;
items[c][d]='CRM Integration';
links[c][d]='/isoftphone/daylite.html';
targets[c][d]='_self';
d++;
items[c][d]='Fone- Connector Data On Demand';
links[c][d]='/isoftphone/foneconnector.html';
targets[c][d]='_self';
//d++;
//items[c][d]='Simple configur- ation of iSP';
//links[c][d]='/isoftphone/howtoconfigure.html';
//targets[c][d]='_self';
//d++;
//items[c][d]='Create your own Phone network';
//links[c][d]='/isoftphone/ownnetwork.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]='userbar';
pages[c]=Array();
pages[c]['/isoftphone/update.html']='/isoftphone/usermenu.html';
pages[c]['/isoftphone/seeyou.html']='/logout.php';
d=0;
items[c][d]='User menu';
links[c][d]='/isoftphone/usermenu.html';
targets[c][d]='_self';
d++;
items[c][d]='User menu';
links[c][d]='/isoftphone/usermenu.html';
targets[c][d]='_self';
d++;
items[c][d]='Your Invoices';
links[c][d]='/isoftphone/userinvoices.html';
targets[c][d]='_self';
d++;
items[c][d]='Logout';
links[c][d]='/logout.php';
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]='Beschreib -ung';
links[c][d]='/isoftphoneA1/description.html';
targets[c][d]='_self';
d++;
items[c][d]='Beschreib -ung';
links[c][d]='/isoftphoneA1/description.html';
targets[c][d]='_self';
d++;
items[c][d]='Funktionen';
links[c][d]='/isoftphoneA1/features.html';
targets[c][d]='_self';
d++;
items[c][d]='Galerie';
links[c][d]='/isoftphoneA1/tour.html';
targets[c][d]='_self';
d++;
items[c][d]='A1 Innovation Days in Krems';
links[c][d]='http://www.mac4pros.com/isoftphoneA1/innovationdays.html';
targets[c][d]='_blank';
d++;
items[c][d]='ORF report';
links[c][d]='http://www.mac4pros.com/isoftphoneA1/orfbericht.html';
targets[c][d]='_blank'; 

//new tab
c++;
items[c]=Array();
items_de[c]=Array();
items_fr[c]=Array();
links[c]=Array();
targets[c]=Array();
types[c]='btn_twitter';
pages[c]=Array();
d=0;
items[c][d]='Xnet Tweets';
links[c][d]='/isoftphone/twitter_widget.html';
targets[c][d]='_self';
/*d++;
items[c][d]='Follow iSoftPhone on Twitter';
links[c][d]='/isoftphone/twitter_status.html';
targets[c][d]='_self';*/
d++;
items[c][d]='Xnet Tweets';
links[c][d]='/isoftphone/twitter_widget.html';
targets[c][d]='_self';
/*d++;
items[c][d]='Follow iSoftPhone Friends';
links[c][d]='/isoftphone/twitter_friends_status.html';
targets[c][d]='_self';*/
d++;
items[c][d]='Xnet Friends';
links[c][d]='/isoftphone/twitter_friends.html';
targets[c][d]='_self';
/*d++;
items[c][d]='iSoftPhone Followers';
links[c][d]='/isoftphone/twitter_followers.html';
targets[c][d]='_self';
d++;
items[c][d]='Sign up to Twitter';
links[c][d]='https://twitter.com/signup';
targets[c][d]='_blank';*/

//menu functions
function initMenu() {
var found=false;
var iii,jjj;
	//searching in sections
	for (ii=0;ii<items.length;ii++) {
		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);

}