/*
 * UVM Administrační klientské skripty v.1.0
 *
 * Copyright (c) 2008+ UVM
 * Developer: Petr Hamtil
 *
 * Depends:
 *	jQuery, tabs
 *
 * Last in: new hm,help,timer
 */

var uvmAdmin = {
	timer: false, //nastavení časovače odpočtu sezení (true = zapnuto)
	time: new Date(),
	timeOut: 59,// doba vyprčení v minutách
	timeShow: 3360000,// zobrazení hlášky timeru v ms (1680000 = 28 minut)
	time_div: "#countDownWarning",
	time_value: "#countDown",
	time_divMessage: "#countDownMessage",
	tb_url: "/simpleLogin",
	insiteMenu: ".insite-admin",
	fieldset: ".tabbed",
	fieldsetMenu: ".tabs",
	hmRootJs: "HM_item_JS",
	hmRoot: "HM_item",
	hmMenu: ".HM_menu",
	hmItem: ".HM_button",
	hmClose: ".HM_close",
	HE_show: ".HE_show",
	HE_select: ".HE_select",
	helper: ".uvm_helper",
	help: ".uvm_help",
	helpClose: ".uvm_help_close",
	rollout: true,// aktivace skovávání rolloutu (skovávání podle id)(true = zapnuto)
	validate: true, //zapnutí kfieldsetontroly validace formulářových prvků
	editate: true, //zapnutí editování prvků na stránce
	ajaxServer: "/ajax",
	urlRemove: "",
	pointRemove: "",
	testing: false,
	testing2: false,
	
	ini: function(){
		/* fieldsety */
		uvmAdmin.uklidFieldset();

		/*
		 * Detekce stisknutých kláves 
		 * F2 	- insitemenu
		 * F9	- použito u AO, zapnutí/vypnutí testovacího režimu u přímých AO objektů. 
		 * 		- U externích (převážně ao_insert) nutno do vlastností zadat ručně test:true (do budoucna opravím) 
		 * F10 	- vypnutí js u odkazů a umožnění redir na url v href odkazu
		 * F12	- testovací tlačítko (1xklik test1, 2xklik test2)
		 */
		$(document).keydown(function(event){
			/* při stisku F2 zobrazí insiteMenu */
	 	  	if (event.keyCode == 113) {
	 				$(uvmAdmin.insiteMenu).toggle();
			}
			/* při stisku F10 zobrazí testMenu */	 	  	
	 	  	if (event.keyCode == 121) {
					uvmAdmin.test.noJsLinks();
			}	  		 	  	
	 	  	
			/* při stisku F12 zobrazí testMenu */	 	  	
	 	  	if (event.keyCode == 123) {
					uvmAdmin.test.init();
			}	  	
 	  	
		});

		$(document).ready(function(){
			
			//$(".pageList").sortable({ placeholder: 'ui-state-highlight', items: 'li' });
 			//var $tabsss = $('#lide_tabs').tabs(); // first tab selected

			$('.lide_tabs_link').click(function() { // bind click event to link
					$('#lide_tabs').tabs('select', 1); // switch to third tab
					return false;
			});
			
			// kontrola veřejnosti
			$("input[name='publish']").click(function () {
				if (!$(this).attr("checked"))
					$(this).parents("form").find("input[name^='aclGroups']")
							.filter(function (index) {				
				                  return $(this).val() == "4c9184f37cff01bcdc32dc486ec36961";
			                })
							.parents("tr").remove();
			});

			/* Tabs helper */
			if ($(".tabs")){
				$(".box_help_text").hide();
				$(".box_help .margin").html($($(".tabs a:first").attr("href")+" > fieldset > .box_help_text").html());			
				$(".tabs  a").click(function () {
					$(".box_help .margin").html($($(this).attr("href")+" > fieldset > .box_help_text").html());
				})
			}

			/* Dokumenty - řízení přístupu */

			/* Tabs xxx */
			// <input type="hidden" id="actualTab" name="actualTab" value="" />
			$("#document-tabs a").click(function () {
				$('#actualTab').attr("value",$(this).attr("href"));
			})


			if (uvmAdmin.timer == true) window.setTimeout("uvmAdmin.setTimer()",uvmAdmin.timeShow);

			if (uvmAdmin.rollout) {uvmAdmin.rollout();}

 	 			/* helpbind */ 

			$(uvmAdmin.helper).click(function () {

				var position = $(this).offset();
				$(this).children(uvmAdmin.help).clone().appendTo("body").css({ "position":"absolute", "left": position.left, "top": position.top,"z-index":"20" }).fadeIn("fast");

				$(uvmAdmin.help).bind("mouseleave",function(){
					$(this).fadeOut("fast",function () {$(this).remove()});
				});

				$(uvmAdmin.helpClose).click(function () {
					$(this).parent(uvmAdmin.help).fadeOut("fast",function () {$(this).parent(uvmAdmin.help).remove()});
					return false;
				});

			});
			
			uvmAdmin.heEfect();

			uvmAdmin.hmEfect();
			//uvmAdmin.checkBox();
		});
	},
/*
	checkBox: function(){// CB_box, CB_checked, CB_input
		$(".CB_box").click(function () {

			var check = $(".CB_box").hasClass( "CB_checked" ) ;
			//$(this).find(".CB_input").attr("checked", function (check) {check?return "":"checked";});
			$(".CB_box").toggleClass( "CB_checked" );

		});

	},
*/
	pleasewait: function(){
		
		if ($(".PW").hasClass("waitOnAjax")) return;

		$(".PW").css("top",Math.ceil($(window).scrollTop()+($(window).height()/2)));
		$(".PW").css("left",Math.ceil($(window).scrollLeft()+($(window).width()-$(".PW").width())/2));
		$(".PW").toggle();//slideToggle("slow"); 
	},

	rollout: function(jFormId){

			if( typeof(jFormId) == 'undefined') jFormId = "";

				/* Rollout - po kliknutí na odkaz s id rollout[NUMBER se sková/odkryje id rollout_NUMBER*/
			$(jFormId+" ul[id^='rollout_']").toggle();
			$(jFormId+" a[id^='rollout[']").click(function () {
				var pom = $(this).attr("id");
				reg = pom.match(/\d+/g);
				$("#rollout_"+reg).toggle("slow");
			}).toggle(
				function () {
					$(this).addClass("rollout_open");
				},
				function () {
					$(this).removeClass("rollout_open");
				}
			);
			
			// Zavírání Rolloutu
			$(jFormId+" .rollout_close").click(function () {
				$( $(".rollout_close").attr("href") ).toggle("slow"); 
			});

				/* RolloutClass - po kliknutí na odkaz s class rollout[NUMBER se sková/odkryje id rollout_NUMBER*/
			$(jFormId+" a .rollout").click(function () {
				var rel = $(this).attr("rel");
				$("#rollout_"+rel).toggle("slow");
			}).toggle(
				function () {
					$(this).addClass("rollout_open");
				},
				function () {
					$(this).removeClass("rollout_open");
				}
			);

	},
	
	ajaxRefresh: function(url){
		uvmAdmin.pleasewait();
		$.getJSON(url.href,
				function(data){
					uvmAdmin.pleasewait();

					if(data.error)
						{
							//alert(data.error);
							uvmAdmin.infoDialog(data.error);
						}else{
							if (data.ajaxType == 'refresh')
								location.reload(true);							
						}
				}
			);
	 return false;
	},

	infoDialog: function(text){

		$.jGrowl(text);
			/* dialogová okna */ 
		if (!document.getElementById("info-dialog") )
			$("body").append('<div id="info-dialog" title="Chyba:" style="display:none;"></div>');
		
		$("#info-dialog").html('<p><span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>'+text+'</p>');

		$("#info-dialog").dialog({	modal: false,zIndex: 3999,
			buttons: {
				Ok: function() {
					$(this).dialog( 'close' );
					$(this).dialog( 'destroy' );
				}
			}
		});
		
		$('#info-dialog').dialog('open');
	},
	
	saveDialog: function(options){

		var opt = {
				parentId	: "",
				parentForm	: "", 
				load_href		: "",	
				tpl : "",
				wrapper : "",
				insert_position		: "top",
				insert_href		: "",
				insert_title 		: "Editace",	
				insert_content 		: "Načítám...",
				insert_text		: "Změněno",
				insert_dialog_save 	: "Uložit změny",
				insert_dialog_storno 	: "Stornovat změny",
				insert_dialog_height  : 450,
				insert_dialog_width   : 800,
				test		: false
			};

		if (options) $.extend(opt, options);
		
		$.ao_test(opt.test,{test_content: "href: "+opt.insert_href});

		var dialog = $.ao_newDialog( opt.insert_content, {title:opt.insert_title, height: opt.insert_dialog_height, width: opt.insert_dialog_width} );

		var buttons = {};
		buttons[ opt.insert_dialog_storno ] = function() {
			$(this).dialog( 'close' );
		}
		buttons[ opt.insert_dialog_save ] = function() {

			var dialog = $(this);
			$.ao_test(opt.test,{test_content: "Provádí se ukládání."});
			
			if (opt.parentForm == ""){
				opt.parentForm = dialog.find("form").eq(0).attr("id");
			}

			$.ao_test(opt.test,{test_content: "Form id: "+dialog.find("form").attr("id")});
			
			$.ao_sendFileForm(opt,function(data,opt){

				$.ao_test(opt.test,{test_content: "Provádí se vkládání "+opt.ns+"."});
				$.ao_test(true,{test_content: opt.insert_text});		
				if(!data.error) dialog.dialog( 'close' );
				$.ao_test(true,{test_content: "Provádí se znovunačtení stránky."});	
				location.reload(true);
			});

		}

		dialog.dialog('option', {buttons: buttons});
		dialog.dialog('open');

		dialog.load(opt.load_href+"?r="+Date.UTC());
		$.ao_test(opt.test,{test_content: "Dokončení insert inicializace."});
		return false;
	},

	removeDialog: function(url,remove,text){
		//$.jGrowl(text);
			/* dialogová okna */ 
		if (!document.getElementById("ui-dialog") )
			$("body").append('<div id="ui-dialog" title="Opravdu smazat?" style="display:none;"></div>');

		uvmAdmin.urlRemove = url;
		uvmAdmin.pointRemove = remove;
		$("#ui-dialog").html('<p><span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>'+text+'</p>');

		$("#ui-dialog").dialog({
			zIndex: 3999,
			buttons: {
				Ano: function() {	
					uvmAdmin.pleasewait();
					$(".PW").addClass("waitOnAjax");
					$(this).dialog( 'close' );	
					
					$.getJSON(uvmAdmin.urlRemove,
						function(data){
							$(".PW").removeClass("waitOnAjax");
							uvmAdmin.pleasewait();
							if(data.error)
								{
									uvmAdmin.infoDialog(data.error);
								}else{
									
									if (typeof(data.wiseUrl) != 'undefined') 
									{
										location.assign("http://"+location.host+"/"+data.wiseUrl);
										return;
									}
									
									uvmAdmin.pointRemove.remove();		
									
								}
						}
					);
				},
				Ne: function() {
					$(this).dialog( 'close' );
				}
			}
		});
		
		$('#ui-dialog').dialog('open');
	},

	hmEfect: function(){

 			/* hm menu */ 
			$("."+uvmAdmin.hmRoot).addClass( uvmAdmin.hmRootJs );
			$("."+uvmAdmin.hmRoot).removeClass( uvmAdmin.hmRoot );
			uvmAdmin.hmRoot= "."+uvmAdmin.hmRootJs; 

			$(uvmAdmin.hmRoot+" "+uvmAdmin.hmItem).hide();
			$(uvmAdmin.hmRoot+" "+uvmAdmin.hmMenu+":hidden").show();

			$(uvmAdmin.hmRoot).click(function () {

				var position = $(this).offset();
				$(this).children(uvmAdmin.hmItem).clone().appendTo("body").css({ "position":"absolute", "left": position.left, "top": position.top,"z-index":"15" }).slideDown("fast");

				tb_init(".thickbox");

				$(uvmAdmin.hmItem).bind("mouseleave",function(){
					$(this).slideUp("fast",function () {$(this).remove()});
				});

				$(uvmAdmin.hmClose).click(function () {
					$(this).parent(uvmAdmin.hmItem).slideUp("fast",function () {$(this).parent(uvmAdmin.hmItem).remove()});
					return false;
				});

			});

	},

	heEfect: function(){
 			/* on mouse efekt */ 
			$(uvmAdmin.HE_show).hide();
		  $(uvmAdmin.HE_select).mouseenter(function(){
			  	//$.jGrowl("test");
				$(this).find(uvmAdmin.HE_show).show();
		  }).mouseleave(function(){
				$(this).find(uvmAdmin.HE_show).hide();
		  });
		  
	
/*			$(uvmAdmin.HE_select).live('mouseenter', function() {
				$(this).children(uvmAdmin.HE_show).show();
			});
			
			$(uvmAdmin.HE_select).live('mouseleave', function() {
				$(this).children(uvmAdmin.HE_show).hide();
			});*/
	},

	uklidFieldset: function(){
			/* fieldsety */
			$(uvmAdmin.fieldset+" "+uvmAdmin.fieldsetMenu+":hidden").show();
			$(uvmAdmin.fieldset+" legend").hide();
			$(uvmAdmin.fieldset+" fieldset").css("border","0px");
			$(uvmAdmin.fieldset+" fieldset").css("padding","0px");
			$(uvmAdmin.fieldset+" fieldset").css("margin","0px");
			
			var numberTab = location.hash.split("?")[0];
			
			//IE7 bugfix
			if ($.browser.msie) {
				$(uvmAdmin.fieldset).tabs({ select: 1 });
				if (numberTab != "")
					window.setTimeout("$('"+uvmAdmin.fieldset+"').tabs( 'select' , "+numberTab+" );",3)
				else
					window.setTimeout("$('"+uvmAdmin.fieldset+"').tabs( 'select' , 0 );",3);
			}else{
				$(uvmAdmin.fieldset).tabs({ selected: 0 });
				if (numberTab != "")
					$( uvmAdmin.fieldset ).tabs( 'select' , numberTab );
			}
			
			$(uvmAdmin.fieldset+"2 "+uvmAdmin.fieldsetMenu+":hidden").show();
			$(uvmAdmin.fieldset+"2 ").tabs({ collapsible: true, selected: -1 }); // pouzito pro defaultne zavrene taby, vetsinou pro volitelne forms u vypisu
	},

		/* hodiny, varování pro vypršení přihlášení - nastavení */
  setTimer: function() {
		uvmAdmin.pisHodiny();
		$(uvmAdmin.time_div).slideDown("fast");
	},

		/* hodiny, resetování hodin */
  resetTimer: function() {
		uvmAdmin.time = new Date();
		$(uvmAdmin.time_divMessage).hide();
		if (uvmAdmin.timer == true) window.setTimeout("uvmAdmin.setTimer()",uvmAdmin.timeShow);
		$(uvmAdmin.time_div).slideUp("fast");
	},

		/* provádí se po zavření přihlašovacího okna */
  postLogin: function() {
		self.parent.uvmAdmin.resetTimer();
		self.parent.tb_remove();
	},

		/* hodiny, varování pro vypršení přihlášení - časování/odpočet*/
  pisHodiny: function() {
		var limit = uvmAdmin.timeOut;
		p = uvmAdmin.time;
 		d = new Date();
		o = new Date(d-p);

	  h = o.getHours();	
	  min = o.getMinutes();
	  sec = o.getSeconds();

		if ( h>1 || min >= limit) {
			$(uvmAdmin.time_divMessage).click(function () {uvmAdmin.resetTimer();});
			$(uvmAdmin.time_value).text("00:00");
			$(uvmAdmin.time_divMessage).show();
			
			if ($("#ajax_loginForm").length == 0) tb_show("Login","/ajax/case:loginForm/ajaxType:refresh/?KeepThis=true&height=120&width=600","");
			//tb_show("Login",uvmAdmin.tb_url+"?keepThis=true&amp;TB_iframe=true&amp;width=650&amp;height=130","");//?height=120&width=400
			
		}else{
			min = limit -1 - min; sec = 59 - sec;
		  TimeValue = ((min < 10) ? "0" : "") + min;
		  TimeValue += ((sec < 10) ? ":0" : ":") + sec;

		  $(uvmAdmin.time_value).text(TimeValue);
		  window.setTimeout("uvmAdmin.pisHodiny()",1000);
		}
	},

		/* CoolUrl */

	
    coolUrl: function(cNazev,cUrl,cBox,cHlaska){


		function cUrlValid(thisOne){
	 		var url = $(thisOne).val();
			var coolUrl = "";
			var sdiak = " áäčďéěíĺľňóôöŕšťúůüýřž";
			var bdiak = "-aacdeeillnooorstuuuyrz";
			var abc = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","-","_");

			url = url.toLowerCase();
			for(var p = 0; p < url.length; p++)	{
		    if (sdiak.indexOf(url.charAt(p)) != -1)	{
		      coolUrl += bdiak.charAt(sdiak.indexOf(url.charAt(p)));
		    }
		    else (jQuery.inArray(url.charAt(p), abc)!= -1)?coolUrl += url.charAt(p):coolUrl += "_";
			}
			$(cUrl).val(coolUrl);
		};
		
		$(cNazev).keyup(function(){ $(cBox).attr("checked")==""?"":cUrlValid(this);});
		$(cUrl).keyup(function(){cUrlValid(this)});


		function cUrlDotaz(){
			var url = $(cUrl).val();

			$.ajax({ 
				method: "get",url: uvmAdmin.ajaxServer,data: "url="+url, 
		//beforeSend: function(){$("#loading").show("fast");}, //show loading just when link is clicked 
		//complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete 
				success: function(r){ //so, if data is retrieved, store it in html 
				(r==1)?$(cHlaska).removeClass("red"):$(cHlaska).addClass("red");
				} 
			}); //close $.ajax
		}; 
		$(cNazev).blur(function(){cUrlDotaz()});
		$(cUrl).blur(function(){cUrlDotaz()});


//nápad, server pošle návrhy coolUrl
		$.ajax({ 
			method: "get",url: uvmAdmin.ajaxServer,data: "seznam", 
			//beforeSend: function(){$("#loading").show("fast");}, //show loading just when link is clicked 
			//complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete 
			success: function(p){ //so, if data is retrieved, store it in html 
				$("#seznam").text(p);} 
		}); //close $.ajax
}
	
};

