var curMenu="";
function setmenu( menu ) {
	var s="";

	if ( curMenu == menu ) {
		return;
	}
	switch( menu ) {

	  case "about":
	    s = "<a href='/about.htm' class='submenu'>Overview</a> &nbsp;|&nbsp; " +
	    	"<a href='/about_history.htm' class='submenu'>History</a> &nbsp;|&nbsp; " +
	    	"<a href='/about_team.htm' class='submenu'>Team</a> &nbsp;|&nbsp; " + 
	    	"<a href='/about_advisors.htm' class='submenu'>Advisors</a> &nbsp;|&nbsp; " + 
	    	"<a href='/about_partners.htm' class='submenu'>Partners</a>" + 
	    	"<img src='images/trans.gif' width=95 height=1>";
	  	break;

	  case "technology":
	    s = "<a href='/technology.htm' class='submenu'>Proprietary</a> &nbsp;|&nbsp; " +
	    	"<a href='/technology_opensource.htm' class='submenu'>Open Source</a> &nbsp;|&nbsp; " +
	    	"<a href='/technology_supportservices.htm' class='submenu'>Support Services</a> ";
	  	break;

	  case "news":
	    s = "<a href='/news.htm' class='submenu'>In the News</a> &nbsp;|&nbsp; " +
	    	"<a href='/news_pressresources.htm' class='submenu'>Press Resources</a>  &nbsp;|&nbsp; " +
	        "<a href='/news_blog.htm' class='submenu'>Blog</a> "
	  	break;

	  case "investments":
	    s = "<a href='investments.htm' class='submenu'>Portfolio</a> &nbsp;|&nbsp; " +
	    	"<a href='investments_philosophy.htm' class='submenu'>Philosophy</a> &nbsp;|&nbsp; " +
	    	"<a href='investments_criteria.htm' class='submenu'>Criteria</a> &nbsp;|&nbsp; " +
	    	"<a href='investments_entrepreneurs.htm' class='submenu'>Entrepreneurs</a> &nbsp;|&nbsp; " +
	    	"<a href='investments_investors.htm' class='submenu'>Investors</a> &nbsp;|&nbsp; " +
	    	"<a href='investments_thefund.htm' class='submenu'>The Fund</a>";
	  	break;

	  case "resources":
	    s = "<a href='resources.htm' class='submenu'>Links</a> &nbsp;|&nbsp; " +
	        "<a href='resources_testimonials.htm' class='submenu'>Testimonials</a> &nbsp;|&nbsp; " +
	    	"<a href='resources_jobs.htm' class='submenu'>Jobs</a> ";
	  	break;

	  case "contact":
	    s = "<a href='contact.htm' class='submenu'>Company</a> &nbsp;|&nbsp; " +
	    	"<a href='contact_submitbizplan.htm' class='submenu'>Submit a Business Plan</a>";
	  	break;

	}
	if ( ! strempty( curMenu  ) ) {
		domObject( "m_" + curMenu ).style.color = "#ffffff";
	}
	if ( ! strempty( menu ) ) {
		domObject( "m_" + menu ).style.color = "#eb8e90";
	}

	curMenu = menu;
	domInnerHTML_set( "submenu", s );
}

function ModalDialog( name, title, url ) {
	var w, left=0, top=0;
	w = theme_rad( name, url, 1, null );
	w.displayMode = DISP_CENTERED | DISP_NOPROGRESS;
	w.style |= WS_ALWAYSONTOP | WS_MODAL;
	w.issys = 1;
	w.header = title;
	w.setposition( left, top, 560, 400 );
	w.create( );
}

function MaxDialog( name, title, url ) {
	var w, left=0, top=0;
	w = theme_rad( name, url, 1, null );
	w.displayMode = DISP_CENTERED | DISP_NOPROGRESS;
	w.style |= WS_ALWAYSONTOP | WS_MAXIMIZED;
	w.style &= ~WS_NORMAL;
	w.issys = 1;
	w.header = title;
	w.setposition( left, top, 560, 400 );
	w.create( );
}

