/* --- Made by Frederico Figueiredo --- */
//function redraw() {location.reload();}
//onresize = redraw

date = new Date();
data=date.getDate()+'/0'+(date.getMonth()+1)+'/'+date.getYear();

/*Menu Definition*/
menu = new Array();
items = 0;
menu[items++] = new Array("Home", "Default.aspx", "");menu[items++] = new Array("News", "AllNews.aspx", "");menu[items++] = new Array("Login", "login.aspx", "");menu[items++] = new Array("Register", "Regist.aspx", "");menu[items++] = new Array("Mailing List", "MaillingList.aspx", "");menu[items++] = new Array("Module", "authors/SubmitModule.aspx", "Review", "reviewers/Default.aspx", "Submit");menu[items++] = new Array("Areas", "FocusAreasList.aspx", "Modules", "ListModules.aspx", "Authors", "ListAuthors.aspx", "Browse");//menu[items++] = new Array("Modules", "ListModules.aspx", "Authors", "ListAuthors.aspx", "Materials");
menu[items] = new Array("Search", "Search.aspx", "");
subMenu = new Array();
sub = 0;

function WriteMenuJS(local) {
	/*Escreve as opções do menu*/
	for (var i=0; i<=items; i++)
	{
		if(menu[i][2] == "") {
			if(menu[i][1] != "")
				document.write('<a class="indice" href="'+local+menu[i][1]+'">'+menu[i][0]+'</a><br /><br />');
			else
				document.write('<a class="indice">'+menu[i][0]+'</a><br /><br />');
		}
		else {
			size = (menu[i].length - 1);
			document.write(menu[i][size]+'<table>');
			for (var e=0; e<size; e+=2) {
				document.write('<tr><td>&nbsp;<img src="images/arrow2.gif" alt="Arrow" />&nbsp;<a class="indice" href="'+local+menu[i][e+1]+'">'+menu[i][e]+'</a></td></tr>');
			}
			document.write('</table><br />');			
		}	
	}
}

function WriteHeader(section, local, help) {
	document.write('<table summary="This is a layout table. THe first cell contains the header, the second contains navigation and the third contains the body of the document." height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" align="center">');
	document.write('<tr><td colspan="2" width="100%" height="0%" class="header"><!--Header//-->');
	document.write('<table width="100%" cellpadding="6" cellspacing="0" border="0" summary="This is a layout table. The first cell contains the heading, the second contains the ACM SIGGRAPH linked logo and the Eurographics linked logo. The third row contains a navigational breadcrumb trail, reflecting the site hiearchy."><tr>');
	document.write('<td width="130"><a href="/"><img src="'+local+'images/cgems.gif" valign="top" border="0" align="left" alt="Computer Graphics Educational Materials Source"></a></td><td class="cgems" width="*" align="left">CG&nbsp;Educational&nbsp;Materials&nbsp;Source<br /><br /></td>');
	document.write('<td width="160"><a href="http://www.siggraph.org" target="sg"><img src="'+local+'images/siglogo.gif" valign="top" border="0" align="right" alt="ACM SIGGRAPH"></a><a href="http://www.eg.org" target="eg"><img src="'+local+'images/eg.gif" align="right" valign="top" border="0" alt="EuroGraphics"></a></td></tr>');
	if (help != null)
		document.write('<tr><td class="bc" colspan="2"><font class="section">'+section+'</font></td><td class="help"><font class="help"><a href="'+help+'">Help</a></font></td></tr></table></td></tr>');
	else
		document.write('<tr><td class="bc" colspan="3"><font class="section">'+section+'</font></td></tr></table></td></tr>');

	/* Com Pesquisa (always there)
	document.write('<table summary="This is a layout table. THe first cell contains the header, the second contains navigation and the third contains the body of the document." height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" align="center">');
	document.write('<tr><td colspan="2" width="100%" height="0%" class="header"><!--Header//-->');
	document.write('<table width="100%" cellpadding="6" cellspacing="0" border="1" summary="This is a layout table. The first cell contains the heading, the second contains the ACM SIGGRAPH linked logo and the Eurographics linked logo. The third row contains a navigational breadcrumb trail, reflecting the site hiearchy."><tr>');
	document.write('<td width="130"><a href="/"><img src="'+local+'images/cgems.gif" valign="top" border="0" align="left" alt="Computer Graphics Educational Materials Source"></a></td><td class="cgems" width="*" align="left">CG&nbsp;Educational&nbsp;Materials&nbsp;Source<br /><br /></td>');
	document.write('<td>');
	document.write('<table class="FormsCGEMS" cellSpacing="0" cellPadding="2" width="200" border="0">');	document.write('<tr>');	document.write('<td><input id="searchTerm" type="text"></td>');	document.write('<td align="left"><input id="searchButton" type="submit" value="Search" runat="server"></td>');	document.write('</tr>');	document.write('<tr>');	document.write('<td class="fFields" colspan="3"><a href="AdvSearch.aspx">Click here for Advance Search</a></td>');		document.write('</tr>');	document.write('</table>');
	document.write('</td>');
	document.write('<td width="160" align="right" colspan="2"><a href="http://www.siggraph.org" target="sg"><img src="'+local+'images/siglogo.gif" valign="top" border="0" align="right" alt="ACM SIGGRAPH"></a><a href="http://www.eg.org" target="eg"><img src="'+local+'images/eg.gif" align="right" valign="top" border="0" alt="EuroGraphics"></a></td></tr>');
	if (help != null)
		document.write('<tr><td class="bc" colspan="3"><font class="section">'+section+'</font></td><td class="help"><font class="help"><a href="'+help+'">Help</a></font></td></tr></table></td></tr>');
	else
		document.write('<tr><td class="bc" colspan="4"><font class="section">'+section+'</font></td></tr></table></td></tr>');
		*/
		
	//For Navegation
	document.write('<!--Principal//--><tr><!--Indice//--><td class="indice" ');
	document.write('width="100" height="90%">');
}

