function openCWindow(url) {
	window.open(url,null, "height=600,width=450,status=no,toolbar=no,menubar=no,location=no");
	return false;
}

function getObj(id) {
	if (typeof id != "string") return id;  
	else return document.getElementById(id);
}

function handle_sort_by(theEvent, theForm)
{
	alert(theEvent);
	alert(theForm);
	alert(theEvent.layerX);
	alert(theEvent.layerY);
	alert(theEvent.x);
	alert(theEvent.y);
}

/*
	nastavi objektu s id objId tridu class1 nebo class2 na zaklade podminky condition
*/
function switchClasses(objId, condition, class1, class2) {
	obj=getObj(objId);
	obj.className=(condition)?(class1):(class2);
	return false;
};

function checkForm(idArray) {
	ok = true;
	for (i=0; i<idArray.length; i++) {
		ok &= ((document.getElementById(idArray[i]).value!=''));
	}

	if (!ok) {
		alert('Je nutné zadat všechny povinné údaje.');
		return false;
	}
	
	return true;
}

function decheck_all_radio(theForm, obj)	{
	fieldArray = document.getElementById(theForm).getElementsByTagName('input');
	for (i=0; i<fieldArray.length; i++) {
		if (fieldArray[i].getAttribute('type')=='radio') fieldArray[i].checked=0;
	}
	obj.checked = true;
}

document.write('<link rel="StyleSheet" href="/css/jsStyle.css" type="text/css">');
