function initPage()
{
	var navRoot = document.getElementById("log-block");
	if (navRoot) 
	{
		navRoot.onmouseover = function()
		{
			this.className = "hover";
                }
		navRoot.onmouseout = function()
		{
			this.className = "";
		}
	}
	var navRoot = document.getElementById("searchmenu");
	if (navRoot) 
	{
		navRoot.onmouseover = function()
		{
			this.className = "hover";
                }
		navRoot.onmouseout = function()
		{
			this.className = "";
		}
	}

}
//Search dropdown menu for domain selection starts here
/*  New Masthead function changeMenu(jsVal){
	var timeToKeep = 3600000*24*365; // one minute
	var expires = new Date();
	expires.setTime(expires.getTime() + timeToKeep);
	document.frmMenu.searchTarget.value=jsVal;
		if(jsVal==0){
			document.getElementById('domain').innerHTML = "&nbsp;Chat Rooms";
			set_cookie_domain("search_option","groups_hide",expires);
		}else if(jsVal==1){
			document.getElementById('domain').innerHTML = "&nbsp;Members";
			set_cookie_domain("search_option","profile_hide",expires);
		}else{
			document.getElementById('domain').innerHTML = "&nbsp;News & Support";
		}
	}  */
function setSearchTarget(){	
	var search_type = document.frmMenu.searchTarget.value;
	if(search_type==null || search_type==""){
		search_type=1;
	}

	var search_val = document.frmMenu.searchquery.value;
		if(isWhitespace(search_val) || search_val=="Enter search term(s)"){
			Highlight("searchquery");
			return;
			}else if(search_val!=null && search_val<3){
				alert("please enter minimum of 3 characters");
				return;
			}
	
	if ( search_type==0){
		document.groups_search.searchkey.value=search_val;
		document.groups_search.submit();

	}else if ( search_type==1){
		document.people_search.tag.value=search_val;
		document.people_search.submit();
		
	}else if ( search_type==2){
		document.support_search.q.value=search_val;
		document.support_search.submit();
	}
}
//Search dropdown menu for domain selection ends here


if (window.attachEvent && !window.opera)
	attachEvent("onload", initPage);


//hide and show start
function hideDiv() {

	var timeToKeep = 3600000*24*365; // one minute
	var expires = new Date();
	expires.setTime(expires.getTime() + timeToKeep);
	var opt_val="";
    	for(var i=0;i<document.homepagefrm.searchbtn.length;i++){
			if(document.homepagefrm.searchbtn[i].checked==true){
			opt_val = document.homepagefrm.searchbtn[i].value;
			}
		}
	if (document.getElementById) { // DOM3 = IE5, NS6
	//document.getElementById('option').style.visibility = 'hidden';
		//document.getElementById('option').style.display = 'none';
		document.getElementById('option_profile').style.display = 'none';
		document.getElementById('option_groups').style.display = 'none';
		document.getElementById('option_newsandsupport').style.display = 'none';
		document.getElementById('hide').style.display='none';
		document.getElementById('show').style.display='block';
		createCookie("Name","hide","1");
		if(opt_val=="P"){
			set_cookie_domain("search_option","profile_hide",expires);	
		}
		else if(opt_val=="CG"){
			set_cookie_domain("search_option","groups_hide",expires);
		}		
	}
	else {
		if (document.layers) { // Netscape 4
			if(opt_val=="P"){
				document.getElementById('option_profile').style.display = 'none';
				alert(document.getElementById('option_profile').style.display);
				set_cookie_domain("search_option","profile_hide",expires);
			}
			else if(opt_val=="CG"){
				document.getElementById('option_groups').style.display = '';
				set_cookie_domain("search_option","groups_hide",expires);
				}
			else{
				document.getElementById('option_newsandsupport').style.display = 'none';
			}
				createCookie("Name","hide","1");
			}
		else { // IE 4
			if(opt_val=="P"){
			document.getElementById('option_profile').style.display = 'none';
			set_cookie_domain("search_option","profile_hide",expires);
			//alert("2");
			}
			else if(opt_val=="CG"){
				document.getElementById('option_groups').style.display = '';
				set_cookie_domain("search_option","groups_hide",expires);
				}
			else{
			document.getElementById('option_newsandsupport').style.display = 'none';
			}
			createCookie("Name","hide","1");
			}
		}
	}

function showDiv() { 

var timeToKeep = 3600000*24*365; // one minute
var expires = new Date();
expires.setTime(expires.getTime() + timeToKeep);
		var opt_val="";
    	for(var i=0;i<document.homepagefrm.searchbtn.length;i++){
			if(document.homepagefrm.searchbtn[i].checked==true){
			opt_val = document.homepagefrm.searchbtn[i].value;
			//alert('menu'+opt_val);
			}
		}
		if (document.getElementById) { // DOM3 = IE5, NS6 
		//document.getElementById('option').style.visibility = 'visible'; 
			if(opt_val=="P"){
				document.getElementById('option_profile').style.display = '';
				set_cookie_domain("search_option","profile_show",expires);				
			}
			else if(opt_val=="CG"){
				document.getElementById('option_groups').style.display = '';				
				set_cookie_domain("search_option","groups_show",expires);
			}
			else{
				document.getElementById('option_newsandsupport').style.display = '';
			}
		document.getElementById('hide').style.display='block';
		document.getElementById('show').style.display='none';
		createCookie("Name","show","1");
		}
		else {
			if (document.layers) { // Netscape 4 
				if(opt_val=="P"){
				document.getElementById('option_profile').style.display = '';
				set_cookie_domain("search_option","profile_show",expires);
				}
				else if(opt_val=="CG"){
				document.getElementById('option_groups').style.display = '';
				set_cookie_domain("search_option","groups_show",expires);
				}
				else{
				document.getElementById('option_newsandsupport').style.display = '';
				}
			createCookie("Name","show","1");
			}
			else { // IE 4 
				if(opt_val=="P"){
				document.getElementById('option_profile').style.display = '';
				set_cookie_domain("search_option","profile_show",expires);
				}
				else if(opt_val=="CG"){
				document.getElementById('option_groups').style.display = '';
				set_cookie_domain("search_option","groups_show",expires);
				}
				else{
				document.getElementById('option_newsandsupport').style.display = '';
			}
				createCookie("Name","show","1");
			}
		}
	}
//hide and show end
