//Test functions for jquery Tools
var j = jQuery.noConflict();

    var the_image = "#show_page p img"
    var image_block = "#image_block img"
    var p_without_class = "#show_page p:not(.float_to_right)"
    var showimage = "p.downsize img"
    var youtube_vids = "#youtube #video object"
    var for_ffox = "#video object embed"

  
function remove_h_w(params) {
   j(params).removeAttr("height");
   j(params).removeAttr("width");
}

j(document).ready(function(){
  
    j('ul.admin_data li:first').addClass('admin_li_first');

    j(the_image)
       .addClass('show_page_images');
    
    j(image_block)
      .addClass('show_page_images');
      
    j("p:has(img)")
    .addClass("float_to_right");

    remove_h_w(showimage);
    remove_h_w(youtube_vids);
    remove_h_w(for_ffox);

  j("#show_page p")
    .removeAttr("style");
  
  j("#right_ads p img").
    removeAttr("style");
    
  j(p_without_class).filter(function() {
      return $.trim($(this).text()) === ''
  }).remove();

/*===================== for ckeditor =====================*/
  
  j(function() {
     if (j('textarea').length > 0) {       
          var data = j('textarea.no_html');
          
          $.each(data, function(i) { 
            CKEDITOR.replace(data[i].id);
          }
        );
     }
  });
  
/*
    j('#tweetlist').fancybox({
      frameHeight : 600
    });
*/
    j('#emailcontact').fancybox({
      'frameHeight' : 500,
      'enableEscapeButton': true,
      'hideOnContentClick': false,
      //'hideOnOverlayClick': false,
      'centerOnScroll': true
      
    });
    
    j('#tweetlist').pageSlide({  
        width: '350px',
        modal:true,
        direction: 'right'
        });
    
    j('a#single_image').fancybox();
    
    
/*
  j('#remove_editor').click(
    function() {
      j(editor).addClass("want_html");
    });
    
  
  j('#add_editor').click(
    function() {
      j(editor).addClass("no_html")
  });
*/
    
/*
  Some sort of listener.
  I need a link that will listen to clicks
  
  function to find textarea with the no_html class on the page
  function will
    keep "no_html" class as the default
    on click remove the no_html class from the textarea tag
  
  function 2
    will add the "no_html" class back to the textarea tag on the page
*/

});
