function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + 
		id + 
		" = window.open(URL, '" + 
		id + 
		"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=450,left = 312,top = 150');");
}

function safemail(name, domain, display, link, sub) {
	subject=(typeof(sub)=="undefined") ? '' : sub;
	link_type=(typeof(link)=="undefined") ? 'inpage' : link;
	displayed=(typeof(display)=="undefined") ? name+"@"+domain : display;
	document.write('<a class=' + link_type + ' href=mailto:' + 
		       	name + 
		       	'&#064;' + 
			domain +
			'?subject=' +
			subject +
			'>' + 
			displayed + 
			'</a>');
}

function rsvp_register(ev, ev_name) {
	e = (typeof(ev)=="undefined") ? 'UNKNOWN' : ev;
	ename = (typeof(ev_name)=="undefined") ? 'click here' : ev_name;
	amplify_url = "http://www.amplifyllc.com/in-tel/";
	imgsrc = "../sponsors/RegisterNowwithAmpSmall.gif";
	eurl = "UNKNOWN";
	if (e == 'kickoff') {
		eurl = "Regform.cfm?D=kMcx-4z0xb9D&SC=CcBgeKne";
	}
	if (e == 'finance-marketing') {
		eurl = "ListOfEvents.cfm?ID=GSM&event=HzKK";
	}
	if (e == 'e-grill') {
		eurl = "Regform.cfm?D=NVc5G55bhn9L&SC=CcCdeKne";
	}
	if (e == 'ip-workshop') {
		eurl = "Regform.cfm?D=O90g5Rfim3gJ&SC=CcCJeKne";
	}
	if (e == 'register') {
		eurl = "Regform.cfm?D=Td0h5rYimJCA&SC=CcCgeKne";
	}
	if (e == 'finale') {
		eurl = "Regform.cfm?D=Vkh08ofVmkUJ&SC=CcSjeKne";
	}
	if (eurl != "UNKNOWN") {
		document.write(
			'<a ' +
			'href="' +
			amplify_url +
			eurl + 
			'" target=new> ' +
			ename +
			'</a>');
	}
	else {
		document.write('barfu');
	}
}

function rsvp_register_amplify(ev, ev_name) {
	e = (typeof(ev)=="undefined") ? 'UNKNOWN' : ev;
	ename = (typeof(ev_name)=="undefined") ? 'click here' : ev_name;
	amplify_url = "http://www.amplifyllc.com/in-tel/";
	imgsrc = "../sponsors/RegisterNowwithAmpSmall.gif";
	eurl = "UNKNOWN";
	if (e == 'kickoff') {
		eurl = "Regform.cfm?D=kMcx-4z0xb9D&SC=CcBgeKne";
	}

	if (eurl != "UNKNOWN") {
		document.write(
			ename +
			'<a ' +
			'href="' +
			amplify_url +
			eurl + 
			'" target=new> ' +
			'<img src="' +
			imgsrc +
			'" alt="' +
			ename +
			'">' +
			'</a>');
	}
	else {
		document.write('barfu');
	}
}


function rsvp_email(ev) {
	event=(typeof(ev)=="undefined") ? '' : ev;
	subject = 'RSVP:%20' + event;
	safemail("bigbang",
		"ucdavis.edu",
		void 0, void 0,
		subject);
}

function alerts_email() {
	safemail("bigbang",
		"ucdavis.edu",
		void 0, void 0,
		"ALERTS");
}

function info_email() {
	safemail("bigbang",
		"ucdavis.edu",
		void 0, void 0,
		"INFO");
}

function webmaster_email(link_type) {
	safemail("bigbang",
		"ucdavis.edu", 
		void 0, link_type,
		"WEBMASTER");
}

function submital_email(link_type) {
	safemail("bigbang",
		"ucdavis.edu",
		void 0, link_type,
		"SUBMITAL");
}

function individual_email(link_type) {
	safemail("bigbang",
		"ucdavis.edu",
		void 0, link_type,
		"INDIVIDUALS");
}

function teams_email(link_type) {
	safemail("bigbang",
		"ucdavis.edu",
		void 0, link_type,
		"TEAMS");
}

function arc_location() {
	document.write('<a ' +
			'href="http://www.cevs.ucdavis.edu/map/map_detail.cfm?assetInfo=12 "' +
			'target=new>UC Davis - Activities and Recreation Center' +
			'</a>');
}

function aob4_174_location() {
	document.write('<a ' +
			'href="http://www.cevs.ucdavis.edu/map/map_detail.cfm?centerTile=13_6&assetInfo=11"' +
			'target=new>AOB IV (GSM Building)' +
			'</a>' +
			' Room 174');
}

function visitor_center_location() {
	document.write('<a ' +
			'href="http://www.cevs.ucdavis.edu/map/map_detail.cfm?centerTile=13_10&assetInfo=25"' +
			'target=new>Buehler Visitors and Alumni Center' +
			'</a>' +
			' AGR Room');
}

