	var pageId=0;
var list_id=0;
var contentId;

var arr_pages =new Array();
arr_pages[0] = "#"
arr_pages[2] = "top_ten_search/What_are_the_features_of_b2.html";
arr_pages[3] = "top_ten_search/How_does_b2_Ac_help_me_save_more.html";
arr_pages[4] = "top_ten_search/What_b2_does_not_offer.html";
arr_pages[5] = "top_ten_search/How_can_I_move_money_into_the_b2_savings_ac.html";
arr_pages[6] = "top_ten_search/How_can_I_move_money_out_from_the_b2_savings_Ac.html";
arr_pages[7] = "top_ten_search/What_is_Quantum_Optima.html";
arr_pages[8] = "top_ten_search/How_can_I_apply_for_the_b2_savingsac.html";
arr_pages[9] = "top_ten_search/What_is_the_b2_security_card.html";
arr_pages[10] = "top_ten_search/What_are_the_benefits_of_eWallet.html";
arr_pages[11] = "top_ten_search/What_do_I_do_if_I_have_a_problem_with_my_b2_Ac.html";

arr_pages[13] = "navigating_b2/your_b2_savings_account.html";
arr_pages[14] = "navigating_b2/opening_your_b2_savings_account.html";
arr_pages[15] = "navigating_b2/things_that_b2_doesnt_offer.html";
arr_pages[16] = "navigating_b2/moving_money_out_of_your_b2_account.html";
arr_pages[17] = "navigating_b2/moving_money_into_your_b2_account.html";
arr_pages[18] = "navigating_b2/demand_drafts_made_easy.html";
arr_pages[19] = "navigating_b2/pay_your_bills.html";
arr_pages[20] = "navigating_b2/mobile_recharge_through_b2.html";

arr_pages[21] = "navigating_b2/b2_fixed_deposit_and_recurring_deposit.html";
arr_pages[22] = "navigating_b2/b2_personal_loans.html";
arr_pages[23] = "navigating_b2/your_b2_virtual_credit_card.html";
arr_pages[24] = "navigating_b2/your_e-wallet.html";
arr_pages[25] = "navigating_b2/your_b2_credit_card.html";
arr_pages[26] = "navigating_b2/troubleshooting.html";
arr_pages[27] = "navigating_b2/online_security_measures.html";
arr_pages[28] = "navigating_b2/closing_your_b2_savings_account.html";

arr_pages[30] = "what_is_b2/what_is_b2.html";

/*arr_pages[13] = "about_your_crystal_account/Why_a_crystal_account_makes_sense.html";
arr_pages[14] = "about_your_crystal_account/Whats_so_unique_about_the_crystal_account.html";
arr_pages[15] = "about_your_crystal_account/What_all_can_I_do_with_my_crystal_account.html";
arr_pages[16] = "about_your_crystal_account/Why_is_a_Crystal_account_simple_smart_and_usable.html";
arr_pages[17] = "about_your_crystal_account/What_do_I_need_to_get_my_crystal_account.html";
arr_pages[18] = "about_your_crystal_account/How_many_days_will_I_need_to_activate_my_account.html";
arr_pages[19] = "about_your_crystal_account/What_kind_of_charges_and_fees_can_I_expect_on_this_account.html";
arr_pages[20] = "about_your_crystal_account/What_kind_of_customer_support_will_I_get_on_this_account.html";
arr_pages[21] = "about_your_crystal_account/What_do_other_people_say_about_the_Crystal_account.html";
arr_pages[22] = "about_your_crystal_account/What_are_the_terms_and_conditions_and_fine_prints_about_the_account.html";
arr_pages[23] = "about_your_crystal_account/How_can_i_be_sure_that_the_site_is_secure.html";
arr_pages[24] = "about_your_crystal_account/How_can_i_be_sure_that_my_privacy_will_be_protected_and_my_details_kept_confidential.html";




arr_pages[26] = "unique_tools/The_dashboard.html";
arr_pages[27] = "unique_tools/The_one_page_view.html";
arr_pages[28] = "unique_tools/The_ability_to_interact_through_many_points.html";
arr_pages[29] = "unique_tools/Smarter_navigation.html";
arr_pages[30] = "unique_tools/Web_interface_functionality.html";
arr_pages[31] = "unique_tools/Usability_features.html";

arr_pages[33] = "products_and_services/Crystal_Savings_Account.html";
arr_pages[34] = "products_and_services/Credit_Cards_Virtual_Credit_Card_and_the_eWallett.html";
arr_pages[35] = "products_and_services/Personal_Loans.html";
arr_pages[36] = "products_and_services/Fixed_and_Recurring_Deposits.html";
arr_pages[37] = "products_and_services/ECS.html";
arr_pages[38] = "products_and_services/Demand_Drafts.html";
arr_pages[39] = "products_and_services/Fund_Transfers.html";
arr_pages[40] = "products_and_services/Bill_Payment.html";
arr_pages[41] = "products_and_services/Mobile_Recharge.html";
arr_pages[42] = "products_and_services/Customer_Support_through_Chat.html";

arr_pages[44] = "how_to_apply/Lorem1.html"
arr_pages[45] = "how_to_apply/Lorem2.html"
arr_pages[46] = "how_to_apply/Lorem3.html"
arr_pages[47] = "how_to_apply/Lorem4.html"

arr_pages[49] = "about_icici_bank/About_us_and_history.html"
arr_pages[50] = "about_icici_bank/Why_we_chose_to_offer_you_the_crystal_account.html"
arr_pages[51] = "about_icici_bank/Our_philosophy.html"
arr_pages[52] = "about_icici_bank/Contact_Us.html"
*/

