/*
$Id: functions.js,v 1.5 2005/07/04 10:39:59 pavel Exp $
*/


var old_name;
var obj;
var x;
var y;
var url;
var q;
var popWin;

function submitForm() {
	return true;
}

function Del() {
	return confirm("Chcete data opravdu smazat?");
}
function DelAll(){
	q=confirm("POZOR! Bude se mazat skupina dat!");
	if(q) q=Del();
	return q;
}

function openWIN(target,x,y) {
	popWin=window.open('',target,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+x+',height='+y+',left=10,top=10');
	popWin.focus();
}

function openWinURL(url,target,x,y) {
	popWin=window.open(url,target,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+x+',height='+y+',left=10,top=10');
	popWin.focus();
}

function test_and_openWIN(url,target,x,y) {	
	if(!window.openedWin) {
		window.openedWin = window.open(url,target,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+x+',height='+y+',left=30,top=30');
	}
	window.openedWin.focus();
}

// ----- Otevreni noveho okna ve stredu obrazovky -----
function openWINcenter(page,target,dx,dy){
	x=(screen.width-dx)/2;
	y=(screen.height-dy)/2;
	openWINxy(page,target,dx,dy,x,y);
}

function openImageWIN(target,x,y) {
	popWin=window.open('',target,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width='+x+',height='+y+',left=10,top=10');
	popWin.focus();
}

// ----- Otevreni noveho okna na pozici [x,y] -----
function openWINxy(page,target,dx,dy,x,y){
	popWin=window.open(page,target,'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width='+dx+',height='+dy+',left='+x+',top='+y);
	popWin.focus();
}

// DHTML
function getObj(name)
{
	if (document.getElementById) {
		return document.getElementById(name);
	} else
	if (document.all) {
		return document.all[name];
	} else
	if (document.layers) {
		return document.layers[name];
	} else return false;
}

function closeAndFocus( obj ) {
	if (obj.opener.focus) {
		obj.opener.focus();
	}
	obj.close();
}