uvmAdmin.nested = {
		el : "",
		parent:"",
		oldParent:"",
		ini : function() { 
			uvmAdmin.nested.el = this.id;			
			uvmAdmin.nested.oldParent = uvmAdmin.nested.getParents();
		},	
		getParents : function() { 
			var el = $("#"+uvmAdmin.nested.el);
			var parent = el.parents("li").eq(0).attr("id");
			
			return (parent == undefined)?el.parents("ul").eq(0).attr("id"):parent;
		},		
		update : function(type) { 
			
			uvmAdmin.nested.parent = uvmAdmin.nested.getParents();
			
			switch (type){
				case "tree": {
					
					if ( $("#"+uvmAdmin.nested.parent).children(".treeview-change").length == 0 && !$("#"+uvmAdmin.nested.parent).is("ul") ){
						uvmAdmin.tree.addBranch("#"+uvmAdmin.nested.parent);
						$("#"+uvmAdmin.nested.parent).find(".admin-btns-delete").eq(0).toggleClass("admin-btns-delete").toggleClass("admin-btns-delete-disabled").attr("href","/structure_nodes#");					
				
					}	
					
					$(".treeview-plus").parent().children("ul").hide(); 
					
					if ( $("#"+uvmAdmin.nested.oldParent).find("li").length == 0 && !$("#"+uvmAdmin.nested.oldParent).is("ul") ){
						$("#"+uvmAdmin.nested.oldParent).children(".treeview-change").remove();
						$("#"+uvmAdmin.nested.oldParent).find(".admin-btns-delete-disabled").eq(0).toggleClass("admin-btns-delete").toggleClass("admin-btns-delete-disabled").attr("href","/structure_nodes/id:"+$("#"+uvmAdmin.nested.oldParent).attr("id").split("_")[1]+"/case:delete/");				
				
					}					
					break;
				}	
				case "menu": {

/*					if ( $("#"+uvmAdmin.nested.parent).find("li").length < 1 && !$("#"+uvmAdmin.nested.parent).is("ul") ){
	

						$("#"+uvmAdmin.nested.parent).parent().attr("id","st_"+uvmAdmin.nested.parent);
	
						var ultags=document.getElementById("st_"+uvmAdmin.nested.parent).getElementsByTagName("ul")
					    for (var t=0; t<ultags.length; t++){
					    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
				    		ultags[t].innerHTML +='<li class="suckertree_separator"></li>';
							if (ultags[t].parentNode.parentNode.id==menuids[i]) { //if this is a first level submenu
								ultags[t].style.left=(ultags[t].parentNode.offsetWidth+5)+"px" //dynamically position first level submenus to be width of main menu item
					    	}else{ //else if this is a sub level submenu (ul)
							    ultags[t].style.left=(ultags[t-1].getElementsByTagName("a")[0].offsetWidth+10)+"px" //position menu to the right of menu item that activated it
					    	}
						    ultags[t].parentNode.onmouseover=function(){
						    	this.getElementsByTagName("ul")[0].style.display="block"
						    }
						    ultags[t].parentNode.onmouseout=function(){
						    	this.getElementsByTagName("ul")[0].style.display="none"
						    }
					    }
						for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
						ultags[t].style.visibility="visible"
						ultags[t].style.display="none"
						}
					
					}	*/	
					
					break;
				}				
			}	
			
			
			var childs = ($("#"+uvmAdmin.nested.parent).is("ul"))?$("#"+uvmAdmin.nested.parent).children("li"):$("#"+uvmAdmin.nested.parent).children("ul").children("li");
					
			var sendData = "id="+uvmAdmin.nested.el.split("_")[1]+"&parent="+uvmAdmin.nested.parent.split("_")[1]+"&childs="+childs.eq(0).attr("id").split("_")[1];	
			
			for (var i = 1; i < childs.length; i++){
				sendData += ":"+childs.eq(i).attr("id").split("_")[1];				
			}
			$.jGrowl("Odesílám data pro nové seřazení menu.");
			$.ajax({
				   type: "POST",
				   url: "/ajax/case:nodeMoveSort",
				   data: sendData,
				   dataType: "json",
				   success: function(data){
						$.jGrowl("Přerovnání uloženo.");
						if(typeof(data.error) != 'undefined')
						{
							if(data.error != '')
							{														
								uvmAdmin.infoDialog(data.error);
							}	
						}
				   },
				   error: function (data, status, e){
						alert( "Chyba, nepodařilo se přemístit uzel.\n"+"Element:"+uvmAdmin.nested.el+"; old parent:"+uvmAdmin.nested.oldParent+"; new parent:"+uvmAdmin.nested.parent+";poc:"+childs.length+"\n"+sendData); 
				   }
			});
					
	 	}
};

