var zoomPopupObj = null;function ZoomPopup(t){	this.div = dojo.byId("div_ZoomPopup");	this.curImg = "";	this.type = t || "collection";	this.timer = null;	this.closed = true;		//console.log("type1: "+this.type);		if(!this.div){		this.div = dojo.create("DIV", {id: "div_ZoomPopup"}, document.body, "first");		this.div.style.display = "none";		dojo.connect(this.div, "onMouseMove", function(ev){			zoomPopupObj.closed = false;			zoomPopupObj.div.style.display = ""		})	}		this.div.className = t;		this.moveTo = function(x,y){		var bodyPos = dojo.position(document.body, false);		var sLeft = document.body.scrollLeft;			var sTop = document.body.scrollTop;								var width = this.div.style.width;		width = 1*width.substr(0, width.indexOf('p'));				var height = this.div.style.height;		height = 1*height.substr(0, height.indexOf('p'));					if(x+width+23 > bodyPos.w){			x -= width+30		}else{			x += 10		}		//window.status = (y+height+20) + "x"+bodyPos.h + "x" + sTop		if(y+height+20 > bodyPos.h){			y -= height+20					}		y = y+10		if(dojo.isIE){					y += sTop;							x += sLeft;				}		if(y-sTop <0)y = sTop;					this.div.style.top = y + "px";				this.div.style.left = x + "px"			}		this.setImg = function(imgSmall, imgZoom, imgsize, id, nm, f){		this.div.style.display = "";				this.curImg = imgSmall;							var size = (imgsize+"").split("x");					var w = 0;						while(this.div.firstChild){			this.div.removeChild(this.div.firstChild) 		}				if(dojo.isIE){			w = (size[0]*1)+15;					}else{			w = (size[0]*1);			//this.div.style.height = (size[1]*1);		}				/*patch for shadow under minimale /Karavashkin*/		var tw;		var th;						if (this.type=="minimale") {			tw = size[0]			th = size[1]		} else {			tw =(w<100)? 100 : w			th =(size[1]*1)+50		}				this.div.style.width = tw				this.div.style.height = th				//console.log("type2: "+this.type);				var info = "";		if(this.type == "collection"){			if (collStore.store) {					if(collStore.store._itemsByIdentity){					var item = collStore.store._itemsByIdentity[id];					if(item){							if(item.f[0] == NO_FABRIC)							info = (item.nma)?item.nma[0]:item.nm[0]						else							info = "\u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u044F " + item.nm[0] + " \u0444\u0430\u0431\u0440\u0438\u043A\u0430 " + item.f[0];					}				}			} else {				//for nomenklatura				info = "\u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u044F " + nm + " \u0444\u0430\u0431\u0440\u0438\u043A\u0430 " + f			}		}else if(this.type == "minimale"){			info = id		} else if(this.type == "palette"){			info = nm			}				var html = "";		if (this.type=="minimale") html = '<div id="zoomer_shadow" style="width:'+this.div.style.width+'; height:'+this.div.style.height+';">'		html += '<img class="pic" src="'+imgSmall+'" width='+size[0]+' height='+size[1]+' style="position:absolute; z-Index:51">'		html += '<table style="width:100%; height:100%; position:absolute; z-Index:52"><tr valign=middle><td align=center><img id="ZoomPopup_loader" src="/site/ecblank.gif" ></td></tr></table> '		html += '<img class="pic" src="'+imgZoom+'" width='+size[0]+' height='+size[1]		html += ' style="visibility:hidden; position:absolute; z-Index:53" onLoad="dojo.byId(&quot;ZoomPopup_loader&quot;).style.display = &quot;none&quot;; this.style.visibility = &quot;visible&quot; ">'		if (this.type!="minimale") html += '<div style="width:100%; position:relative; top:'+(size[1]*1+5)+'">'+info+'</div>'		if (this.type=="minimale") html += '</div>'		this.div.innerHTML = html				if (this.type=="minimale") {			var foo = new dojox.fx.Shadow({node: dojo.byId("zoomer_shadow")});			foo.startup();		}			}}function showZoomPopup(e, obj, img, imgZoom, size, id, type, nm, f){	if(zoomPopupObj == null){		zoomPopupObj = new ZoomPopup(type)	}else{				zoomPopupObj.type = type || "collection"			if(obj){			var par = getParent(obj.parentNode, false, "dojoDndItem");								if(par && dojo.hasClass(par, "dojoDndTargetDisabled")){								hideZoomPopup()							return			}		}	}		var coords = e.pageX?[e.pageX, e.pageY]:[e.x, e.y];		if(zoomPopupObj.closed){				if(zoomPopupObj.timer) clearTimeout(zoomPopupObj.timer);				zoomPopupObj.timer = setTimeout(function(){			if(zoomPopupObj.curImg != img){				zoomPopupObj.setImg(img, imgZoom, size, id, nm, f)			}else{				zoomPopupObj.div.style.display = "";			}									zoomPopupObj.moveTo(coords[0], coords[1]);						zoomPopupObj.closed = false					}, 700)	}else{		zoomPopupObj.moveTo(coords[0], coords[1]);	}	}function hideZoomPopup(el, ieFix){	zoomPopupObj.div.style.display = "none";	zoomPopupObj.closed = true;	if (el && ieFix) el.style.color="#000000";	if(zoomPopupObj.timer) clearTimeout(zoomPopupObj.timer)}