function setIconId(val){
	
	document.getElementById("iconId").value = val;
	document.location ="lm_small_view/template/top_ten_search.html?iconId="+val
	
}

function setGrayBack(trObj,viewFlag)
{
	var cssName = '';
	
	if(viewFlag == 'smallView')
	{
		cssName = 'StyleGrayBackground';
	}
	else
	{
		cssName = 'StyleBigViewGrayBackground';
	}

	if(list_id != 0)
	{
		var selTrObj = document.getElementById(list_id); 
		
		if(selTrObj!= null)
		{	
			selTrObj.setAttribute('class',cssName);
			selTrObj.className = cssName;
		}
	}
	
	trObj.setAttribute('class',cssName);
	trObj.className = cssName;
}

function setWhiteBack(trObj,viewFlag)
{
	var cssName = '';
	
	if(viewFlag == 'smallView')
	{
		cssName = 'StyleWhiteBackground';
	}
	else
	{
		cssName = 'StyleBigViewWhiteBackground';
	}

	if(list_id != trObj.id)
	{
		trObj.setAttribute('class',cssName);
		trObj.className = cssName;
	}
}


function init()
{
	div_topCurveStrip=document.getElementById("div_topCurveStrip");
	div_topTenSearch=document.getElementById("div_topTenSearch");
	div_bodyContainer=document.getElementById("div_bodyContainer");
	div_leftOverlappedWhiteStrip=document.getElementById("div_leftOverlappedWhiteStrip");
	div_rightOverlappedWhiteStrip=document.getElementById("div_rightOverlappedWhiteStrip");
	div_mainMenuContainer=document.getElementById("div_mainMenuContainer");
	div_aboutYourCrystalAccount=document.getElementById("div_aboutYourCrystalAccount");
	div_productsAndServices=document.getElementById("div_productsAndServices");
	div_uniqueTools=document.getElementById("div_uniqueTools");
	div_aboutIciciBank=document.getElementById("div_aboutIciciBank");
	div_bodyContent=document.getElementById("div_bodyContent");
	div_leftSliderArrow=document.getElementById("div_leftSliderArrow");
	div_rightSliderArrow=document.getElementById("div_rightSliderArrow");
	div_leftSliderContent=document.getElementById("div_leftSliderContent");
	div_rightSliderContent=document.getElementById("div_rightSliderContent");
	div_bodyBackgroundArea=document.getElementById("div_bodyBackgroundArea");
	div_leftBlueSlider=document.getElementById("div_leftBlueSlider");
	div_rightBlueSlider=document.getElementById("div_rightBlueSlider");
	div_bottomCurveStrip=document.getElementById("div_bottomCurveStrip");
	div_leftSliderMain=document.getElementById("div_leftSliderMain");
	div_rightSliderMain=document.getElementById("div_rightSliderMain");
	div_expandScreen=document.getElementById("div_expandScreen");
	
	setAllBackgroundImages();
}

