function init_event() {
	
	
	init_submenu('#submenu'); 
	init_kal();	
	init_download();
	
	var obsah_my_modal=$("#modal_data").html();
	if (obsah_my_modal.length>0)$("#myModal").modal(myModal_styl["clasic"]);	
	
	
}



function init_download() {
	
	
		
			$(".myfile_folder").bind('click', function (e) {
				if ($(this).parent().children("div").is(":visible")) $(this).parent().children("div").hide();
				else  $(this).parent().children("div").show();
			});
	
}




function show_hide(obj) {
	if ($(obj)) {
		
		if ($(obj).style.display=="none") $(obj).style.display="block";
		else $(obj).style.display="none";
		
		}
	}
	
function hide_obj(obj) {
	if ($(obj)) $(obj).style.display="none";

	}
	
function msg_test(txt) {
	
	$("Modal_oddelovac").update(txt);
	$("Modal_oddelovac").setStyle({
		padding: '10px',
		backgroundColor: '#FF9900'
	});
	
}

function test_hledej() {
	
	if ($("hledany_text").value.length<3) alert ("Pro vyhledávání je nutné zadat minimálně 3 znaky !");
	else $("find_frm").submit();
	
	return false;
	
	
	}


function newloc(url) {
	
	document.location=url;
	
}

function real_num(co,position){
	
	var ncs = co.value.split(',');
  	ncs = ncs.join('.');
	var num=Math.pow(10,position);
	if (position>0) ncs=Math.round(ncs*num)/num;
	co.value=eval(ncs);
}

function Test_user_in_A(obj) {
	
	var id=$(obj).attr("myid");
	if ($(obj).is(':checked')) {
		
		$("#n_"+id).removeAttr('disabled');
		$("#h_"+id).removeAttr('disabled');

		
	}
	else {
		$("#n_"+id).val("");
		$("#h_"+id).val("");
		$("#n_"+id).attr("disabled","disabled");
		$("#h_"+id).attr("disabled","disabled");
	}
}



function test_email(obj) {
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($("#"+obj).val())) return true;
	else return (false);
}


function registrace_NTE() {
	
	if (test_email("nte")) modal_req('main.php','ac=nte_registrace&email='+$("#nte").val());
	else myModal_OSX('Nesprávný formát E-mailové adresy')
		
	
	
}




