/* This library contains "jQuery Corners 0.3", the "head" javascript for the corners, and searchfield text prompt code */

/* Normally in the "head" tag, moved here for efficiency */

/*======== prettyPhoto gallery ========*/
jQuery(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'normal', /* fast/slow/normal */
		slideshow: 3800, 
		autoplay_slideshow: false, /* true/false */
		overlay_gallery: true,
		show_title: true,
		theme: 'facebook',
	});

/*======== search field prompt text ========*/
  jQuery('input[type=text][title],input[type=password][title],textarea[title]').each(function(i){
    $(this).addClass('input-prompt-' + i);
    var promptSpan = $('<span class="input-prompt"/>');
    $(promptSpan).attr('id', 'input-prompt-' + i);
    $(promptSpan).append($(this).attr('title'));
    $(promptSpan).click(function(){
      $(this).hide();
      $('.' + $(this).attr('id')).focus();
    });
    if($(this).val() != ''){
      $(promptSpan).hide();
    }
    $(this).before(promptSpan);
    $(this).focus(function(){
      $('#input-prompt-' + i).hide();
    });
    $(this).blur(function(){
      if($(this).val() == ''){
        $('#input-prompt-' + i).show();
      }
    });
  });

/*======== Slideshow ========*/
    jQuery('#slideshow').after('<div class="progress">').cycle({
		fx: 'fade',
		slideExpr: 'div',
		sync: 1,
		speedIn: 1200,
		speedOut: 150,
		pager: '.progress',
		pause: 1,
		pauseOnPagerHover: 1,
		prev: '#prev',
		next: '#nxt',
		pagerAnchorBuilder: function(idx, showcase) { return '<a href="#">o</a>'; }
	});
});		


