$(document).ready(function(){
         $(":radio:eq(1)").click(function(){
             $("#smtp").show();
			 $("#php_mail").hide();
          });

          $(":radio:eq(0)").click(function(){
             $("#smtp").hide();
			 $("#php_mail").show();
          });

  });

  
// drag and drop sort slider items
$(document).ready(function(){ 
	$(function() {
		$("#sort_slider ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&action=sort_slider'; 
			$.post("ajax.php", order, function(theResponse){
			}); 															 
		}								  
		});
	});
});
  
// ajax delete avatar image
$(function() {
$(".delete_avatar").click(function() {
var dataString = 'action=delete_avatar';
var parent = $(this);
$(this).fadeIn(2000).html('<img src="images/loading.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "ajax.php",
   data: dataString,
   dataType: "html",
   cache: false,
   success: function(data)
   {
	$("#avatar").hide();
	document.location.href='avatar.php';
  }  
  });  
});
});

// ajax delete banner image
$(function() {
$(".delete_banner").click(function() {
var dataString = 'action=delete_banner';
var parent = $(this);
$(this).fadeIn(2000).html('<img src="images/loading.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "ajax.php",
   data: dataString,
   dataType: "html",
   cache: false,
   success: function(data)
   {
	$("#banner").hide();
	document.location.href='avatar.php';
  }  
  });  
});
});

jQuery(document).ready(function() {
            jQuery(".keywords").tagEditor(
            {
                separator: ',',
				completeOnSeparator: true,
				imageTag: true,
                completeOnBlur: true
            });
        });
		
gvChartInit();
		jQuery(document).ready(function(){
			jQuery('#analytics').gvChart({
				chartType: 'LineChart',
				gvSettings: {
					hAxis: {title: 'Days'},
					backgroundColor: '#F5F5F5',
					width: 738,
					height: 300,
					chartArea:{left:40,top:40,width:"738px",height:"300px"}
					}
			});
		});
		
		jQuery(document).ready(function(){
			jQuery('#envato').gvChart({
				chartType: 'ColumnChart',
				gvSettings: {
					hAxis: {title: 'Months'},
					backgroundColor: '#F5F5F5',
					width: 738,
					height: 300,
					chartArea:{left:40,top:40,width:"738px",height:"300px"}
					}
			});
		});