

function JSFMenuShow(layername) {
	if (document.all) {
		this.elm = document.all[layername];
		this.css = this.elm.style;
	}
	else {
		this.elm = document.getElementById(layername)
		this.css = this.elm.style;
	}
	this.css.visibility = "hidden";
	this.css.display = 'block';
	if (document.all){
		this.x = this.elm.offsetLeft;
		this.y = this.elm.offsetTop;
		
		this.w = this.elm.offsetWidth;
		this.h = this.elm.offsetHeight;
	}else{
		this.x = document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("left");
		this.y = document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("top");
		
		this.w = document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("width");
		this.h = document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("height");
	}	this.css.display = 'none';
	this.css.visibility = "visible";
	this.blocked = false;
	this.opened = false;
	
}

JSFMenuShow.prototype.msshow = JSFMenuShowMSShow;
JSFMenuShow.prototype.mshide = JSFMenuShowMSHide;

JSFMenuShow.prototype.show = JSFMenuShowShow;
JSFMenuShow.prototype.hide = JSFMenuShowHide;
JSFMenuShow.prototype.inbound = JSFMenuShowInbound;

JSFMenuShow.prototype.showPos = JSFMenuShowShowPosition;

/*
JSFMenuShow.prototype.toggle = JSFMenuShowToggle;
*/

function JSFMenuShowMSShow() {
	this.blocked = true;
	this.show();
}

function JSFMenuShowMSHide() {
	this.blocked = false

}

function JSFMenuShowShow(){
	this.css.display = "block";
	this.opened = true;

}

function JSFMenuShowHide(){
	if (this.blocked) return;
	this.css.display = "none"
}

function JSFMenuShowInbound(x, y) {
	y += 2;
	if ( x>=this.x && x<=(this.x + this.w+4) && y>=this.y && y<=(this.y + this.h) ){
		return true;
		}
	return false;
}

	function _mouseMove(e) {
		var y = (is.ns)? window.pageYOffset: event.clientY+document.body.scrollLeft;
		return y;
	}


function JSFMenuShowShowPosition(obj,posXobj,src,pos) {
    if (typeof(pos)=='undefined') pos = true;	
	y = getHeightID(obj);
	
	srcObj  = (document.all)?document.all["menu"+src+"Sub"]:document.getElementById("menu"+src+"Sub");
	if (typeof(srcObj)=='undefined') return
	this.elm.innerHTML = srcObj.innerHTML

	this.css.visibility = "hidden";
	this.css.display = 'block';
	if (document.all){
		if (is.ie7){

			this.x = this.elm.offsetLeft;
			this.y = this.elm.offsetTop;
			
			this.w = this.elm.offsetWidth;
			this.h = this.elm.offsetHeight;
		} else{
			this.x = this.elm.offsetLeft;
			this.y = this.elm.offsetTop;

			this.w = this.elm.offsetWidth;
			this.h = this.elm.offsetHeight;
		}
	}else{
		this.x = parseInt(document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("left"));
		this.y = parseInt(document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("top"));
		
		this.w = parseInt(document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("width"));
		this.h = parseInt(document.defaultView.getComputedStyle(this.elm, "").getPropertyValue("height"));
	}
	this.css.display = 'none';
	this.css.visibility = "visible";
	var corection = (this.w>200)? 156 : 0;
	if (is.ie7) {
		posXobj= posXobj+ 90;
	}
	if (this.h < posXobj ) {
		if ( y < posXobj - this.h ) {
	
			this.css.top = y - this.h/2;
			this.y = y - this.h/2;
			this.css.left = (pos)? winW/2 - 161 - barsFix(): (winW/2)-7;
			this.x = (pos)? winW/2 - 161 - barsFix(): (winW/2)-7;
		}
		else {
			this.css.top = posXobj - this.h;
			this.y = posXobj - this.h ;
			
			this.css.left = (pos)? winW/2 - 161  - barsFix(): winW/2 - corection -7;
			this.x = (pos)? winW/2 - 161  - barsFix() :winW/2 - corection -7;
		}
	}else {

			this.css.top = 0;
			this.y = 0;
			this.css.left = (pos)? winW/2  - 161 - barsFix() : winW/2-7;
			this.x = (pos)? winW/2  - 161 - barsFix(): winW/2-7;
	}
	if (is.ie7) {
			this.css.left = (parseInt(this.css.left) +10);
			this.x = (parseInt(this.x) + 10);
	}

	this.blocked = true;
	this.show();
}