function setAllBackgroundImages()
{

	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) isInternetExplorer = true;

	if(isInternetExplorer) div_topCurveStrip.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_topstrip.png', sizingMethod='image');"
	else  div_topCurveStrip.style.background = "url(../../../images/lm_topstrip.png) no-repeat";

	if(isInternetExplorer) div_topTenSearch.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_top_ten_search.png', sizingMethod='image');"
	else  div_topTenSearch.style.background = "url(../../../images/lm_top_ten_search.png) no-repeat";

	if(isInternetExplorer) div_leftOverlappedWhiteStrip.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_left_white_strip.png', sizingMethod='image');"
	else  div_leftOverlappedWhiteStrip.style.background = "url(../../../images/lm_left_white_strip.png) no-repeat";

	if(isInternetExplorer) div_rightOverlappedWhiteStrip.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_right_white_strip.png', sizingMethod='image');"
	else  div_rightOverlappedWhiteStrip.style.background = "url(../../../images/lm_right_white_strip.png) no-repeat";

	if(isInternetExplorer) div_aboutYourCrystalAccount.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_about_your_crystal_ac.png', sizingMethod='image');"
	else  div_aboutYourCrystalAccount.style.background = "url(../../../images/lm_about_your_crystal_ac.png) no-repeat";

	if(isInternetExplorer) div_productsAndServices.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_product_and_services.png', sizingMethod='image');"
	else  div_productsAndServices.style.background = "url(../../../images/lm_product_and_services.png) no-repeat";

	if(isInternetExplorer) div_uniqueTools.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_unique_tools.png', sizingMethod='image');"
	else  div_uniqueTools.style.background = "url(../../../images/lm_unique_tools.png) no-repeat";

	if(isInternetExplorer) div_aboutIciciBank.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_about_icici_bank.png', sizingMethod='image');"
	else  div_aboutIciciBank.style.background = "url(../../../images/lm_about_icici_bank.png) no-repeat";

	if(isInternetExplorer) div_bodyBackgroundArea.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_body_back_color.png', sizingMethod='image');"
	else  div_bodyBackgroundArea.style.background = "url(../../../images/lm_body_back_color.png) no-repeat";

	if(isInternetExplorer) div_leftSliderArrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_leftarrow.png', sizingMethod='image');"
	else div_leftSliderArrow.style.background = "url(../../../images/lm_leftarrow.png) no-repeat";

	if(isInternetExplorer) div_rightSliderArrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_rightarrow.png', sizingMethod='image');"
	else  div_rightSliderArrow.style.background = "url(../../../images/lm_rightarrow.png) no-repeat";

	if(isInternetExplorer) div_leftBlueSlider.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_blue_slider.png', sizingMethod='image',);"
	else  div_leftBlueSlider.style.background = "url(../../../images/lm_blue_slider.png) no-repeat";

	if(isInternetExplorer) div_rightBlueSlider.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_blue_slider.png', sizingMethod='image');"
	else  div_rightBlueSlider.style.background = "url(../../../images/lm_blue_slider.png) no-repeat";

	if(isInternetExplorer) div_bottomCurveStrip.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_bottomstrip.png', sizingMethod='image');"
	else  div_bottomCurveStrip.style.background = "url(../../../images/lm_bottomstrip.png) no-repeat";
	
	if(isInternetExplorer) div_expandScreen.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/lm_expand.png', sizingMethod='image');"
	else  div_expandScreen.style.background = "url(../../../images/lm_expand.png) no-repeat";
	

}

