$(document).ready(function(){

$('#client_login').hide();

//find all form with class jqtransform and apply the plugin
    $("form#contact_form").jqTransform();
//
 

$('#profile_link').click(function(){
                
    $('#client_login').slideToggle('slow');
	return false;
});	



if ( $('img.caption').length > 0 ){
	
       $('img.caption').each(function(){
 	          $(this).wrap('<div class="cap_pic"></div>');
              $(this).css({'border':'0px solid #fff'});
                var caption = $(this).attr('rel');
                var width = $(this).attr('width');

       $(this).after('<br /><p style="width:'+ width +'px">' + caption + '</p>').end();
});

}

// add borders to images

        $('.post img').css('border','thin solid #cccccc');
        $('.post img').css('padding','5px');
        $('body.home .post img').css('border','thin solid #cccccc');
		$('body.home .post img').css('padding','5px');
		$('body.more .post img').css('border','thin solid #cccccc');
		$('body.more .post img').css('padding','5px');
		
		$('body.results .post img').css('border','thin solid #cccccc');
		$('body.results .post img').css('padding','5px');

        $('body.articles .post img').css('border','thin solid #cccccc');
		$('body.articles .post img').css('padding','5px');

        $('body.categories .post img').css('border','thin solid #cccccc');
		$('body.categories .post img').css('padding','5px');

        $('body.archives .post img').css('border','thin solid #cccccc');
		$('body.archives .post img').css('padding','5px');

       
			 $('body.home .post img.caption').css({'border':'0px solid #fff'});
			  $('body.more .post img.caption').css({'border':'0px solid #fff'});
			 

	$('#member_tab').click(function(){
		$(this).next('ul').slideToggle();
		$(this).toggleClass('arrow_on');

});

 /* 
 i think this was for the welcome /tip of day thing
 $('body.home .welcome').find('a').click(function(){   
 	    $(this).parent().slideUp('fast');            
 	      return false;
}); 
*/
//hide sidebar navs

$('#sidebar h3').click(function(){
	$(this).next('ul').slideToggle();
        $(this).toggleClass('arrow_on');
        return false;
});



$('#featured_cont').after('<div id="nav">').cycle({ 
    fx:     'fade', 
    speed:   'fast', 
    timeout: 5000,
    pager:'#nav',
    pause: 1
   // after:afterOn
    
});

$('#featured_cont').css({'cursor':'pointer'});
$('#featured_cont img').click(function(){
	window.location=$(this).attr('rel');
         return false;

});


$('#nav a').each(function(){
	var str = $(this).text();
        //var bac = 'url(http://www.shiftdrink.com/images/thumbs/' + str +'.jpg '
    $(this).css({'text-indent':'-5555em'});
    /*$(this).css({'background':'url(http://www.shiftdrink.com/images/thumbs/' + str  +'.jpg) no-repeat 4px 4px'});*/
    
});
$('#nav a').eq(0).addClass("first");
$('#nav a').eq(1).addClass("second");
$('#nav a').eq(2).addClass("third");
/* brute force here we go 
	
*/
$('#comment_form .required').hide();

});