function theme_rad( name, content, IsExternal, opts ) {
	var w, UseButtons=1, trans=0;
	
	if ( opts ) {
		UseButtons = opts.UseButtons == null ? UseButtons : opts.UseButtons;
		trans = opts.trans == null ? trans : opts.trans;
	}

	w = new xWindow( name );
	w.theme = "Facebook";

	w.style = WS_NORMAL | WS_TRANSPARENT | WS_MAXIMIZABLE | WS_CLOSE | WS_MOVEABLE | WS_RESIZABLE | WS_HEADER | WS_FOOTER | WS_ALWAYSONTOP;
	if ( IsExternal ) { w.style |= WS_EXTERNAL; }

	w.transLevel = 100;
	w.hdrHeight = 32;
	w.funcHeader = function( w ) {
		var s = "<table border=0 cellspacing=0 cellpadding=0 height=32 class=smtxtw width='100%'><tr valign=bottom>" +
			"<td width=8 background='" + xWinThemesDir +"/fb_tl.png'></td>" +
			"<td style='padding:5;' background='images/rad_tc.png'><b>" + w.header + "</b></td>" +
			"<td align=right style='padding:5; text-align:right;' nowrap background='images/rad_tc.png'>";

		if ( w.style & WS_MINIMIZABLE ) {
			s += "<img src='" + xWinThemesDir +"/fb_min.png' width=18 height=14 border=0 style='cursor:pointer; position:relative; top:1;' onmouseover=\"domImageSet(this,'" + xWinThemesDir +"/fb_minOn.png');\" onmouseout=\"domImageSet(this,'" + xWinThemesDir +"/fb_min.png');\" ondragstart='return false;' onClick=\"xWin('" + w.name + "').minimize();\" title='Minimize'>";
		}
		if ( w.style & WS_MAXIMIZABLE ) {
			s += "<img src='" + xWinThemesDir +"/fb_max.png' width=18 height=14 border=0 style='cursor:pointer; position:relative; top:1;' onmouseover=\"domImageSet(this,'" + xWinThemesDir +"/fb_maxOn.png');\" onmouseout=\"domImageSet(this,'" + xWinThemesDir +"/fb_max.png');\" ondragstart='return false;' onClick=\"xWin('" + w.name + "').maximize();\" title='Maximize'>";
		}
		if ( w.style & WS_CLOSE ) {
			s += "<img src='" + xWinThemesDir +"/fb_close.png' width=18 height=14 border=0 style='cursor:pointer; position:relative; top:1;' onmouseover=\"domImageSet(this,'" + xWinThemesDir +"/fb_closeOn.png');\" onmouseout=\"domImageSet(this,'" + xWinThemesDir +"/fb_close.png');\" ondragstart='return false;' onClick=\"xWin('" + w.name + "').destroy();\" title='Close'>";
		}

		s += "<td width=8 background='" + xWinThemesDir +"/fb_tr.png'></td></tr></table>";
		return( s );
	};

	w.ftrHeight = 8;
	w.funcFooter = function( w ) {
		var s = "<table border=0 cellspacing=0 cellpadding=0 height=8 class=smtxtw width='100%'><tr height=8 class='xtiny'>" +
			"<td width=8 background='" + xWinThemesDir +"/vista_bl.png'></td>" +
			"<td background='" + xWinThemesDir +"/vista_bc.png'><img src='" + xWinImageDir + "/trans.gif'></td>" +
			"<td width=8 background='" + xWinThemesDir +"/vista_br.png'></td>" +
			"</tr></table>";
		return( s );
	};

	w.padding = 0;
	w.overflow = "hidden";	
	w.displayMode = DISP_NORMAL | DISP_NOPROGRESS;
	content = IsExternal ? w.actionRenderExternal( content, "xid=" + name ) : content;
	w.action = "<table border=0 cellspacing=0 cellpadding=0 class=txt width='100%' height='100%'>" + 
		"<tr valign=top>" +
		"<td nowrap width=8 background='" + xWinThemesDir +"/vista_lc.png'></td>" +
		"<td id='" + name + "_bTheme' " + ( trans ? "" : "bgColor='#FFFFFF' " ) + "style='padding:0; border:solid 0px #A0A0A0;' class=txtw>" + content + "</td>" +
		"<td nowrap width=8 background='" + xWinThemesDir +"/vista_rc.png'></td>" +
		"</tr>";
		
	if ( UseButtons ) {
		w.action += "<tr valign=center height=30>" +
		"<td nowrap width=8 background='" + xWinThemesDir +"/vista_lc.png'></td>" +
		"<td bgColor='#f2f2f2' style='text-align:right; padding:2; border:solid 1px #cccccc;' class=txtw>" + 
		"<input type=button class=inputbutton style='width:80;' value='Ok' onClick=\"xWin('" + name + "').iframeDocument( ).processSubmit( );\"> <input type=button class='inputbutton inputaux' value='Cancel' style='width:80;' onClick=\"xWin('" + w.name + "').destroy();\">" +
		"</td>" +
		"<td nowrap width=8 background='" + xWinThemesDir +"/vista_rc.png'></td>" +
		"</tr>";
	}

	w.action += "</table>";

	return( w );
}

