/*****************************************
 * FunctionName	ShowWindow
 * Author			Manuele Vaggelli
 * Description		Open a popup window
 *****************************************/
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();
}

/*****************************************
FunctionName    CloseWindow
Author          Manuele Vaggelli
Description     Close current Window and update Opener Window
******************************************/
function CloseWindow(_location){
    window.opener.location = _location;
    self.close();
}

/** 
 * @copyright BrainyByte di Vaggelli Manuele 
 * @author manuele.vaggelli@brainybyte.com
 */
function swapImage(theValue){
    document.getElementById('img_zoom').src=theValue;
}
