﻿function toggle(obj) {
	var subnav = document.getElementById("subnav");
	var main = document.getElementById("main");
	if(obj) {
		var l = obj.parentNode;
	} else {
		l = document.getElementById("subwhy");
		var subnav = document.getElementById("subnav");
		var a = subnav.getElementsByTagName("a");
		for(i=0; i<a.length; i++) {
			a[i].href = "javascript:void(0);";
			a[i].onclick = function() {
				toggle(this);
			}
		}
	}
 li = subnav.getElementsByTagName("li");
 div = main.getElementsByTagName("div");
	for(i=0; i<li.length; i++) {
		li[i].className="inactive"
		}
	for(i=0; i<div.length; i++) {
		if(div[i].id=="why" || div[i].id=="webinars" || div[i].id=="events" || div[i].id=="blog" || div[i].id=="news" || div[i].id=="forum" || div[i].id=="devnet" || div[i].id=="customerforums") {
		div[i].className="inactive";
		div[i].style.display = 'none';
		}
		}
   if(l.id=="subwhy"){l.className="active";document.getElementById("why").className="active";document.getElementById("why").style.display = 'block'}
   if(l.id=="subweb"){l.className="active";document.getElementById("webinars").className="active";document.getElementById("webinars").style.display = 'block'}
   if(l.id=="subevs"){l.className="active";document.getElementById("events").className="active";document.getElementById("events").style.display = 'block'}
   if(l.id=="subblog"){l.className="active";document.getElementById("blog").className="active";document.getElementById("blog").style.display = 'block'}
   if(l.id=="subnews"){l.className="active";document.getElementById("news").className="active";document.getElementById("news").style.display = 'block'}
   if(l.id=="subdev"){l.className="active";document.getElementById("devnet").className="active";document.getElementById("devnet").style.display = 'block'}  
   if(l.id=="subforums"){l.className="active";document.getElementById("customerforums").className="active";document.getElementById("customerforums").style.display = 'block'}
   if(l.id=="subsupport"){l.className="active";document.getElementById("forum").className="active";document.getElementById("forum").style.display = 'block'}
}

function toggleTab(obj) {
	if(obj) {
		var l = obj.parentNode;
	} else {
		l = document.getElementById("secovr");
		var sectionselect = document.getElementById("sectionselect");
		var a = sectionselect.getElementsByTagName("a");
		for(i=0; i<a.length; i++) {
			a[i].href = "javascript:void(0);";
			a[i].onclick = function() {
				toggleTab(this);
			}
		}
	}
	var sections = document.getElementById("sections");
 
	li = sections.getElementsByTagName("li");
	div = sections.getElementsByTagName("div");
	for(i=0; i<li.length; i++) {
		li[i].className="inactive"
		}
	for(i=0; i<div.length; i++) {
		if(div[i].id=="overview" || div[i].id=="benefits" || div[i].id=="alerting" || div[i].id=="roi") {
		div[i].className="section";
		div[i].style.display = 'none';
		}
		}
	if(l.id=="secovr"){l.className="active";document.getElementById("overview").className="section active";document.getElementById("overview").style.display = 'block'}  
   if(l.id=="secben"){l.className="active";document.getElementById("benefits").className="section active";document.getElementById("benefits").style.display = 'block'}  
   if(l.id=="secalt"){l.className="active";document.getElementById("alerting").className="section active";document.getElementById("alerting").style.display = 'block'}  
   if(l.id=="secroi"){l.className="active";document.getElementById("roi").className="section active";document.getElementById("roi").style.display = 'block'} 
}