//
// $Id: $
//
window.addEvent('domready', function() {
  var search = new Fx.Slide( 'search_form', {duration: 500});
  search.hide();
  $('search').addEvent('click', function() {
    search.toggle();
  });

 
  // if ( window.location.href.split("#").last() ) {
  //   var e = window.location.href.split("#").last();
  //   if( e && $(e) ) {
  //     var scroll = new Fx.Scroll(window);
  //     scroll.toElement(e);
  //   }
  // }

  $('search_input_field').addEvent('focus', function() {
    if(this.value.test("Search Articles")) {
      this.value = '';
    }
  });
  $('search_input_field').addEvent('blur', function() {
    if(this.value == '') { 
      this.value = 'Search Articles...';
    }
  });
  if($('cpreview')) {
    var wp = new Fx.Scroll(window);
    wp.toElement($('cpreview'));
    var fx = new Fx.Style('cpreview', 'opacity', { duration: 1500, 
    	transition: Fx.Transitions.Quart.easeInOut
    });
    fx.start(0,1);
  }
  if( $E('ul.comments_error') ) { 
    var fxr= new Fx.Style($E('ul.comments_error'), 'padding');
    fxr.start(0, 20);
  }

  if( $E('p#txpCommentInputForm') ) {
    var fxr= new Fx.Style($E('p#txpCommentInputForm'), 'padding');
    fxr.start(0, 20);
  }

  if( $('contact_error') ) {
    $('contact_error').injectBefore( $('contact_error').getPrevious() );
    var fxr= new Fx.Style($('contact_error'), 'padding');
    fxr.start(0, 20);
  }

});