/*
function moveSlider(arrowElem)
{
	var state=arrowElem.getAttribute("isOpen");
	var attr;
	var comparison;
	var operation;
	var endLeftPix;
	var endRightPix;
	var leftImgName;
	var rightImgName;
	
	if (state=="1")
	{
		comparison="<="
		operation="-"

		endLeftPix = parseInt(div_leftSliderMain.getAttribute("oriClose"),10);
		endRightPix = parseInt(div_rightSliderMain.getAttribute("oriClose"),10);

		attr="0";
		leftImgName="lm_rightarrow.png";
		rightImgName="lm_leftarrow.png";
	}
	else
	{
		comparison=">="
		operation="+"

		endLeftPix = parseInt(div_leftSliderMain.getAttribute("oriOpen"),10);
		endRightPix = parseInt(div_rightSliderMain.getAttribute("oriOpen"),10);
		attr="1";

		leftImgName="lm_leftarrow.png";
		rightImgName="lm_rightarrow.png";
	}


	if(eval("(parseInt(div_leftSliderMain.style.left,10) "+ operation +" parseInt(mvPix,10))" +comparison +"parseInt(endLeftPix,10)"))
	{
		div_leftSliderMain.style.left = endLeftPix + "px";
		isLeftComplete=true;
	}
	else
	{
		div_leftSliderMain.style.left = eval("(parseInt(div_leftSliderMain.style.left,10)" + operation + " parseInt(mvPix,10)) + 'px'");
	}

	if(eval("(parseInt(div_rightSliderMain.style.right,10) "+ operation +" parseInt(mvPix,10))" +comparison +"parseInt(endRightPix,10)"))
	{
		div_rightSliderMain.style.right = endRightPix + "px";
		isRightComplete=true;
	}
	else
	{
		div_rightSliderMain.style.right = eval("(parseInt(div_rightSliderMain.style.right,10)" + operation + " parseInt(mvPix,10)) + 'px'");
	}


	if(isLeftComplete && isRightComplete)
	{
		clearInterval(sliderInterval);
		isLeftComplete=false;
		isRightComplete=false;
		div_leftSliderArrow.setAttribute("isOpen",attr);
		div_rightSliderArrow.setAttribute("isOpen",attr);

		if(isInternetExplorer) div_leftSliderArrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+leftImgName+"', sizingMethod='image');"
		else div_leftSliderArrow.style.background = "url(../../../images/"+leftImgName+") no-repeat";

		if(isInternetExplorer) div_rightSliderArrow.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+rightImgName+"', sizingMethod='image');"
		else  div_rightSliderArrow.style.background = "url(../../../images/"+rightImgName+") no-repeat";

	}

}
*/

function changeBackgrounImages(id)
{
	var about_your_crystal_ac_png = 'lm_about_your_crystal_ac.png' ;
	var product_and_services_png = 'lm_product_and_services.png' ;
	var how_to_apply_png = 'lm_unique_tools.png' ;
	var about_icici_bank_png = 'lm_about_icici_bank.png' ;
	
	if(id==1) about_your_crystal_ac_png = 'lm_about_your_crystal_ac_hover.png' ;
	if(id==2) product_and_services_png = 'lm_product_and_services_hover.png' ;
	if(id==3) how_to_apply_png = 'lm_unique_tools_hover.png' ;
	if(id==4) about_icici_bank_png = 'lm_about_icici_bank_hover.png' ;

	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) isInternetExplorer = true;
	
	if(isInternetExplorer) div_aboutYourCrystalAccount.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+about_your_crystal_ac_png+"', sizingMethod='image');"
	else  div_aboutYourCrystalAccount.style.background = "url(../../../images/"+about_your_crystal_ac_png+") no-repeat";

	if(isInternetExplorer) div_productsAndServices.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+product_and_services_png+"', sizingMethod='image');"
	else  div_productsAndServices.style.background = "url(../../../images/"+product_and_services_png+") no-repeat";

	if(isInternetExplorer) div_uniqueTools.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+how_to_apply_png+"', sizingMethod='image');"
	else  div_uniqueTools.style.background = "url(../../../images/"+how_to_apply_png+") no-repeat";

	if(isInternetExplorer) div_aboutIciciBank.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../../images/"+about_icici_bank_png+"', sizingMethod='image');"
	else  div_aboutIciciBank.style.background = "url(../../../images/"+about_icici_bank_png+") no-repeat";
}

