function openWin(url,nameW,widthW,heightW,top,left,properties)
{
	winObj=window.open(url, nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=nos,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  winObj.focus();
  return winObj;
}
function openWinGal(url,nameW)
{
 	widthWin=600;heightWin=450;
	if (!screen) return;
  var mtoX, mtoY;
  if (screen){
		mtoX = (screen.width<700) ? 10 : (screen.width-widthWin)/2;
		mtoY = (screen.height<600) ? 10 : (screen.height-heightWin)/2;
  }
  else{
	 	mtoY = 100;
		mtoX = 100;
  }

	winObj=window.open(url, nameW,"width="+widthWin+",height="+heightWin+",top="+mtoY+",left="+mtoX+",directories=no,menubar=no,toolbar=no,location=nos,status=no,resizable=yes,copyhistory=no,scrollbars=no");
  winObj.focus();
  return winObj;
}
function resizeWin(winObj,widthW,heightW,moveToX,moveToY)
{
	if (!screen) return;
  var mtoX, mtoY;
  if (screen){
  	if (moveToX==0)
    	mtoX=xMouse;
		else if (moveToX==-1) //centruj horizontal
			 mtoX = (screen.width<700) ? 10 : (screen.width-widthW)/2;
		else
			 mtoX = moveToX;
  	if (moveToY==0)
    	mtoY=yMouse;
		else if (moveToY==-1) //centruj vertikal
		   mtoY = (screen.height<600) ? 10 : (screen.height-heightW)/2;
		else
			mtoY = moveToY;
  }
  else{
	 	mtoY = 10;
		mtoX = 10;
  }
  if (widthW>0 && heightW>0)
    winObj.resizeTo(widthW,heightW);
	winObj.moveTo(mtoX,mtoY);
}

function openWinEx(url,width,height)
{
 	widthWin=width;heightWin=height;
   var mtoX, mtoY;
    if (screen){
        mtoX = (screen.width<widthWin) ? 10 : (screen.width-widthWin)/2;
        mtoY = (screen.height<heightWin) ? 10 : (screen.height-heightWin)/2;
    }else{
        mtoY = 100;
        mtoX = 100;
    }

    winObj=window.open(url, "_pop","width="+widthWin+",height="+heightWin+",top="+mtoY+",left="+mtoX+",directories=no,menubar=no,toolbar=no,location=nos,status=no,resizable=yes,copyhistory=no,scrollbars=no");

    winObj.focus();
}
