$(document).ready(function(){
$(".upload_colorbox").colorbox({width:"600px", height:"95%", iframe:true});
$("a[rel='artist_works']").colorbox({transition:"fade"});
	peps.rollover.init(); 

	$("#featured_title").css("opacity", "0.75");

    
	$('#maincarousel').infiniteCarousel({
		displayTime: 6000,
		displayThumbnails: false,
		displayProgressBar: false,
		easeLeft: 'easeInOutExpo',
		textholderHeight : .10
	});
	
	$('#news_slide').infiniteCarousel({
		displayTime: 9000,
		displayThumbnails: true,
		displayProgressBar: true,
		easeLeft: 'easeInOutBack',
		easeRight:'easeOutBack',
		textholderHeight : .13
	});

// LOGIN FUNC
$("input#name.cleardefault").focus(function () {
	$(this).css( "color", "#FFF" );
	$(this).attr("value", "");
	return true;
});


$("input#name.cleardefault").blur(function() {
	$(this).css('color', '#969696');
	var value = $(this).attr("value");
	
	   			if (this.value == '') {
        			$(this).attr("value", "username");
      			}	

	return true;
});

$("input#password.cleardefault").focus(function () {
	$(this).css( "color", "#FFF" );
	$(this).attr("value", "");
	return true;
});


$("input#password.cleardefault").blur(function() {
	$(this).css('color', '#969696');
	var value = $(this).attr("value");
	
	   			if (this.value == '') {
        			$(this).attr("value", "Password");
      			}	

	return true;
});

  


 $('div#featured').hover(function(){
	 $("span.featured_text", this).stop().animate({bottom:'0px',opacity:'0.75'},{queue:false,duration:300});
	 }, function() {
	 $("span.featured_text", this).stop().animate({bottom:'-100px'},{queue:false,duration:600});
 }); 
 
 
 $('div#featured_thumbs li').hover(function(){
		 $(this).css("border","7px solid #B99A2D");
	 }, function() {
		 $(this).css("border","7px solid #333333");
 });
 
  $('div.festival-post').hover(function(){
		 $(this).css("backgroundColor","#202020");
	 }, function() {
		 $(this).css("backgroundColor","#161616");
 });
 
 $('table#eventstable tbody tr').hover(function(){
		 $(this).children().css('background-color', '#201D12');
	 }, function() {
		 $(this).children().css('background-color', '#000000');
		 $(this).find('td#pickup2').css('background-color', '#201D12');
 });




});

// PEPS

peps = {};
peps.rollover = {
 init: function() {
 this.preload();
 $(".roll").hover(
 function () { $(this).attr( 'src', peps.rollover.newimage($(this).attr('src')) ); },
 function () { $(this).attr( 'src', peps.rollover.oldimage($(this).attr('src')) ); }
 );
 },
 preload: function(){
 $(window).bind('load', function() {
 $('.roll').each( function( key, elm ) { $('<img>').attr( 'src', peps.rollover.newimage( $(this).attr('src') ) ); });
 });
 },
 newimage: function( src ) {
 return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_hover' + src.match(/(\.[a-z]+)$/)[0];
 },
 oldimage: function( src ){
 return src.replace(/_hover\./, '.');
 }
 }; 
