/*	Author: Jacky Fang
	Date: Jan 27, 2005
	Copyright 2005

	Copy the following codes to the proper location in the HTML file.
	<!--- Jacky's Code Starts Here --->
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr><td><img src="image/logo.gif" border="0"></td></tr>
		<tr><td align="center"><script language="JavaScript" src="menu.js"></script></td></tr>
	</table>
	<!--- Jacky's Code Ends Here --->
*/

// Change the settings here to customize the look
ColorBg			= "E0E6EB";												// Main Menu Button Color
ColorBgSl		= "FF9900";												// Main Menu Selected Button Color
ColorHilite		= "FFB951";												// Main Menu Button Hilighted Color
ColorSubBg		= "FFFFFF";												// Mouse over popup Sub Menu Button Background Color
ColorSubBgSl	= "FF9900";												// Selected Sub Menu Button Background Color
ColorSubHilite	= "FFFFFF";												// Sub Menu Button Hilighted Color
ColorSubHiliteSl= "FFFFFF";												// Selected Sub Menu Button Hilighted Color
ColorSubBar		= "EDE2D6";												// Sub Menu Background Color, recommended as the same color as ColorHilite
ColorSubBarSl	= "FF9900";												// Selected Sub Menu Background Color
FontColor		= "2C3A54",												// Font Color
FontFamily		= "Verdana, Geneva, Arial, Helvetica, sans-serif";		// Font Family
FontSize		= "7pt";												// Font Size
MenuHeight		= "13pt";												// The height of the menu bar
DivHeight		= "20pt";												// The preserved space for the sub menu, should be bigger than MenuHeight
LetterSpacing	= "1pt";												// The space between the letters of the menu

// Edit the Menu list below
// The first pair of the sub array is the Main Menu item
menus = [
	[	["&nbsp;&nbsp;ÏËÞÑÛ ÐÅÃÈÑÒÐÀÖÈÈ&nbsp;&nbsp;","index.html"]
	],
	[	["ÓÑËÓÃÈ È ÖÅÍÛ","uslugi.html"]
	],
	[	["ÑÐÎÊÈ È ÃÀÐÀÍÒÈÈ","sroki.html"]
	],
	[	["ÔÎÐÌÀ ÇÀÊÀÇÀ","zakaz.html"]
	],
	[	["&nbsp;&nbsp;&nbsp;&nbsp;Î ÍÀÑ&nbsp;&nbsp;&nbsp;&nbsp;","onas.html"]
	],
	[	["&nbsp;&nbsp;&nbsp;&nbsp;ÏÐÅÑÑÀ&nbsp;&nbsp;&nbsp;&nbsp;","pressa.html"]
	]
]

//!!! DO NOT CHANGE ANY CODE BELOW !!!//
var SubMenu = new Array();
var SelMenu = 0;
var timer;
var tmpObj;
var tmpColor;


loc0 = document.URL;
loc = loc0.indexOf("?") > 0 ? loc0.substring(0,loc0.indexOf("?")) : loc0;

if (loc.substr(0,23) == "http://contextclick.com") {
	loc = "http://www.contextclick.com" + loc.substr(23)
}

document.writeln('<table width="100%" cellpadding="0" cellspacing="3" border="0"><tr style="height:' + MenuHeight + ';letter-spacing:' + LetterSpacing + '">');

for (i=0; i<menus.length; i++) {
	thisMenu = false;
	for (j=0; j<menus[i].length; j++) {
		for (k=1; k<menus[i][j].length; k++) {
			url_compare = menus[i][j][k].indexOf("?") > 0 ? loc0 : loc;		// decide whether of not to compare the url with the query string
			if (menus[i][j][k] == url_compare) {
				thisMenu = true;
				break;
			}
		}
		if (thisMenu)
			break;
	}

	if (thisMenu) {
		color = ColorBgSl;
		colorHt = ColorBgSl;
		subBarColor = ColorSubBarSl;
		subBtnColor = ColorSubBgSl;
		subBtnColorHt = ColorSubHiliteSl;
		SelMenu = i;
	}
	else {
		color = ColorBg;
		colorHt = ColorHilite;
		subBarColor = ColorSubBar;
		subBtnColor = ColorSubBar;
		subBtnColorHt = ColorSubHilite;
	}

	if (menus[i].length > 1) {
		// Prepare the sub menu
		str = '<table align="center" cellpadding="0" cellspacing="0" border="0" style="background-color:' + subBarColor + '"';
		str += ' onmouseover="clearTimeout(timer)"';
		str += ' onmouseout="hideSub(' + i + ')"';
		str += '><tr><th>';
		str += '<table align="center" cellpadding="0" cellspacing="3" border="0"><tr style="height:' + MenuHeight + ';letter-spacing:' + LetterSpacing + '">';
		for (j=1; j<menus[i].length; j++) {
			url_compare = menus[i][j][1].indexOf("?") > 0 ? loc0 : loc;		// decide whether of not to compare the url with the query string
			if (menus[i][j][1] == url_compare) {
				subColor = subBtnColorHt;
			}
			else {
				subColor = subBtnColor;
			}
			if (j>1) {
				str += '<td width="1" valign="middle" ><img src="image/line.gif" width="1" height="10"></td>';
			}
			str += '<th nowrap style="background-color:' + subColor + ';font-family:' + FontFamily + ';color:' + FontColor + ';font-size:' + FontSize + ';cursor:pointer;cursor:hand"';
			str += ' onclick="document.location=\'' + menus[i][j][1] + '\'"';
			str += ' onmouseover="this.style.backgroundColor=\'' + subBtnColorHt + '\'"';
			str += ' onmouseout="this.style.backgroundColor=\'' + subColor + '\'"';
			str += '><img src="image/1pix.gif" width="15" height="0">' + menus[i][j][0] + '<img src="image/1pix.gif" width="15" height="0"></th>';
		}
		str += '</tr></table></th></tr></table>';
	}
	else
		str = "";
	SubMenu[i] = str;

	btMenu = '<th nowrap style="background-color:' + color + ';font-family:' + FontFamily + ';color:' + FontColor + ';font-size:' + FontSize + ';cursor:pointer;cursor:hand"';
	btMenu += ' onclick="document.location=\'' + menus[i][0][1] + '\'"';
	btMenu += ' onmouseover="this.style.backgroundColor=\'' + colorHt + '\';showSub(this,\'' + color + '\',' + i + ')"';
	btMenu += ' onmouseout="hideSub(' + i + ')"';
	btMenu += '>' + menus[i][0][0] + '</th>';

	document.writeln(btMenu)

}

document.writeln('</tr></table><div id="subMenuBar" style="width:98%;height:' + DivHeight + '"></div>');

showSelected()

function showSub(obj,color,i) {
	if (typeof(tmpObj) != "undefined" && tmpObj != obj)
		tmpObj.style.backgroundColor = tmpColor;

	document.getElementById("subMenuBar").innerHTML = SubMenu[i];
	clearTimeout(timer);
	tmpObj = obj;
	tmpColor = color;
}

function showSelected() {
	if (typeof(tmpObj) != "undefined")
		tmpObj.style.backgroundColor = tmpColor;

	document.getElementById("subMenuBar").innerHTML = SubMenu[SelMenu]
}

function hideSub(i) {
	timer = setTimeout("showSelected()",500)
}

