var sections = [];
sections.push({code:"company", name:"Company", landing:"_profile"});
sections.push({code:"solutions", name:"Solutions", landing:""});
sections.push({code:"customers", name:"Customers", landing:"_clientprofile"});
sections.push({code:"partners", name:"Partners", landing:"_ourpartners"});
sections.push({code:"newsevents", name:"News &amp; Events", landing:"_pressreleases"});
sections.push({code:"contactus", name:"Contact Us", landing:"_address"});

sitepath = "";
url = document.location.toString().split("/");
filename = url[url.length-1].split(".");
mainpic = header = filename[0];
if ((section == "company") || (section == "customers") || (section == "contactus")) {
	mainpic = section;
}
if (section == "search") {
	sitepath = "http://www.nexwave.com.sg/";
	mainpic = header = section;
}
sitepath = "http://www.nexwave.com.sg/";

if (filename[0].indexOf("customers_casestudies") != -1) {
	header = "customers_casestudies";
} else if (filename[0].indexOf("newsevents_pressreleases") != -1) {
	mainpic = header = "newsevents_pressreleases";
}

document.writeln("<link rel='stylesheet' type='text/css' href='" + sitepath + "style_nexwave.css'>");

function generate_header() {
	document.writeln("<a name='top'></a>");
	document.writeln("<table border='0' width='750' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td width='200'><img src='" + sitepath + "images/nexwave_logo.jpg' width='185' height='40' /></td>");
	document.writeln("<td width='550' valign='top' class='topnav_bkgd'>");
	
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td width='50' class='topnav_text'><a href='http://www.nexwave.com.sg/index.html' class='topnav_link'>Home</a></td>");
	document.writeln("<td width='275' class='topnav_text'><a href='http://www.nexwave.com.sg/sitemap.html' class='topnav_link'>Site Map</a></td>");
	document.writeln("<td width='225' valign='middle'>");
	document.writeln("<form name='search_form' method='get' action='http://www.sitelevel.com//query.go' target='_self'>");
	document.writeln("<input type='hidden' name='crid' value='09122ba601f28322'>");
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'><tr>");
	document.writeln("<td valign='top'><input type='text' name='query' value='Search' class='search_field'></td>");
	document.writeln("<td valign='top'><input name='B1' type='image' src='" + sitepath + "images/search_arrow.gif' width='16' height='16' hspace='5' vspace='5' />");
	document.writeln("</tr></table>");
	document.writeln("</form>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	
	document.writeln("<table border='0' cellspacing='0' cellpadding='15'>");
	document.writeln("<tr>");
	for (temp=0; temp<sections.length; temp++) {
		if (section == sections[temp].code) {
			document.writeln("<td><a href='javascript:click_mainnav(\"" + sections[temp].code + sections[temp].landing + "\")'><img src='" + sitepath + "images/topnav_" + sections[temp].code + "_on.gif' height='12' name='image_topnav_" + sections[temp].code + "' border='0' /></a></td>");
		} else {
			document.writeln("<td><a href='javascript:click_mainnav(\"" + sections[temp].code + sections[temp].landing + "\")' onMouseOver='rollon_image(\"topnav_" + sections[temp].code + "\"); return true' onMouseOut='rolloff_image(\"topnav_" + sections[temp].code + "\"); return true'><img src='" + sitepath + "images/topnav_" + sections[temp].code + "_off.gif' height='12' name='image_topnav_" + sections[temp].code + "' border='0' /></a></td>");
		}
	}
	document.writeln("</tr>");
	document.writeln("</table>");
	
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
}

function generate_footer() {
	if (section != "home") {
		document.writeln("<table border='0' width='770' cellspacing='0' cellpadding='0'>");
		document.writeln("<tr><td bgcolor='#CCCCCC'><img src='" + sitepath + "images/pixel.gif' width='1' height='1' /></td></tr>");
		document.writeln("</table>");
	}
	document.writeln("<div id='bottomnav'>");
	for (temp=0; temp<sections.length; temp++) {
		if (temp > 0) {
			document.writeln("&nbsp; | &nbsp;");
		}
		if (section == sections[temp].code) {
			linkstyle = "bottomnav_selected";
		} else {
			linkstyle = "bottomnav_link";
		}
		document.writeln("<a href='javascript:click_mainnav(\"" + sections[temp].code + sections[temp].landing + "\")' class='" + linkstyle + "'>" + sections[temp].name + "</a>");
	}
	document.writeln("</div>");
	
	document.writeln("<div id='footer'>");
	document.writeln("<p>A company of TeleChoice International Limited | Copyright 2004 NexWave. All Rights Reserved. | Reg. No. 199 402 532 D. Reg. No. 200 101 798C | <a href='http://www.nexwave.com.sg/terms.html' class='footer_link'>Terms & Conditions</a></p>");
	document.writeln("</div>");
}

function generate_content_mainpic() {
	document.writeln("<img src='" + sitepath + "images/" + mainpic + "_mainpic.jpg' width='400' height='87' /><br />");
}

function generate_content_header() {
	document.writeln("<table width='100%' border='0' cellspacing='5' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td><img src='" + sitepath + "images/" + header + "_header.gif' /></td>");
	document.writeln("<td align='right'>");
	generate_icons_emailprint();
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("<img src='" + sitepath + "images/pixel.gif' width='1' height='5' /><br />");
}

function generate_breadcrumb(navtext, navlink) {
	if (navtext == "Home") {
		document.writeln("<table width='100%' height='30' border='0' cellspacing='0' cellpadding='0'>");
		document.writeln("<tr><td valign='top' class='breadcrumbs'>");
	} else {
		document.writeln(" &gt; ");
	}
	if (navlink == "") {
		document.writeln(navtext);
	} else if (navlink != "done") {
		document.writeln("<a href='" + sitepath + navlink + ".html' class='breadcrumb_link'>" + navtext + "</a>");
	} else {
		document.writeln(navtext);
		document.writeln("</td></tr>");
		document.writeln("</table>");
	}
}

function generate_icons_emailprint() {
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td class='icon_text'><a href='mailto:?Subject=NexWave&Body=" + location.href + "' class='icon_link'>Email</a> &nbsp; </td>");
	document.writeln("<td><a href='mailto:?Subject=NexWave&Body=" + location.href + "' class='icon_link'><img src='" + sitepath + "images/icon_email.gif' width='13' height='9' border='0' /></a></td>");
	document.writeln("<td><img src='" + sitepath + "images/pixel.gif' width='20' height='1' /></td>");
	document.writeln("<td class='icon_text'><a href='javascript:window.print();' class='icon_link'>Print</a> &nbsp; </td>");
	document.writeln("<td><a href='javascript:window.print();'><img src='" + sitepath + "images/icon_print.gif' width='13' height='11' vspace='2' border='0' /></a></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
}

function generate_icons_contactus() {
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td class='icon_text'><a href='http://www.nexwave.com.sg/contactus_requestinfo.html' class='icon_link'>Contact Us</a> &nbsp; </td>");
	document.writeln("<td><a href='http://www.nexwave.com.sg/contactus_requestinfo.html'><img src='" + sitepath + "images/icon_contact.gif' width='13' height='11' vspace='2' border='0' /></a></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
}

function generate_tagline(tagline) {
	document.writeln("<table border='0' width='770' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td>");
	document.writeln("<br />");
	document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	document.writeln("<tr>");
	document.writeln("<td width='225'><img src='" + sitepath + "images/pixel.gif' width='1' height='1' /></td>");
	document.writeln("<td><img src='" + sitepath + "images/" + tagline + "_tagline.gif' /></td>");
	document.writeln("<td width='25'><img src='" + sitepath + "images/pixel.gif' width='1' height='1' /></td>");
	document.writeln("<td><img src='" + sitepath + "images/nexwave_arrow.jpg' width='35' height='35' /></td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("<br />");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("<tr><td bgcolor='#CCCCCC'><img src='" + sitepath + "images/pixel.gif' width='1' height='1' /></td></tr>");
	document.writeln("</table>");
}

function generate_sidenav_divider() {
	document.writeln("<tr><td bgcolor='#CCCCCC'><img src='" + sitepath + "images/pixel.gif' width='1' height='1' /></td></tr>");
}

function generate_sidenav_subspacing() {
	document.writeln("<tr><td><img src='" + sitepath + "images/pixel.gif' width='12' height='3' /></td><td><img src='" + sitepath + "images/pixel.gif' width='16' height='1' /></td><td><img src='" + sitepath + "images/pixel.gif' width='146' height='1' /></td></tr>");
}

function generate_sidenav(navtext, navlink, style_cell, style_text, submenu) {
	document.writeln("<tr>");
	document.writeln("<td class='" + style_cell + "'><a href='" + sitepath + navlink + ".html' class='" + style_text + "'>" + navtext + "</a><br />");
	if (submenu == "null") {
		document.writeln("</td></tr>");
	} else {
		document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
	}
}

function generate_sidenav_sub(navtext, navlink, style_cell, style_text, subnavdone) {
	document.writeln("<tr><td valign='top' class='" + style_cell + "'><img src='" + sitepath + "images/sidenav_bullet.gif' width='12' height='3' vspace='5' /></td><td colspan='2'><a href='" + sitepath + navlink + ".html' class='" + style_text + "'>" + navtext + "</a></td></tr>");
	if (subnavdone == "done") {
		document.writeln("</table>");
		document.writeln("</td></tr>");
	}
}

function generate_sidenav_subsub(navtext, navlink, style_cell, style_text, subnavdone) {
	document.writeln("<tr><td valign='top' colspan='2'><img src='" + sitepath + "images/sidenav_arrow.gif' width='28' height='5' vspace='5' /></td><td><a href='" + sitepath + navlink + ".html' class='" + style_text + "'>" + navtext + "</a></td></tr>");
	if (subnavdone == "done") {
		document.writeln("</table>");
		document.writeln("</td></tr>");
	}
}

function generate_sidenav_subsubsub(navtext, navlink, style_cell, style_text, subnavdone) {
	document.writeln("<tr><td colspan='2' valign='top'><img src='" + sitepath + "images/pixel.gif' width='1' height='15' /></td><td><span class='sidenav_dash'>- </span><a href='" + sitepath + navlink + ".html' class='" + style_text + "'>" + navtext + "</a></td></tr>");
	if (subnavdone == "done") {
		document.writeln("</table>");
		document.writeln("</td></tr>");
	}
}

function generate_contentlistitem(item, link, liststate) {
	if ((liststate == "startlist") || (liststate == "singleitemlist")) {
		document.writeln("<table border='0' cellspacing='0' cellpadding='0' class='content_tabletext'>");
	}
	if (link != "") {
		item = "<a href='" + sitepath + link + ".html' class='content_link'>" + item + "</a>";
	}
	document.writeln("<tr><td width='10' valign='top'><img src='" + sitepath + "images/content_bullet.gif' width='3' height='3' hspace='2' vspace='5' /></td><td>" + item + "</td></tr>");
	if ((liststate == "endlist") || (liststate == "singleitemlist")) {
		document.writeln("</table>");
	}
}

function generate_highlights_contactpanel(vspace) {
	document.writeln("<a href='javascript:click_mainnav(\"" + sections[sections.length-1].code + sections[sections.length-1].landing + "\")'><img src='" + sitepath + "images/highlights_contactus.jpg' width='134' height='106' vspace='" + vspace + "' border='0' /></a>");
}

function generate_logo(logo, link, logostate) {
	if ((logostate == "starthighlightlogos") || (logostate == "singlehighlightlogo")) {
		document.writeln("<table width='130' border='0' cellspacing='0' cellpadding='0' class='highlights_textheader'>");
		document.writeln("<tr><td><br />Related links:<br /><br /></td></tr>");
		document.writeln("<tr><td>");
	}
	document.writeln("<a href='" + link + "' target='_blank'><img src='" + sitepath + "images/" + logo + "' border='0'></a><br /><br />");
	if ((logostate == "endhighlightlogos") || (logostate == "singlehighlightlogo")) {
		document.writeln("</td></tr>");
		document.writeln("</table>");
	}
}

function preload_images() {
	if (document.images) {
		for (temp=0; temp<sections.length; temp++) {
			eval('image_topnav_' + sections[temp] + '_on = new Image()');
			eval('image_topnav_' + sections[temp] + '_on.src = sitepath + "images/topnav_' + sections[temp] + '_on.gif"');
		}
	}
}

function rollon_image(item) {
	document.images["image_" + item].src = sitepath + "images/" + item + "_on.gif";
}

function rolloff_image(item) {
	document.images["image_" + item].src = sitepath + "images/" + item + "_off.gif";
}

function click_mainnav(item) {
	location.href = sitepath + item + ".html";
}