function setContentInLeftAndRight(viewFlag,id,subId,aniEffect)	{
	document.getElementById("div_leftSliderArrow").style.display="block";
	if(id==2 && viewFlag=="smallView"){
		
		document.getElementById("div_mainContentContainer2").style.display="";
		document.getElementById("div_bodyContainer").style.display="none";
		document.getElementById("whatisB2Content").style.display="block";
		document.getElementById("div_leftOverlappedWhiteStrip2").style.display="block";	
 		document.getElementById("div_rightOverlappedWhiteStrip2").style.display="block";
		document.getElementById("div_leftSliderArrow").style.display="none";
		
		document.getElementById("div_mainContentContainer2").style.left="4px";
		document.getElementById("div_leftOverlappedWhiteStrip2").style.top="-458px";
		document.getElementById("div_leftOverlappedWhiteStrip2").style.left="0px";
		document.getElementById("div_rightOverlappedWhiteStrip2").style.top="-458px";
		document.getElementById("div_rightOverlappedWhiteStrip2").style.left="577px";
		document.getElementById("div_whatIsB2").style.display="none";
		document.getElementById("div_whatIsB2_hover").style.display="block";
		document.getElementById("div_topTenSearch_hover").style.display="none";	
		document.getElementById("div_navigatingb2_hover").style.display="none";
		document.getElementById("div_topTenSearch").style.display="block";	
		document.getElementById("div_navigatingb2").style.display="block";
		if(isInternetExplorer){
			document.getElementById("div_mainContentContainer2").style.top="-498px";

		}
		else { 
			document.getElementById("div_mainContentContainer2").style.top="-500px";

			
		}

		
		return;
	}else{
		if(viewFlag=="smallView"){
		document.getElementById("div_leftOverlappedWhiteStrip2").style.display="none";	
 		document.getElementById("div_rightOverlappedWhiteStrip2").style.display="none";
			}
		
		document.getElementById("div_mainContentContainer").style.display="block";	
		document.getElementById("div_bodyContainer").style.display="block";
		document.getElementById("whatisB2Content").style.display="none";
		document.getElementById("div_mainContentContainer2").style.top="0px";
		document.getElementById("div_mainContentContainer2").style.left="5px";
		document.getElementById("div_leftOverlappedWhiteStrip2").style.top="0px";
		document.getElementById("div_rightOverlappedWhiteStrip2").style.top="0px";

		document.getElementById("div_whatIsB2").style.display="block";
		document.getElementById("div_whatIsB2_hover").style.display="none";
		document.getElementById("div_topTenSearch_hover").style.display="none";	
		document.getElementById("div_navigatingb2_hover").style.display="none";	
		
		
			if(id==0 ){
				document.getElementById("div_mainContentContainer2").style.display="none";
				document.getElementById("div_topTenSearch").style.display="none";
				document.getElementById("div_mainContentContainer").style.display="block";
				document.getElementById("div_topTenSearch_hover").style.display="block";
			}else{
				document.getElementById("div_topTenSearch").style.display="block";
				document.getElementById("div_topTenSearch_hover").style.display="none";				
			}
		
			if(id==1){
				document.getElementById("div_mainContentContainer2").style.display="none";
				document.getElementById("div_mainContentContainer").style.display="block";
				document.getElementById("div_bodyContainer").style.display="block";
				document.getElementById("div_navigatingb2").style.display="none";				
				document.getElementById("div_navigatingb2_hover").style.display="block";
			}else{
				document.getElementById("div_navigatingb2").style.display="block";
				document.getElementById("div_navigatingb2_hover").style.display="none";
			}
			
			if(id==2){
				document.getElementById("div_mainContentContainer2").style.display="block";
				document.getElementById("whatisB2Content").style.display="";
				document.getElementById("div_whatIsB2").style.display="none";
				document.getElementById("div_whatIsB2_hover").style.display="block";
			}else{
				document.getElementById("div_whatIsB2").style.display="block";
				document.getElementById("div_whatIsB2_hover").style.display="none";

			}
			

		}	
	
	contentId = id;
	changeBackgrounImages(id);

	document.getElementById("div_bodyContent").style.display="none";
	document.getElementById("pageNameMain").value=0;
	document.getElementById("frmSmallContainer").src="";
	document.getElementById("div_expandScreen").style.display="none";
	
	var div_leftSliderContent=document.getElementById("div_leftSliderContent");
	var div_rightSliderContent=document.getElementById("div_rightSliderContent");
	div_leftSliderContent.innerHTML="";
	div_rightSliderContent.innerHTML="";
	
	var cnt_treeEle=0;
	var totallength=0;
	var parentid=0;
	for(var p=0;p< id;p++){
		var chld = a[p]['children'].length;
		cnt_treeEle++;
		//alert(cnt_treeEle+"  "+a[p]['caption']);
		for(var q =0;q < chld; q++){
				var ele = a[p]['children'][q]['children'];
				if(ele==null){
					cnt_treeEle++;
					//alert(cnt_treeEle+"  "+a[p]['children'][q]['caption']);
					}else{
				if (a[p]['children'][q]['children'].length > 0){
					var subchld = a[p]['children'][q]['children'].length;
					cnt_treeEle++;
					//alert(cnt_treeEle+"  "+a[p]['children'][q]['caption']);
					for(var r=0;r < subchld; r++){
						cnt_treeEle++;
						//alert(cnt_treeEle+"  "+a[p]['children'][q]['children'][r]['caption']);
					}
				}
			}
		}		
	}
	cnt_treeEle++;
	
	if (subId!=-1)
	{
		//alert(" subid "+subId);
		parentElem=cnt_treeEle;
		cnt_treeEle = subId;
		totallength = a[id]['children'][parentElem]['children'].length;
	}
	else
	{
		totallength = a[id]['children'].length;
	}

	totallength = parseInt(totallength,10) ;
	
	var idLeftDiv = '';
	var tdWidth;
	var cssWhiteClass = '';
	if(viewFlag == 'smallView')
	{
		tdWidth = 281;
		idLeftDiv = 'smallView_left';
		cssWhiteClass = 'StyleWhiteBackground';
		dividelength = totallength/2;
		if(totallength%2 != 0) dividelength = parseInt(dividelength,10) + 1
	}
	else
	{
		tdWidth = 520;
		cssWhiteClass = 'StyleBigViewWhiteBackground';
		idLeftDiv = 'largeView_left';
		dividelength = totallength;
	}

	dividelength = parseInt(dividelength,10) + cnt_treeEle;
	totallength = totallength + cnt_treeEle;
	
	var div_left_innerhtml = "";
	var offset=0;
	//div_leftSliderContent.innerHTML += '<ol start="1" style="padding-left:0px;" class="StyleLmLeftSlideText">';

	var div_left_innerhtml = '<table id='+idLeftDiv+' cellpadding="0" cellspacing="3" border="0">';
	for(var i = cnt_treeEle; i < (dividelength); i++)
	{
		if (subId!=-1)
		{
			var caption = a[id]['children'][parentElem]['children'][offset]['caption'];		
			var ele = a[id]['children'][parentElem]['children'][offset]['children'];
			
			if(viewFlag == 'smallView')
			{
				if(ele==null)
				{		
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_leftSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6" vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';
						
				}
				else
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_leftSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';	
				}
			}
			else
			{
				if(ele==null)
				{		
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="fn_largeRightView('+(i+1)+','+(i+1)+');" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6" vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';
						
				}
				else
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="fn_largeRightView('+(i+1)+','+(i+1)+');" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';	
				}
			}
		}
		else
		{
			var caption = a[id]['children'][offset]['caption'];		
			var ele = a[id]['children'][offset]['children'];
			
			if(viewFlag == "smallView")
			{
				if(ele==null)
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_leftSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';			
				}
				else
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_leftSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';	
				}
			}
			else
			{
				if(ele==null)
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="fn_largeRightView('+(i+1)+','+(i+1)+');" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';			
				}
				else
				{
					div_left_innerhtml += '<tr id='+(i+1)+' class="'+cssWhiteClass+'" onClick="fn_largeRightView('+(i+1)+','+(i+1)+');" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="'+tdWidth+'"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';	
				}
			}
		}
	offset++;
	}
	div_left_innerhtml += '</table>';
	div_leftSliderContent.innerHTML = div_left_innerhtml;

	start = dividelength - cnt_treeEle + 1;
	
	//div_rightSliderContent.innerHTML += '<ol start="'+start+'" class="StyleLmLeftSlideText">';
	
	if(viewFlag == 'smallView')
	{
		var div_right_innerhtml="";
		
		div_right_innerhtml = '<table id="smallView_Right" cellpadding="0" cellspacing="3" border="0">';
		
		for(var i = dividelength; i < totallength ; i++){
			if (subId!=-1){
				var caption = a[id]['children'][parentElem]['children'][offset]['caption'];		
				var ele = a[id]['children'][parentElem]['children'][offset]['children'];
				if(ele==null){		
					div_right_innerhtml += '<tr id='+(i+1)+' class="StyleWhiteBackground" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_rightSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="281"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';
				}
				else{
					div_right_innerhtml += '<tr id='+(i+1)+' class="StyleWhiteBackground" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_rightSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="281"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';	
				}			
			}
			else{		
				var caption = a[id]['children'][offset]['caption'];		
				var ele = a[id]['children'][offset]['children'];
				if(ele==null){
					div_right_innerhtml += '<tr id='+(i+1)+' class="StyleWhiteBackground" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_rightSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="281"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a></td></tr></table></td></tr>';
				}
				else{
					div_right_innerhtml += '<tr id='+(i+1)+' class="StyleWhiteBackground" onClick="list_id = this.id;sliderInterval = setInterval(\'moveSlider(div_rightSliderArrow,1,'+(i+1)+')\',10);" onMouseOver="setGrayBack(this,\''+viewFlag+'\')" onMouseOut="setWhiteBack(this,\''+viewFlag+'\')" style="cursor:pointer;"><td width="281"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-left:10px;" valign="top"><img src="../../../images/orange_dot.gif" width="6" height="6"  vspace="7" /></td><td style="padding-left:10px;"><a href="#" class="StyleLmLeftSlideLink">'+caption+'</a> +</td></tr></table></td></tr>';
				}		
			}
			offset++;
		}
		div_right_innerhtml += '</table>';
		div_rightSliderContent.innerHTML = div_right_innerhtml;
	}
	
	div_leftSliderArrow=document.getElementById("div_leftSliderArrow");
	div_rightSliderArrow=document.getElementById("div_rightSliderArrow");
	
	var state=div_leftSliderArrow.getAttribute("isOpen");
	if(state==0){
		if (aniEffect==1){
			sliderInterval = setInterval('moveSlider(div_leftSliderArrow,0,'+id+')',10);
		}
		document.getElementById("div_bodyContent").style.display="none";
		//document.getElementById("div_expandScreen").style.display="none";
		document.getElementById("pageNameMain").value=0;
		document.getElementById("frmSmallContainer").src="";
	}
	/*if(viewFlag == "smallView" && id == 0)
	{
		list_id = 0;
		document.getElementById("div_SliderHeading").innerHTML = "top 10 searches";
	}*/
	if(viewFlag == "largeView" && id == 0)
	{
		document.getElementById("div_LargeViewHeading").innerHTML = "top 10 searches";
		document.getElementById("div_topTenSearch").style.display = "block";
		document.getElementById("div_navigatingb2").style.display = "block";
		fn_largeRightView(2,2); //To set the first content as selected by default when "top 10 searches" is clicked
	}
	else if(viewFlag == "largeView" && id == 1)
	{
		document.getElementById("div_LargeViewHeading").innerHTML = "learn more";
		document.getElementById("div_navigatingb2").style.display = "block";
		document.getElementById("div_topTenSearch").style.display = "block";
		fn_largeRightView(13,13); //To set the first content as selected by default when "navigating b2" is clicked
	}
	else if(viewFlag == "largeView" && id == 2)
	{
		document.getElementById("div_LargeViewHeading").innerHTML = "what is b2?";
		document.getElementById("div_navigatingb2").style.display = "block";
		document.getElementById("div_topTenSearch").style.display = "block";
		fn_largeRightView(30,30); //To set the first content as selected by default when "navigating b2" is clicked
	}

	if(viewFlag == "smallView" && id == 0)
	{
		list_id = 0;
		document.getElementById("div_SliderHeading").innerHTML = "top 10 searches";
		document.getElementById("div_topTenSearch").style.display = "block";
		document.getElementById("div_navigatingb2").style.display = "block";
	}
	else if(viewFlag == "smallView" && id == 1)
	{
		list_id = 0;
		document.getElementById("div_SliderHeading").innerHTML = "learn more";
		document.getElementById("div_navigatingb2").style.display = "block";
		document.getElementById("div_topTenSearch").style.display = "block";
	}	
}



