var Arr=new Array();
var Arr1=new Array();
var ArrSub=new Array();
var ArrLink=new Array();
var ArrSubLink=new Array();


function designMenu(mainMenuIdx,subMenuIdx)
{
var strTemp;
Arr[0]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Why Postpaid";
Arr[1]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Postpaid Plans";
//Arr[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> What is best for you";
//Arr[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Special Schemes";
//Arr[4]="&nbsp;<img src='../images/rd_arw.gif' alt='' name='plus' width='5' height='5' border='0'  /> Promotional offers";
Arr[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Features & Benefits";
Arr[3]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus6' width='5' height='5' border='0'  /> Pay Your Bills";
Arr[4]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> FAQ";
Arr[5]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Queries";
Arr[6]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> Buy now";

Arr1[0]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Why Postpaid</font>";
Arr1[1]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='minus22' width='5' height='5' border='0'  /> <font style='text-color:red'>Postpaid Plans</font>";
//Arr1[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>What is best for you</font>";
//Arr1[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Special Schemes</font>";
//Arr1[4]="&nbsp;<img src='../images/rd_arw.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Promotional offers</font>";
Arr1[2]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Features & Benefits</font>";
Arr1[3]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Pay Your Bills</font>";
Arr1[4]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /><font style='text-color:red'> FAQ</font>";
Arr1[5]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Queries</font>";
Arr1[6]="&nbsp;<img src='../images/redbox_link.gif' alt='' name='plus' width='5' height='5' border='0'  /> <font style='text-color:red'>Buy now</font>";

ArrLink[0]="../postpaid/why_postpaid.html";
ArrLink[1]="../postpaid/postpaid_package1.html";
//ArrLink[2]="../postpaid/what_is_best_for_you.html";
//ArrLink[2]="../postpaid/special_scheme.html";
ArrLink[2]="../postpaid/features_benefits.html";
ArrLink[3]="https://ebpp.airtel.lk";
ArrLink[4]="../postpaid/faq.html";
ArrLink[5]="../postpaid/queries.html";
ArrLink[6]="https://ebpp.airtel.lk";




//ArrSubLink[0]=new Array();
//ArrSubLink[0][0]="why_postpaid.html";
ArrSub[0]=new Array();
ArrSub[1]=new Array();
ArrSub[2]=new Array();

//ArrSubLink[1]=new Array();
//ArrSubLink[1][0]="../postpaid/postpaid_package1.html";

//ArrSubLink[2]=new Array();
//ArrSubLink[2][0]="special_scheme.html";

ArrSub[3]=new Array();
//ArrSubLink[3]=new Array();
//ArrSubLink[3][0]="features_benefits.html";


ArrSub[4]=new Array();
//ArrSub[4][0]="&nbsp;<img src='../images/rd_arw.gif' alt='' name='plus' width='5' height='5' border='0'  /> Locations";
//ArrSub[4][1]="&nbsp;<img src='../images/rd_arw.gif' alt='' name='plus' width='5' height='5' border='0'  /> Pay online";


//ArrSubLink[4]=new Array();
//ArrSubLink[4][0]="https://ebpp.airtel.lk";
//ArrSubLink[4][1]="../index.html";

ArrSub[5]=new Array();
//ArrSubLink[5][0]="faq.html";

ArrSub[6]=new Array();
//ArrSubLink[6][0]="queries.html";
ArrSub[7]=new Array();
//ArrSubLink[7]=new Array();
//ArrSubLink[7][0]="https://ebpp.airtel.lk";


strTemp="";
for(i=0;i<Arr.length;i++)
{
	strTemp+="<div id='divMainMenu"+i+"' style='padding-top:0px'><table border='0' cellpadding='0' cellspacing='0' width='166' style='padding-top:0px;margin-left:-5px;'>";
    if(parseInt(mainMenuIdx)==parseInt(i))
	    strTemp+="<TR style='padding-left: 0px;border-collapse: collapse;background-image:url(../images/bg_leftnav_ebusiness.gif); background-position:bottom; background-color:#f3f3f3;'><TD style='cursor:hand;cursor:pointer;height:22px;padding-left:6px;' onclick='openPage("+i+",0)'>"+Arr1[i]+"</TD></TR>";
	else
	    strTemp+="<TR style='background-image:url(../images/bg_leftnav_ebusiness.gif); background-position:bottom; background-color:#f3f3f3;'><TD style='cursor:hand;cursor:pointer;height:22px;padding-left:6px;' onclick='openPage("+i+",0)'>"+Arr[i]+"</TD></TR>";
	strTemp+="</table></div><div id='divSubMenu"+i+"' style='margin-left:-4px;'></div>";
	
}
document.getElementById("divMenu").innerHTML=strTemp;
if(parseInt(mainMenuIdx)!=-1 && parseInt(subMenuIdx)!=-1)
	chkLink(mainMenuIdx);
}
function chkLink(mainIndex)
{
	var strSubTemp="";
	var objMainMenu=document.getElementById("divMainMenu"+mainIndex);
	var objSubMenu=document.getElementById("divSubMenu"+mainIndex);
//	alert(mainIndex);
//	alert(ArrSub[mainIndex].length);
	for(i=0;i<Arr.length;i++)
		document.getElementById("divSubMenu"+i).style.display="none";
//add this code
	if(ArrSub[mainIndex].length){
	document.getElementById("divSubMenu"+mainIndex).style.display="block";
	}
	
	//new code ends here

	for(i=0;i<ArrSub[mainIndex].length;i++)
	{
		strSubTemp+="<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
		strSubTemp+="<TR style='background-color:#f5f5f5;height:22px'><TD valign='top' width='10%'>&nbsp;</TD><TD  style='cursor:hand;cursor:pointer;padding-left:6px;' onclick='openPage1("+mainIndex+","+i+")'>"+ArrSub[mainIndex][i]+"</TD></TR>";
		strSubTemp+="</table>";	
		//alert(ArrSub[mainIndex][i]);
	}
	//alert(strSubTemp);
	objSubMenu.innerHTML=strSubTemp;
//	openPage(mainIndex,0)
//	document.getElementById("div"+mainIndex).style.display="none";
}
function openPage(mainMenuIdx,subMenuIdx)
{

	
		if(mainMenuIdx==3 || mainMenuIdx==6){
			window.open(ArrLink[mainMenuIdx]);
			}else{
			window.location.href=ArrLink[mainMenuIdx];
			}
	
}

function openPage1(mainMenuIdx,subMenuIdx)
{



			window.location.href=ArrSubLink[mainMenuIdx][subMenuIdx];
	
	
}