$(document).ready(function() {
	// Картинки заменить на картинки с бордюром.
	$('.wborder').each(function() {
		var src = $(this).attr('src');
		var alt = $(this).attr('alt');
		$(this).replaceWith(
'<table summary="" class="iborder" cellpadding="0" cellspacing="0"><tbody><tr><td class="iborder1"><div style="width:9px;"></div></td><td class="iborder2"></td><td class="iborder3"><div style="width:9px;"></div></td></tr>\
<tr><td class="iborder4"></td><td class="iborder5"><img src="' + src + '" alt="' + alt + '"/></td><td class="iborder6"></td></tr>\
<tr><td class="iborder7"></td><td class="iborder8"></td><td class="iborder9"></td></tr></tbody></table>'
		);
	});
});

// JavaScript Document

window.onload = function() {

/* Submenu width calculation */

	for (var ii = 0; ii < document.getElementById('menu').getElementsByTagName('ul').length; ii++) {
		document.getElementById('menu').getElementsByTagName('ul')[ii].style.width = document.getElementById('menu').getElementsByTagName('ul')[ii].parentNode.offsetWidth+'px';
	}
	
	
/* Dropdown ie6 support */

	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				}
			}
		}
	}
	
}