function WriteNavegation(local) {
	
	/*Rounded Corner*/
	//document.write('<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="100%"><tr><td width="100%" colspan="2" align="right" height="27"><img border="0" src="images/corner.gif" width="26"  alt="Corner" height="43"></td></tr><tr><td><table border="0" cellpadding="6" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><tr><td width="100%">');
	WriteMenuJS(local);
	/*Rounded Corner*/
	//document.write('</td></tr></table></td><td bgcolor="#FFFFFF" align="right"><img border="0" src="images/block.gif" width="26" height="43"  alt="Block" ></td></tr></table>');
	//bad way of defining a witdh
}

function WriteMain(pageS) {
	//From the Navegation
	document.write('<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;')
	document.write('</td>');
	//Main
	document.write('<!--Site Stuff//--><td class="txt" width="91%">');
	if(pageS != null)
		document.write('<h1>'+pageS+'</h1>');
	return;
}


function WriteFooter(url, text) {
	if (url!=null && text!=null)
	{
		if(url!="")
			document.write('<br /><br /><a href="'+url+'"><< '+text+'</a><br /><br />');
		else
			document.write('<br /><br /><a href="JavaScript:history.back(-1)"><< '+text+'</a><br /><br />');
	}
	document.write('</td></tr><!--Page Footer//--><tr><td colspan="2" class="footer" width="100%" height="0%">');
	WriteFooterJS();
	document.write('</td></tr></table>');
}

/*Writes the site maintainer email*/
function WriteFooterJS() {
	document.write('<a href="AboutTeam.htm">About the Team</a> | <a href="project/default.htm">The CGEMS Project</a> | <a href="Feedback.aspx">Contact Us</a>');
	//document.write('<a href="AboutTeam.htm">About the Team</a> | <a href="http://cgems.inesc.pt/project">The CGEMS Project</a> | <a href="Feedback.aspx">Contact Us</a>');
}

function WriteSeparator() {
	document.write('<table class="separator" width="100%" height="20"><tr><td></td></tr></table>');
}