function fn_smallView(s_pageId){
	
	if(list_id != 0)
	{
		var smallView_Left = document.getElementById('smallView_left').firstChild.childNodes;
		var smallView_Right = document.getElementById('smallView_Right').firstChild.childNodes;
		
		var selListId = document.getElementById(list_id);
				
		for(i=0;i<smallView_Left.length;i++)
		{
			smallView_Left[i].setAttribute('class','StyleWhiteBackground');
			smallView_Left[i].className = 'StyleWhiteBackground';
		}
		
		for(j=0;j<smallView_Right.length;j++)
		{
			smallView_Right[j].setAttribute('class','StyleWhiteBackground');
			smallView_Right[j].className = 'StyleWhiteBackground';
		}

		selListId.setAttribute('class','StyleGrayBackground');
		selListId.className = 'StyleGrayBackground';
	}
	
	var op_treeId = s_pageId;
	document.getElementById("frmSmallContainer").src="SmallView.html";
	document.getElementById("pageNameMain").value="../../Contents/"+arr_pages[s_pageId];
	document.getElementById("frmSmallContainer").src=document.getElementById("pageNameMain").value;
	document.getElementById("div_bodyContent").style.display="block";
	pageId = s_pageId;
	
	if (op_treeId > 1 && op_treeId < 12) op_treeId=0;
	else if (op_treeId > 12 && op_treeId < 29) op_treeId=1;
	else if (op_treeId > 29 && op_treeId < 32) op_treeId=1;
	else if (op_treeId > 32 && op_treeId < 43) op_treeId=2;
	else if (op_treeId > 43 && op_treeId < 48) op_treeId=3;
	else if (op_treeId > 48) op_treeId=4;
	document.getElementById("treeId").value= op_treeId;
	
	if (document.getElementById("pageNameMain").value!=0){
		document.getElementById("div_expandScreen").style.display="block";
	}
}