function header_table(home) {
	document.write('<table class="headertable" border="0" width="800" cellpadding=0>\n' +
		'<tr width="800">\n' +
		'<td width="50%">\n' +
		'<A><IMG alt="Big Bang! UC Davis Business Plan Competition" src ="'+home+'/images/BBLogo2.gif" border=0 width="260" height="71" ></A>\n' +
		'</td>\n' +
		'<td width="50%" align="right" valign="top">\n' +
		'<span class="utilities">\n' +
		'<A href="'+home+'/default.html"> Home </A> |\n' +
		'<A href="'+home+'/news/news.html"> News </A> |\n' +
		'<A href="'+home+'/faq/faq.html"> FAQ </A> |\n' +
		'<A href="'+home+'/sitemap/sitemap.html">Site Map </A> |\n' +
		'<A href="'+home+'/contact/contact.html">Contact us</A>\n' +
		'&nbsp;&nbsp;</span>\n' +
  		'<br><br>\n' +
  		'<A href="http://www.gsm.ucdavis.edu" target="GSM"><IMG alt="UC Davis Graduate School of Management" src ="'+home+'/images/GSMlogo.gif" border=0 width="102" height="40"></A>&nbsp;&nbsp;&nbsp;</td>' +
		'</tr>\n' +
		'</table>\n'
	);
}

function bottom_table(home) {
	document.write('<table class="bottomtable" width="800">\n' +
			'<tr>\n ' +
    			'<td width="100%" align="middle">\n' +
    			'<span class="copyright">\n' +
			'<a class="bottomlink" href="' + home + '/default.html">Home</a> |\n' +
			'<A class=bottomlink href="'+home+'/about/about.html">About</A> |\n' +
			'<A class=bottomlink href="'+home+'/calendar/calendar.html">Calendar</A> |\n'+
			'<A class=bottomlink href="'+home+'/participate/participate.html">Participate</A> |\n' +
      			'<A class=bottomlink href="'+home+'/sponsors/sponsors.html">Sponsors</A> |\n' +
			'<A class=bottomlink href="'+home+'/news/news.html"> News </A> |\n' +
			'<A class=bottomlink href="'+home+'/faq/faq.html"> FAQ </A> |\n' +
			'<A class=bottomlink href="'+home+'/sitemap/sitemap.html">Site Map</A> |\n' +
			'<A class=bottomlink href="'+home+'/contact/contact.html">Contact Us</A>\n' +
			'<br><br>\n' +
			'&copy Copyright 2002-2007 Big Bang! UC Davis Business Plan Competition.<br>' +
			'All rights reserved. Webmaster: ');
	webmaster_email("bottomlink");
	document.write('\n' +
			'</span>\n' +
    			'</td>\n' +
  			'</tr>\n' +
			'</table>\n');
}

function flash_header(home) {
	document.write('<table border="0" width="800" valign="top" cellpadding=0 cellspacing=0>\n' +
		'<tr>\n' +
    		'<td width="800" bgcolor="#6666cc">\n' +
		'<OBJECT id=BBMenuSimple ' +
			'codeBase=http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0 ' +
			'height=30 ' +
			'width=800 ' +
			'classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>' +
			'<PARAM NAME="_cx" VALUE="21167">' +
			'<PARAM NAME="_cy" VALUE="794">' +
			'<PARAM NAME="Movie" VALUE="'+home+'/flash/BBMenuSimple.swf">' +
			'<PARAM NAME="Src" VALUE="'+home+'/flash/BBMenuSimple.swf">' +
			'<PARAM NAME="WMode" VALUE="Window">' +
			'<PARAM NAME="Play" VALUE="-1">' +
			'<PARAM NAME="Loop" VALUE="-1">' +
			'<PARAM NAME="Quality" VALUE="High">' +
			'<PARAM NAME="SAlign" VALUE="">' +
			'<PARAM NAME="Menu" VALUE="-1">'+
			'<PARAM NAME="Base" VALUE="">' +
			'<PARAM NAME="Scale" VALUE="ShowAll">' +
			'<PARAM NAME="DeviceFont" VALUE="0">' +
			'<PARAM NAME="EmbedMovie" VALUE="0">' +
			'<PARAM NAME="BGColor" VALUE="FFFFFF">' +
			'<PARAM NAME="SWRemote" VALUE="">' +
			'<PARAM NAME="Stacking" VALUE="below">\n' +
		'<embed name="BBMenuSimple" ' +
			'src="'+home+'/flash/BBMenuSimple.swf" ' +
			'quality="high" ' +
			'bgcolor="#FFFFFF" ' +
			'width="800" height="30" ' +
			'type="application/x-shockwave-flash" '+
			'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">' +
		'</embed></OBJECT>\n' +
		'</td>\n' +
		'</tr>\n' +
		'</table>\n'
	);

}

