function fixPNG() {
	for (var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id=\"" + img.id + "\" " : "";
			var imgClass = (img.className) ? "class=\""+img.className+"\" " : "";
			var imgTitle = (img.title) ? "title=\""+img.title+"\" " : "title=\"" + img.alt + "\" ";
			var imgStyle = "display:inline-block;"+img.style.cssText;
			if (img.align == "left") imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;

			var strNewHTML = "<span "+imgID+imgClass+imgTitle+" style=\"width: "+img.width+"px; height: "+img.height+"px;"+imgStyle+";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'"+img.src+"\', sizingMethod='scale');\"><img src=\"pics\/x.gif\" width=\"1\" height=\"1\" /></span>";
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", fixPNG);

function nav2over(id) {
//	closeNav2(id);
//	clearTimeout(time);
	//var elid = document.getElementById('nav1_'+id);
	var subelid = document.getElementById('nav2_'+id);	
	if (subelid) subelid.style.display = 'block';
	//if (elid) elid.className = 'item1sel';
}

function nav5over(id) {	
	var elid = document.getElementById('nav1_'+id);
	//var subelid = document.getElementById('nav2_'+id);	
	//if (subelid) subelid.style.display = 'block';
	if (elid) elid.className = 'item1sel';
}

function nav2out(id) {
	//var elid = document.getElementById('nav1_'+id);
	var subelid = document.getElementById('nav2_'+id);	
	if (subelid) subelid.style.display = 'none'; 	
	//if (elid) elid.className = 'item1';
}

function nav5out(id) {
	var elid = document.getElementById('nav1_'+id);
	//var subelid = document.getElementById('nav2_'+id);	
	//if (subelid) subelid.style.display = 'none'; 	
	if (elid) elid.className = 'item1';
}

var sevavto = { 
	currentLanguage: null,
	buildSubMenu: function(where, sectionPrefix, sectionID) {
		where.innerHTML='';

		var menu=document.getElementById('menu');
		var tds=menu.getElementsByTagName('td');
		for (t in tds){
			if(tds[t].className=='itemrightsel')
				tds[t].className='itemright';
			if(tds[t].className=='itemleftsel')
				tds[t].className='itemleft';
			if(tds[t].className=='item5sel') {
				tds[t].className='item5';
				var as=tds[t].getElementsByTagName('a');
				for (t in as){
					if(as[t].className=='sel')
						as[t].className='nosel';
				}
			}
		}
			
		document.getElementById('menu-'+sectionID+'-left').className='itemleftsel';
		document.getElementById('menu-'+sectionID+'-center').className='item5sel';
		document.getElementById('menu-'+sectionID+'-right').className='itemrightsel';
		document.getElementById('menu-'+sectionID+'-link').className='sel';

		if(sevavto.currentLanguage==null)
			eval("sevavto.currentLanguage="+flamework.json.app.getCurrentLanguage());

		eval("var response="+flamework.json.mod_sections.getSectionList(sectionPrefix));
				
		if(!response.sections.section.length)
			response.sections.section=new Array(response.sections.section);
		for (var i in response.sections.section) {
			if(response.sections.section[i].name.indexOf('.')==-1) {
			
				var displayName='';
				if(!response.sections.section[i].aliases.alias.length)
					response.sections.section[i].aliases.alias=new Array(response.sections.section[i].aliases.alias);
				for(var j in response.sections.section[i].aliases.alias) {
				 	if(response.sections.section[i].aliases.alias[j].iso==sevavto.currentLanguage)
				 		displayName=response.sections.section[i].aliases.alias[j].alias;
				}			
				where.innerHTML+='<a href="/section/'+response.sections.section[i].name+'" class="subs">'+displayName, +'</a>';
				if(i<response.sections.section.length-1) {
					where.innerHTML+='<span class="divisor">|</span>';
				}
			}
		}
		return false;
	}
}


