library.prototype.default_link="/ajax";
var getHost=new tools.Url().host;
var Menu=Class({
	name:"Menu",
	implements:[tools.browser],
	constructor:function(){
		this.menu0();
	},
	private:{
		menu0:function(){
			$("li.menu-item").hover(this.menu0_hoverOn,this.menu0_hoverOff);
		},
		menu0_hoverOn:function(e){
			var $$=$(e.currentTarget);
			with($$){
				var elementYCount=Math.ceil(find("div.menu-child a,div.menu-child b").length/4);
				if(find("div.sub_menu-parent_ellement").length==0){
					for(var i=0;i<4 && i<find("div.menu-child a,div.menu-child b").length;i++){
						find("div.menu-child").append("<div class='sub_menu-parent_ellement'></div>");
					}
				}
				find("div.sub_menu-ellement").each(function(index,element){
					$$.find("div.sub_menu-parent_ellement:eq("+Math.floor(index/elementYCount)+")").append(element);
				});
				if(find("div.menu-child a,div.menu-child b").length>0){
					find("div.menu-child").css({
						display:"block"
					});
					find("div.menu_opacity_block").css({
						width:find("div.menu-child").width(),
						height:find("div.menu-child").height()+20,
						opacity:.9
					});
					if(this.IE6){
						find("div.menu_opacity_block").css({
							opacity:.85
						});
						find("div.sub_menu-ellement").css({
							position:"relative",
							top:"-12px",
							left:"-20px"
						});
					}
				}
			}
		},
		menu0_hoverOff:function(e){
			var $$=$(e.currentTarget);
			with($$){
				find("div.menu-child").css({
					display:"none"
				});
			}
		}
	}
});
var Main=Class({
	name:"Main",
	implements:[tools.browser],
	constructor:function(){
		$(document).ready(this.init);
	},
	private:{
		init:function(){
			this.image();
			new Menu();
		},
		image:function(){
			with(new ui.fview($("#content"))){
				init();
				mode_switch=false;
			}
			$("a[href$=png], a[href$=jpg], a[href$=jpeg], a[href$=gif]").find("img").bind({
				mouseenter:function(){
					$(this).css({opacity:.85});
				},
				mouseleave:function(){
					$(this).css({opacity:1});
				}
			});
		}
	}
});
