$(document).ready(function(){

	/*$('.item .details .full_text').hide();*/

/*	$('.item .details .short_text').slideToggle('slow');
	$('.item .details .full_text').slideToggle('slow');
*/

/*	$('.item a.slide_action').click(function() {
		$(this).parent().find('.short_text').slideToggle(0);  
		$(this).parent().find('.full_text').slideToggle(0);  
		$(this).toggleClass("hide");
		return false;      
	});

	$('.item .details a.slide_action').click(function() {
		$(this).parent().parent().parent().find('.short_text').slideToggle(0);  
		$(this).parent().parent().parent().find('.full_text').slideToggle(0);  
		$(this).parent().parent().parent().parent().parent().parent().find('.btn').toggleClass("hide"); 
		return false;      
	});


	$('.module h3').click(function() {
		$(this).parent().find('.in').slideToggle(200);  
		$(this).toggleClass("hover");
		return false;      
	});
*/

	$('.slide_action').click(function() {
		$(this).parent().find('.slide_toggle').slideToggle(200);  
		return false;      
	});


	// submenu
	$('.submenu ul li').hover(
        function() {
            $(this).addClass("hover");
            $(this).find('ul').slideDown(0);
        },
        function() {
			$(this).removeClass("hover");        
            $(this).find('ul').slideUp(0);
        }
    );

	// checboxes
	$('#chek_all').click(function(){
		var checked_status = this.checked;
		$('#checkboxes input:checkbox:enabled').each(function(){
			this.checked = checked_status;
		});
	});					


	$('#show_with_img').click(function(){
		$(this).parent().parent().parent().find('a').removeClass("active");								  
		$(this).addClass("active");
		$('#with_img').show();									   
		$('#without_img').hide();
		return false;      
	});					

	$('#show_without_img').click(function(){
		$(this).parent().parent().parent().find('a').removeClass("active");								  
		$(this).addClass("active");
		$('#with_img').hide();									   
		$('#without_img').show();
		return false;      
	});					

});

	
	/*function toggleCheck1(){
		$('#checkboxes input:checkbox:enabled').each(function(){this.checked = !this.checked});
	}*/

	function deleteConfirm(mess){
		return confirm(mess);
	}

	function voteYN(cid, vote){ 
     $("#comt"+cid).fadeOut("slow");
     $.post("admin/ajax.php?do=voteRN", { id: cid, vote: vote },
          function(data){returned = data.split("||"); var prc = Number(returned[0]); prc = prc.toFixed(0);
             $("#vRate"+returned[1]){$seo_ext}(prc+"%");        
          }, "html");
    }
    
    function getComs(cid){ 
     $("#comt"+cid).fadeOut("slow");
     $.post("admin/ajax.php?do=getComs", { id: cid },
          function(data){returned = data.split("||"); var prc = returned[0]; 
             $("#cmts"+returned[1]){$seo_ext}(prc);        
             $("#cmts"+returned[1]).slideDown("normal");
          }, "html");
    }
    
    function postComment(cid){ 
     $("#cmts"+cid).fadeOut("slow"); var ct = document.getElementById("comment_text"+cid).value;  
     var fr = document.getElementById("comment_uname"+cid).value;
     $.post("admin/ajax.php?do=addCom", { id: cid, comment:ct, uname:fr },
          function(data){returned = data.split("||"); var prc = returned[0]; 
             $("#cmts"+returned[1]){$seo_ext}(prc);        
             $("#cmts"+returned[1]).slideDown("normal");
             $("#cmt"+returned[1]){$seo_ext}("Comments("+returned[2]+")");
          }, "html");
    }
