window.onload = function() {
	var site_select = document.getElementById('site_select');
	
	if (site_select) {
		site_select.onchange = function() {
			window.location.href = site_select.value;
		}
	}

	var fullpath = window.location.href.toString();
	if(fullpath.indexOf('hedelix.ru') != -1) {
		rp = '/i3';
		color = '318C15';
		hover = 'ffffff';
	}
	if(fullpath.indexOf('valocordin.ru') != -1) {
		rp = '/i2';
		color = '007DAB';
		hover = 'fefefe';
	}
	if(fullpath.indexOf('regulax.ru') != -1) {
		rp = '/i4';
		color = 'ED6B01';
		hover = 'ffffff';
	}
	if(fullpath.indexOf('krewel-meuselbach.ru') != -1) {
		rp = '/i1';
		color = '2172B8';
		hover = '2172b8';
	}


	$(".hmenu_block").hover(function(){
		hmenu_block = $(this);
		hmenu_a = hmenu_block.find("a");
		hmenu_text = hmenu_block.children(".hmenu_text");
		hmenu_left = hmenu_block.children(".hmenu_left");
		hmenu_right = hmenu_block.children(".hmenu_right");

		hmenu_left.css('background','url(' + rp + '/hmenu_left_2.gif)');
		hmenu_a.css('color','#' + hover);
		hmenu_block.css({
			'background':'url(' + rp + '/hmenu_active.gif)'
		});
		hmenu_right.css('background','url(' + rp + '/hmenu_right_2.gif)');
		hmenu_block.next().show();
	},function(){
		hmenu_block = $(this);
		hmenu_a = hmenu_block.find("a");
		hmenu_text = hmenu_block.children(".hmenu_text");
		hmenu_left = hmenu_block.children(".hmenu_left");
		hmenu_right = hmenu_block.children(".hmenu_right");

		hmenu_left.css('background','url(' + rp + '/hmenu_left.gif)');
		hmenu_a.css('color','#' + color);
		hmenu_block.css({
			'background':'none'
		});
		hmenu_right.css('background','url(' + rp + '/hmenu_right.gif)');

		hmenu_block.next().hide();
	});


	
//	$(".hmenu_text a").hover(function(){
//		hmenu_block = $(this).parent().parent();
//		hmenu_text = $(this).parent();
//		hmenu_left = hmenu_text.prev();
//		hmenu_right = hmenu_text.next();
//
//		hmenu_left.css('background','url(/i2/hmenu_left_2.gif)');
//		hmenu_block.css({
//			'background':'url(/i2/hmenu_active.gif)',
//			'color':'#fefefe'
//		});
//		hmenu_right.css('background','url(/i2/hmenu_right_2.gif)');
//		hmenu_text.next().next().show();
//	},function(){
//		hmenu_block = $(this).parent().parent();
//		hmenu_text = $(this).parent();
//		hmenu_left = hmenu_text.prev();
//		hmenu_right = hmenu_text.next();
//
//		hmenu_left.css('background','url(/i2/hmenu_left.gif)');
//		hmenu_block.css('background','none');
//		hmenu_right.css('background','url(/i2/hmenu_right.gif)');
//
//		$(this).parent().next().next().hide();
//	});
}


