function resizeWin(winObj,widthW,heightW,moveToX,moveToY)
{
  var bScreen = is.ie || is.ns;
  var mtoX, mtoY;
  if (!winObj) return;

  if (bScreen){
  	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 openImgBig(id,oid,mod,lg,nameW,widthW,heightW,top,left,properties,noret)
{
	winObj=window.open('popUpImgBig.php?id='+id+'&oid='+oid+'&mod='+mod+'&lg='+lg, nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=no,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  if (winObj) winObj.focus();
  //if (noret!=1) return winObj;
}
function openWin(url,lg,nameW,widthW,heightW,top,left,properties,noret)
{
	winObj=window.open(url+'?lg='+lg,nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=no,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  if (winObj) winObj.focus();
}
function openURL(url,nameW,widthW,heightW,top,left,properties,noret)
{
	winObj=window.open(url,nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=no,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  if (winObj) winObj.focus();
  if (!noret) return winObj;
  else return null;
}
function openFoto(name,id,mod,lg,nameW,widthW,heightW,top,left,properties,noret)
{
	winObj=window.open('popUpFoto.php?name='+name+'&oid='+id+'&mod='+mod+'&lg='+lg, nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=no,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  if (winObj) winObj.focus();
  //if (noret!=1) return winObj;
}
function openImg(id,lg,nameW,widthW,heightW,top,left,properties,noret)
{
	winObj=window.open("popUpImg.php?oid="+id+"&lg="+lg,nameW,"width="+widthW+",height="+heightW+",top="+top+",left="+left+",directories=no,menubar=no,toolbar=no,location=no,status=no,resizable=no,copyhistory=no,scrollbars=no"+properties);
  if (winObj) winObj.focus();
  //if (noret!=1) return winObj;
}

function openWinEx(url,wname,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, wname,"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();
}


function openWinPan(url,wname,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, wname,"width="+widthWin+",height="+heightWin+",top="+mtoY+",left="+mtoX+",directories=no,menubar=no,toolbar=no,location=nos,status=no,resizable=yes,copyhistory=no,scrollbars=yes");
    winObj.focus();
}