function flash_header_HP(home) {
	document.write('<table border="0" width="800" valign="top" cellpadding=0 cellspacing=0>\n' +
		'<tr>\n' +
    		'<td width="800" bgcolor="#6666cc">\n' +
		'<OBJECT id=BBMenuSimpleHP ' +
			'codeBase=http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0 ' +
			'height=30 ' +
			'width=800 ' +
			'classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>' +
			'<PARAM NAME="_cx" VALUE="21167">' +
			'<PARAM NAME="_cy" VALUE="794">' +
			'<PARAM NAME="Movie" VALUE="'+home+'/flash/BBMenuSimpleHP.swf">' +
			'<PARAM NAME="Src" VALUE="'+home+'/flash/BBMenuSimpleHP.swf">' +
			'<PARAM NAME="WMode" VALUE="Window">' +
			'<PARAM NAME="Play" VALUE="-1">' +
			'<PARAM NAME="Loop" VALUE="-1">' +
			'<PARAM NAME="Quality" VALUE="High">' +
			'<PARAM NAME="SAlign" VALUE="">' +
			'<PARAM NAME="Menu" VALUE="-1">'+
			'<PARAM NAME="Base" VALUE="">' +
			'<PARAM NAME="Scale" VALUE="ShowAll">' +
			'<PARAM NAME="DeviceFont" VALUE="0">' +
			'<PARAM NAME="EmbedMovie" VALUE="0">' +
			'<PARAM NAME="BGColor" VALUE="FFFFFF">' +
			'<PARAM NAME="SWRemote" VALUE="">' +
			'<PARAM NAME="Stacking" VALUE="below">\n' +
		'<embed name="BBMenuSimple" ' +
			'src="'+home+'/flash/BBMenuSimpleHP.swf" ' +
			'quality="high" ' +
			'bgcolor="#FFFFFF" ' +
			'width="800" height="30" ' +
			'type="application/x-shockwave-flash" '+
			'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">' +
		'</embed></OBJECT>\n' +
		'</td>\n' +
		'</tr>\n' +
		'</table>\n'
	);

}

function alerts_table(home) {
	document.write('<table width="130" border=0 cellpadding="0" cellspacing="0" align="center"> ' +
			'<tr> '+
			'<td align="justified"> ' +
			'<font class="subscribe"> ' +
			'<br> ' +
			'<IMG src="'+home+'/images/EmailIcon.gif" ' +
				'align=left ' +
				'border=0 ' +
				'width="25" ' + 
				'height="21">' +
			'<br><b>ALERTS!</b><br>' +
			'Want to be notified about upcoming events and dealines?<br>' +
			'Email ');
	alerts_email();
	document.write(' to receive Big Bang Competition Alerts by e-mail.<br> ' +
			'We respect your privacy and never sell or rent our subscribers list.' +
			'</font> ' +
			'</td> ' +
			'</tr> ' +
		'</table>');
}

function generic_sidebar_table(home, name) {
	document.write('<td width="180" ' +
			'valign="top" ' +
			'align="left" ' +
			'class="sidebartable">' +
    	    	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
			'codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0" ' +
			'id="'+name+'" ' +
			'width="180" ' +
			'height="232"> ' +
			'<param name="movie" value="'+home+'/flash/'+name+'.swf"> ' +
			'<param name="quality" value="high"> ' +
			'<param name="bgcolor" value="#EEEEEE"> ' +
			'<embed name="'+name+'" ' +
			'src="'+home+'/flash/'+name+'.swf" ' +
			'quality="high" ' +
			'bgcolor="#EEEEEE" ' +
			'width="180" ' +
			'height="232" ' +
			'type="application/x-shockwave-flash" ' +
			'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> ' +
			'</embed></object> ' +
		'<br><br> ');
	alerts_table(home);
	document.write('</td>');
}

function utils_sidebar_table(home) {
	generic_sidebar_table(home, 'BBMenuUtilities');
}

function sponsors_sidebar_table(home) {
	generic_sidebar_table(home, 'BBMenuSponsors');
}

function about_sidebar_table(home) {
	generic_sidebar_table(home, 'BBMenuAbout');
}

function participate_sidebar_table(home) {
	generic_sidebar_table(home, 'BBMenuParticipate');
}

function calendar_sidebar_table(home) {
	generic_sidebar_table(home, 'BBMenuCalendar');
}

function fu_calendar_sidebar_table(home) {
	document.write('<td width="180" valign="top" align="left" class="sidebartable"> ' +
			'<IMG src="'+home+'/images/calendarimage.jpg" ' +
				'align="center" ' +
				'border="0" ' +
				'width="181" ' +
				'height="80"> ' +
			'<br><br><br><br><br><br><br><br><br><br><br>');
	alerts_table(home);
	document.write('</td>');
}

function right_sidebar(home) {
	document.write('<td class="sidebartable">&nbsp;</td>' +
			'<td valign="top" width="120" class="sidebartable">' +
			'<br><br>' +
			'<h3>Related Events:</h3>' +
			'<p>' +
			'<b>UCDavis CONNECT</b><br>' +
			'<a href="http://connect.ucdavis.edu/calevents.asp">more info</a></p>' +
			'<p>&nbsp;</p>' +
			'</td>'
	);
}
