/**** Add application wide javascripts below this point  ******/
primary_backgrounds = [];
//background swapping on home page
function home_page_backgrounds(backgrounds, prefix, size){
  if(typeof(backgrounds) != undefined && backgrounds.length){
    for(var div_id in backgrounds){
      if(!size) jQuery('#'+prefix+div_id).css('background', "url('"+backgrounds[div_id]+"') no-repeat top left");
      else jQuery('#'+prefix+div_id).css('background', "url('/show_image/"+backgrounds[div_id]+"/"+size+".jpg') no-repeat top left");
    }
  }
}

jQuery(document).ready(function(){
  if(jQuery('#main_features').length){
    jQuery('#main_features').switcher({item:'.feature', pagination:'#feature_nav_list', auto_rotate:true, pagination_active_class:'ui-tabs-selected', rotate_time:5000});
    home_page_backgrounds(primary_backgrounds, 'feature', false);
  }

	//jQuery('#submission_dialog').dialog({autoOpen:true,modal:true, title:"The B-Hive 2010 briefs aren't quite ready."});
	//jQuery('#submission_onclick_dialog').dialog({autoOpen:false,modal:true, title:"The B-Hive 2010 briefs aren't quite ready."});
	
	// jQuery('a.brief_link').click(function(){
	//  jQuery('#submission_onclick_dialog').dialog('open');
	// 	return false;
	// });
});