function fn_largeRightView(s_pageId,large_ListId)
{
	//alert(s_pageId +" " +large_ListId );
	list_id = large_ListId; /* Setting the global variable list_id to the value posted from the opener window */
	
	if(list_id != 0)
	{
		var largeView_Left = document.getElementById('largeView_left').firstChild.childNodes;
		
		var selListId = document.getElementById(list_id);
				
		for(i=0;i<largeView_Left.length;i++)
		{
			largeView_Left[i].setAttribute('class','StyleBigViewWhiteBackground');
			largeView_Left[i].className = 'StyleBigViewWhiteBackground';
		}
		
		selListId.setAttribute('class','StyleBigViewGrayBackground');
		selListId.className = 'StyleBigViewGrayBackground';
	}

	var op_treeId = s_pageId;
	document.getElementById("pageNameMain").value="../../Contents/"+arr_pages[s_pageId];
	document.getElementById("frmSmallContainer").src=document.getElementById("pageNameMain").value;
	document.getElementById("div_bodyContent").style.display="block";
	pageId = s_pageId;
	
	if (op_treeId > 1 && op_treeId < 12) op_treeId=0;
	else if (op_treeId > 12 && op_treeId < 29) op_treeId=1;
	else if (op_treeId > 29 && op_treeId < 31) op_treeId=2;
	else if (op_treeId > 32 && op_treeId < 43) op_treeId=3;
	else if (op_treeId > 43 && op_treeId < 48) op_treeId=4;
	else if (op_treeId > 48) op_treeId=5;
	document.getElementById("treeId").value= op_treeId;

	/*if (document.getElementById("pageNameMain").value!=0){
		document.getElementById("div_expandScreen").style.display="block";
	}*/
}

function fn_expand()
{
	//pageId=44;
	//document.getElementById("pageNameMain").value="../../Contents/"+arr_pages[pageId];
	//document.getElementById("treeId").value=3
	document.getElementById("large_ListId").value = list_id; /*Hidden Variable to post the list_id to expanded window when it opens*/
	document.getElementById("content_Id").value = contentId; /*Hidden Variable to post the contentId to expanded window* when it opens*/
	document.getElementById("page_Id").value = pageId; /*Hidden Variable to post the page_id to expanded window when it opens*/
	
	if (document.getElementById("pageNameMain").value!=0){
	NewWindow('../../lm_large_view/template/LargeView.html?listId','name','1024','768','yes');	
	}
}

function NewWindow(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		win.window.focus(); 
	}
}

function OpenWindow(url)
{

	opener.location.assign(url);
	opener.focus();
    self.close();
}	 	
