function prepare_products_menu() {
	var links = document.getElementById("products_menu_links").getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
		var divid = "dropdown" + links[i].id.substr(links[i].id.indexOf("_"));
		if (document.getElementById(divid)) {
			document.getElementById(divid).style.direction = 'rtl';

			links[i].onmouseover = function(e) {
				e = (e) ? e : ((window.event) ? event : null);
				var divid = "dropdown" + this.id.substr(this.id.indexOf("_"));
				document.getElementById(divid).style.backgroundColor = this.name;
				dropdownmenu(this, e, divid);
				return false;
			};

			links[i].onclick = function() {
				return clickreturnvalue();
			};
		} else { // - no menu
			links[i].onmouseover = function() {
				this.style.color = '#FFFFCC';
				this.style.backgroundColor = this.name;
				return false;
			};

			links[i].onmouseout = function() {
				this.style.color = 'white';
				this.style.backgroundColor = '';
				return false;
			};
		}	
	}
}

jQuery(function($) {
	prepare_products_menu();

	function content_resize() {
		$('#products_menu').css({width: $(window).width()-180});
	}
	$(window).wresize(content_resize);
	content_resize();
});