/**
 * @author Manuele Vaggelli
 */
function ShowWindow(_page, _winname, _width, _height, _top, _left) {
	var ScreenW,ScreenH,WinW,WinH,WinX,WinY,WinRef,WinName;
	ScreenW = eval(screen.availWidth);
	ScreenH = eval(screen.availHeight);
	WinW = (_width == "") ? 400 : _width;
	WinH = (_height == "") ? 300 : _height;
	WinX = (_left == "") ? ((ScreenW/2) - (_width/2)) : _left;
	WinY = (_top == "") ? ((ScreenH/2) - (_height/2)) : _top;
	WinName = (_winname == "") ? "PopupWin" : _winname;
    WinRef = window.open(_page,WinName,'width=' + WinW + ',height=' + WinH + ',menubar=no,scrollbars=no,resizable=no, top=' + WinY + ', left ='+ WinX +'');
	if( WinRef ) WinRef.focus();
}

/**
 * @author Manuele Vaggelli
 */
function CloseWindow(_location){
    window.opener.location = _location;
    self.close();
}

/** 
 * @author Manuele Vaggelli 
 */
function swapImage(theValue){
    document.getElementById('img_zoom').src=theValue;
}

/** 
 * @author Manuele Vaggelli 
 */
function ShowToolTip(width, e, message) {
	if(document.all) { e = event;}
	
	var tt = document.getElementById('tooltip');
	var ttc = document.getElementById('tooltip_content');
	var st = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
	var leftPos = e.clientX - 100;
	if(leftPos < 0) { leftPos = 0; }
	
	ttc.innerHTML = message;
	tt.style.display = 'block';
	tt.style.width = width + 'px';
	tt.style.left = leftPos + 'px';
	tt.style.top = e.clientY - tt.offsetHeight -1 + st + 'px';
}	

/** 
 * @author Manuele Vaggelli 
 */
function HideToolTip() {
	document.getElementById('tooltip').style.display = 'none';	
}