uvmAdmin.tree = {
		
		init : function(e){
	
			$(e).find("li.treeview-expandable").prepend('<div class="treeview-change treeview-plus">&nbsp</div>');
			$(e).find("li.treeview-collapsable").prepend('<div class="treeview-change treeview-minus">&nbsp</div>');
			
			
			$(e).find(".treeview-change").click(function () { 
					$(this).toggleClass("treeview-plus");
					$(this).toggleClass("treeview-minus");	
					$(this).parent().children("ul").toggle(); 
		    });
			
		},
		
		addBranch : function(e){
	
			$(e).prepend('<div class="treeview-change treeview-minus">&nbsp</div>');
			$(e).find(".treeview-change").click(function () { 
					$(this).toggleClass("treeview-plus");
					$(this).toggleClass("treeview-minus");	
					$(this).parent().children("ul").toggle(); 
		    });
			
		}
	};


uvmAdmin.test = {
		
	init : function(){		
	
		if (uvmAdmin.testing) {
			$.jGrowl("Aktivován test 2.");
			uvmAdmin.testing2=true
		}else{
			$.jGrowl("Aktivován test 1.");
			uvmAdmin.testing = true;
		}
		/*if ( $('#fTestMenu').index(this) === -1 ){
			alert($('#fTestMenu').index(this));
			$('body').prepend("<div id='fTestMenu' class='menu' style='position:absolute;top:0px;left:0px;with:250px;height:200px;color:white;z-index:10000;'>test_test</div>");
		}*/

	},		
	noJsLinks : function(){		
		
		if (uvmAdmin.testing){
			$.jGrowl("Deaktivován noJS-links režim.");
			uvmAdmin.testing = false;
			
			$('a').unbind('click', uvmAdmin.test.aRedir);
		
		}else{
			$.jGrowl("Aktivován noJS-links režim.");
			uvmAdmin.testing = true;
			
			$('a').bind('click', uvmAdmin.test.aRedir);
			
		}

	},
	
	aRedir : function() { 
		if (confirm("Opravdu přejít v testovacím režimu (F10)?")) { 
				location = this.href;
		}

	}
};

