// kyjaro/js/default.js
	$(document).ready(function(){
		//sets default method to post
		$.ajaxSetup({
			type: "POST",
			mode: "queue",
			chase: "false",  
			error: function (XMLHttpRequest, textStatus, errorThrown) {
				alert( "AJAX Error: " + textStatus + "(" + errorThrown + ")" );
			}
		});
menuSlider.init('menu_ul','slide');







		$("#message").show("slow");



		//removes warning about disabled javascript
		$('#no_javascript').remove();

		//shows error and query data by loading debug.php inside #debug
		$("#debug_on").live("click", function(){
			$.ajax({
				url: "/system/debug.php",
				success: function(msg,text){
					$("#debug").html(msg);
				}
			});
		});

		//clears #debug data off the screen
		$("#debug_off").live("click", function(){
			$("#debug").html("");
		});

		//delete all #debug data from session
		$("#debug_del").live("click", function(){
			$.ajax({
				url: "/system/debug.php",
				data:"delete=1",
				success: function(){
					$("#debug").html("");
				}
			});
		});

		//delete session
		$("#session_del").live("click", function(){
			$.ajax({
				url: "/system/debug.php",
				data:"delete=2",
				success: function(){
					window.location.reload(true);
				}
			});
		});
		
		//allows to close the message
		$("#msg_close").live("click", function(){
			$("#message").hide("slow").html("");
		});


		$("img.debug_show").live("click", function(){
			var title = this.title; 
			trg=title.substring(5);

			$.ajax({
				url: "/system/ajax.php",
				data: 'action=debug_show&data='+trg,
				success: function(ret){
					$("div#X_" + trg).html(ret);
				}
			});
		});

		$("img.debug_hide").live("click", function(){
			var title = this.title; 
			trg=title.substring(5);
			$.ajax({
				url: "/system/ajax.php",
				data: 'action=debug_hide&data='+trg,
				success: function(ret){
					$("div#X_" + trg).html(ret);
				}
			});
		});
	
		/*$("ul.menu li a").live("click", function(){
			var id = this.id;
			var i = id.substring(id,1,1);
			n = this.name;
			name=n.replace(/:/g,'/');
			
			var data = "action=nav&data=" + id;
			$.ajax({
				url: "/system/ajax.php",
				data: data,
				success: function(){
					
					
				}
			});
			
		});*/
	
		$("ul.lang li a").live("click", function(){
			var id = this.id; 
			$.ajax({
				url: "/system/ajax.php",
				data: 'action=lang&data=' + id,
				success: function(){
					window.location.reload(true);
				}
			});
		});
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	});
