﻿function LangInfo(LangName, LangAddress, InfoName, InfoAddress, span_id)
{
	var i, main_loc, html = '';
	if (document.getElementById('page_maintitle') != null) 
		main_loc = document.getElementById('page_maintitle').innerHTML;
	else
		main_loc = '';
	
	html += '<table width="840" border="0" cellspacing="0" cellpadding="0" align="center">';
	html += 	'<tr valign="top" align="right">';
	html +=			'<td width="840" height="19" align="right">';
	for (i=0; i<LangName.length; i++) {
		if (LangAddress[i] == '') 
			html += '<font class="menu3">' + LangName[i] + '</font>';
		else
			html += '<a class="menu1" href="' + LangAddress[i] + '">' + LangName[i] + '</a>';
		if (!(i==LangName.length-1 && InfoName.length==0))
			html += '<img src="docs/PAGE/FI/FILES/VERT_13PX.GIF" width="1" height="13" border="0" hspace="7" style="vertical-align:-2;">';
	}
	for (i=0; i<InfoName.length; i++) {
		if (InfoAddress[i].split("/")[InfoAddress[i].split("/").length-1] == main_loc) 
			html += '<font class="menu3">' + InfoName[i] + '</font>';
		else
			html += '<a class="menu1" href="' + InfoAddress[i] + '">' + InfoName[i] + '</a>';
		if (i<InfoName.length-1)
			html += '<img src="docs/PAGE/FI/FILES/VERT_13PX.GIF" width="1" height="13" border="0" hspace="7" style="vertical-align:-2;">';
	}
	html += '</td></tr></table>';
	
	document.getElementById(span_id).innerHTML = html;
}


function str2hex(str)
{
	var hexDigits = '0123456789ABCDEF';
	var N = str.length;
	var hex = "";
	var d,h1,h2;
	
	for (var i=0; i<N; i++) {
		d = str.charCodeAt(i);
		if (d<=255) {
			h2 = d%16; h1 = (d-h2)/16; 
			hex += '%' + hexDigits.charAt(h1) + hexDigits.charAt(h2);
		}
		else 
			hex += '%FF';
	}
	return hex;
}
