$(document).ready(function(){  	
	
	$("#ajax_is_loading").ajaxStart(function(){ $.blockUI({message: ''}); $(this).show(); }) .ajaxStop(function(){ $.unblockUI(); $(this).hide(); });	
	
	//$('#idMenuFoto').click(function(){ $.ajax({ url: "index2.php?action=showfoto", cache: false, success: function(html){ $("#content").html(html); }});});
	
	$('#idMenu111').click(function(){ alert( $('#idMenu111').attr('href')); });
	
// END $(document).ready(function()
});	

function loadHTML(url, divContent){
	//alert(url);
	
	$.ajax({ url: url, cache: false, success: function(html){ $("#"+divContent).html(html); }});
		
	
}

function postHTML(getParams, postParams, divContent){

	var json_postParams = eval( '(' + postParams + ')' );
	$.post("/admin/ajax-actions.php?"+getParams, json_postParams, function(html){ $("#"+divContent).html(html); });		      

}

function post_data(getParams, postParams){

	var json_postParams = eval( '(' + postParams + ')' );
	//alert(postParams);
	$.post("/admin/ajax-actions.php?"+getParams, json_postParams, function(html){ window.location.reload(true); });

}

function post_data_alert(url, postParams){

	var json_postParams = eval( '(' + postParams + ')' );
	//alert(postParams);
	$.post(url, json_postParams, function(html){ alert(html); window.location.reload(true); });

}

function showEditForm(getParams, postParams, divContent){
	//alert(url);
	$("#"+divContent).empty();
	$("#"+divContent).show();
	//$.ajax({ url: url, cache: false, success: function(html){ $("#"+divContent).html(html); }});
	var json_postParams = eval( '(' + postParams + ')' );
	$.post("/admin/ajax-actions.php?"+getParams, json_postParams, function(html){ $("#"+divContent).html(html); });
	
}

function hideEditForm(divContent){
	//alert(url);
	
	$("#"+divContent).hide();
	
}

function postEditForm(getParams, form, divContent){
  //alert('getParams: '+getParams + '; form_id: '+ form);
  var qString = $("#"+form).formSerialize();
  //alert(qString);
  $.post("/admin/ajax-actions.php?"+getParams, qString, function(html){ $("#"+divContent).html(html); });

}

function selectAll(form) {

	if (form.all.checked == true){ check = true; } else { check = false; }
	
	for (var i = 0; i < form.length; i++){
		var checkbox = form.elements[i];

	if (checkbox.type == 'checkbox' && checkbox.name != 'all') 	checkbox.checked = check;
	}
}

function show_hide_filter(class_divs, div_name){
	
	//$('div.'+class_divs).hide();
	if ($("#"+div_name).is(":visible")){
		
		$("#"+div_name).hide("normal");
		
	}else{
		
		$("#"+div_name).show("normal");
		
	}
	
}

function show_hide(class_divs, div_name){
	
	$('div.'+class_divs).hide();
	$("#"+div_name).show("normal");
	
}

function show_hide_div(div_name, status){
	
	if (status == 1){
		
		$("#"+div_name).show("normal");
		
	}else{
		
		$("#"+div_name).hide("normal");
		
	}
	
}