var radwebtech = {

	// home page links
	FeaturedProject: function( ) {
		ModalDialog( 'featured', 'Featured Project', 'featured_Project.htm' );
	},
	LatestNews: function( ) {
		ModalDialog( 'news', 'Latest News', 'news_Latest.htm' );
	},
	UpcomingEvents: function( ) {
		ModalDialog( 'events', 'Upcoming Events', 'event_Upcoming.htm' );
	},
	DataPortability: function( ) {
		ModalDialog( 'dp', 'Data Portability', 'dataportability.htm' );
	},

	// submenu links
	design: function( ) {
		ModalDialog( 'design', 'Design', 'design.htm' );
	},
	development: function( ) {
		ModalDialog( 'dev', 'Development', 'development.htm' );
	},
	consulting: function( ) {
		ModalDialog( 'consult', 'Consulting', 'consulting.htm' );
	},
	speaking: function( ) {
		ModalDialog( 'speaking', 'Speaking', 'speaking.htm' );
	},

	helpcenter: function( ) {
		ModalDialog( 'helpcenter', 'Help Center', 'helpcenter.htm' );
	},
	members: function( ) {
		ModalDialog( 'members', 'Members', 'members.htm' );
	},
	
	pressInTheNews: function( ) {
		ModalDialog( 'pInTheNews', 'In The News', 'pressInTheNews.htm' );
	},
	pressReleases: function( ) {
		ModalDialog( 'pReleases', 'Press Releases', 'pressReleases.htm' );
	},
	pressRoom: function( ) {
		ModalDialog( 'pRoom', 'Press Room', 'pressRoom.htm' );
	},

	contactSales: function( ) {
		ModalDialog( 'cSales', 'Contact Sales', 'contactSales.htm' );
	},
	contactSupport: function( ) {
		ModalDialog( 'cSupport', 'Contact Support', 'contactSupport.htm' );
	},
	contactBizDev: function( ) {
		ModalDialog( 'cBizDev', 'Contact BizDev', 'contactBizDev.htm' );
	},
	contactInvestors: function( ) {
		ModalDialog( 'cInvestors', 'Contact Investors', 'contactInvestors.htm' );
	},
	contactCompany: function( ) {
		ModalDialog( 'cCompany', 'Contact Company', 'contactCompany.htm' );
	},

	aboutCompany: function( ) {
		ModalDialog( 'aCompany', 'About - Company', 'aboutCompany.htm' );
	},
	aboutManagement: function( ) {
		ModalDialog( 'aManagement', 'About - Management', 'aboutManagement.htm' );
	},
	aboutTechnology: function( ) {
		ModalDialog( 'aTechnology', 'About - Technology', 'aboutTechnology.htm' );
	},
	aboutJobs: function( ) {
		ModalDialog( 'aJobs', 'About - Jobs', 'aboutJobs.htm' );
	},

	imageShow: function( url ) {
		MaxDialog( "imgeviewer", "Image Viewer", url );
	}

}


xWinImageDir = 'http://www.xwinlib.com/libs/support';
xWinThemesDir = 'http://www.xwinlib.com/libs/themes';
xWinHdrBgColor = xWinFtrBgColor = '#b70004';
xlib.init( XINIT_ALL);

