function tab(val, name, num){
	var b = name;
	var a = val;
	for (var i=1;i<num;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve2.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOn";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOff";
		}
	}
}

function tab2(val, name, num){
	var b = name;
	var a = val;
	for (var i=1;i<num;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_curve1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_curve2.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOn";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOff";
		}
	}
}

function tab4(val){
	var a = val;
	for (var i=1;i<4;i++){
		if(i==a){
			document.getElementById('tab4_'+i).style.display="block";
		}
		else{
			document.getElementById('tab4_'+i).style.display="none";
		}
	}
}

function news_tab4(val){
	var a = val;
	for (var i=1;i<4;i++){
		if(i==a){
			document.getElementById('tab4_'+i).style.display="block";
		}
		else{
			document.getElementById('tab4_'+i).style.display="none";
		}
	}
}

function tab_ipo(val, name, num){
	var b = name;
	var a = val;
	if(document.getElementById('issue_F_'+a).className == 'blueB_12')
	{
		document.getElementById(b+'_'+a).style.display="none";
		document.getElementById(b+'_B_'+a).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/ipo_plus.gif')";
		document.getElementById(b+'_F_'+a).className="blue_12";
	}
	else
	{
		for (var i=1;i<num;i++){
			if(i==a){
				document.getElementById(b+'_'+i).style.display="block";
				document.getElementById(b+'_B_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/ipo_minus.gif')";
				document.getElementById(b+'_F_'+i).className="blueB_12";
			}
			else{
				document.getElementById(b+'_'+i).style.display="none";
				document.getElementById(b+'_B_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/ipo_plus.gif')";
				document.getElementById(b+'_F_'+i).className="blue_12";
			}
		}
	}
}

function tab_tech(val, name, num){
	var b = name;
	var a = val;
	for (var i=1;i<num;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3H_curve1.gif')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3H_curve2.gif')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3H_bg.gif')";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3_bg.gif')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3_bg.gif')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab3_bg.gif')";
		}
	}
}

function tab_new(val, name, num){
	var b = name;
	var a = val;
	for (var i=1;i<num;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_curve2_1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_curve1_2.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2H_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOn";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg_1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab2_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOff";
		}
	}
}

function tab_ind(val, name, num){
	var b = name;
	var a = val;
	for (var i=1;i<8;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve2.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOn";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOff";
		}
	}
	
	for (var i=i;i<num;i++){
		if(i==a){
			document.getElementById(b+'_'+i).style.display="block";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve1_1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_curve2_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tabH_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOn";
		}
		else{
			document.getElementById(b+'_'+i).style.display="none";
			document.getElementById(b+'_ImgL_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg_1.jpg')";
			document.getElementById(b+'_ImgR_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).style.backgroundImage="url('http://img1.moneycontrol.com/images/mc_common/tab_bg_1.jpg')";
			document.getElementById(b+'_ImgH_'+i).className="tabOff";
		}
	}
}

