var BASEURL = '/';


function openWin(url, width, height){
	if(width == null){
		width = 600;
	}
	if(height == null){
		height = 400;
	}
	var newWindow = window.open(url, 'newWin', 'width='+width+',height='+height+',status=no,scrollbars=1');
	if(window.focus) newWindow.focus();
	return false;
}
function flashObject(id, swf, width, height){
	var so = new SWFObject(swf, 'flash_' + id, width, height, '8');
	so.addParam('quality', 'best');
	so.addParam('menu', 'false');
	so.addParam('allowScriptAccess', 'sameDomain');
	so.write(id);
}
function changeNavTab(section){
	var navString;
	var subNav = document.getElementById('subnav');
	/*
	// change to selected tab
	var parent = document.getElementById(section).parentNode;
	parent.className = 'current';
	*/
	switch(section){
		case 'Products':
			navString = '<ul><li><a href="' + BASEURL + 'products/overview.html">Overview</a></li><li><a href="' + BASEURL + 'products/datadvantage/index.html">DatAdvantage</a></li><li><a href="' + BASEURL + 'products/dataprivilege/index.html">DataPrivilege</a></li><li><a href="' + BASEURL + 'products/architecture/index.html">Architecture</a></li></ul>';
		break;
		case 'Solutions':
			navString = '<ul><li><a href="' + BASEURL + 'solutions/customer-success/index.html">Customer Success</a></li><li><a href="' + BASEURL + 'solutions/industries/index.html">Industries</a></li><li><a href="' + BASEURL + 'solutions/roi.html">ROI</a></li></ul>';
		break;
		case 'Partners':
			navString = '<ul><li><a href="' + BASEURL + 'partners/programs.html">Programs</a></li><li><a href="' + BASEURL + 'partners/become-a-partner.html">Become a Partner</a></li><li><a href="' + BASEURL + 'pages/login.html">Partner Login</a></li></ul>';
		break;
		case 'Support':
			navString = '<ul><li><a href="' + BASEURL + 'support/overview.html">Overview</a></li><li><a href="' + BASEURL + 'support/programs.html">Programs</a></li><li><a href="' + BASEURL + 'support/resources.html">Resources</a></li></ul>';
		break;
		case 'News':
			navString = '<ul><li><a href="' + BASEURL + 'news/industry-buzz/index.html">Industry Buzz</a></li><li><a href="' + BASEURL + 'news/press-releases/index.html">Press Releases</a></li><li><a href="' + BASEURL + 'news/awards/index.html">Awards</a></li><li><a href="' + BASEURL + 'news/events/index.html">Events</a></li></ul>';
		break;
		case 'Company':
			navString = '<ul><li><a href="' + BASEURL + 'company/overview.html">Overview</a></li><li><a href="' + BASEURL + 'Company/management.html">The Management Team</a></li><li><a href="' + BASEURL + 'company/investors.html">Investors</a></li><li><a href="' + BASEURL + 'company/board-of-directors.html">Board of Directors</a></li><li><a href="' + BASEURL + 'company/contact.html">Contact</a></li></ul>';
		break;
	}
	navString += '<div class="clear"></div>';
	subNav.innerHTML = navString;
}



function drawWelcome()
{
  var Str = '<SPAN class="HelpTextG">welcome';
  
  if ( CookieValid && UserCookie[CookieUser_Id] != '1' )    
  {
    Str += ' <b>' + UserCookie[CookieName];
    Str += '</b>, </SPAN> <A class="HelpTextG" href="/services/web/Update_Users.Logout?Action=/index.html" class="HelpText">sign out</A>&nbsp;' +
           '<SPAN CLASS="HelpTextG">|</SPAN>&nbsp;<A class="HelpTextG" href="/pages/account/edit.html" class="HelpText">my account</A>&nbsp;';
  }
  else
    Str += ',</SPAN> <A class="HelpTextG" href="/pages/account/login.html?Action=edit.html" class="HelpText">sign in</A>&nbsp;';
  
//  Str += '<SPAN CLASS="HelpTextG">|</SPAN>&nbsp;<a class="HelpTextG" href="javascript:getHelp()" class="HelpText" onmouseover="window.status=\'Get Help for this Screen\'" onmouseout="window.status=\'\'" >help</A>&nbsp';

//  if ( CookieValid && UserCookie[CookieGroup_Id] != '1' )    
//  {
//    var URL = document.location.pathname;
//    if ( document.location.search ) URL += document.location.search;
//    URL = escape( URL.replace( /\/pages/, '' ) );
//    Str += '|&nbsp;<a class="HelpTextG" href="javascript:helpPopup(\'/pages/help/support.html?p_Type=Feedback&p_Title=Online%20Support&p_URL='+URL+'\');" class="HelpText" onmouseover="window.status=\'Get Online Support\'" onmouseout="window.status=\'\'">support</A>&nbsp';
//  }
  if ( CookieValid && UserCookie[CookieGroup_Id] == '0' && ( UserCookie[CookieEmail].indexOf( '@'+'marketbright.com' ) > -1 ) )
  {
    var thisPageDebug = window.location.href;
    if ( thisPageDebug.indexOf( 'Debug=Y' ) > -1 ) thisPageDebug = thisPageDebug.replace( /Debug\=Y/, 'Debug=N' );
    else if ( thisPageDebug.indexOf( '?' ) > -1 ) thisPageDebug += '&Debug=Y';
    else thisPageDebug += '?Debug=Y';
    Str += '|&nbsp;<A class="HelpTextG" href="'+thisPageDebug+'" class="HelpText">debug</A>&nbsp;';

//    var thisPageEdit = window.location.href;
//    if ( thisPageEdit.indexOf( 'Edit=Y' ) > -1 ) thisPageEdit = thisPageEdit.replace( /Edit\=Y/, 'Edit=N' );
//    else if ( thisPageEdit.indexOf( '?' ) > -1 ) thisPageEdit += '&Edit=Y'; 
//    else thisPageEdit += '?Edit=Y';
//    Str += '|<A class="HelpTextG" href="'+thisPageEdit+'" class="HelpText">edit</A>';
  }
  document.write( Str );
  document.close();
}
