function date_check() {
  if ($F('show[started_on]') != 'mm/dd/yyyy' || $F('show[ended_on]') != 'mm/dd/yyyy') {
    $('all_dates_all_dates').checked = false;
  }
}

function initPR(){
	// keep heights same for showtype breakdown and notes
	var el1 = $('sbkdwn_table');
	var el2 = $('notes_div');
	if(el1.offsetHeight>el2.offsetHeight){
		el2.style.height = el1.offsetHeight+"px";
	}else{
		el1.style.height = el2.offsetHeight+"px";
	}
	//
	var graph_el1 = $('divisional_graph');
	var graph_el2 = $('placing_container');
	var graph_el1_yspacer = 70;
	var graph_el2_yspacer = 0;
	if(graph_el1.offsetHeight>graph_el2.offsetHeight){
		$('arena_perf_stats').style.height = (graph_el1.offsetHeight+graph_el1_yspacer)+"px";
	}else{
		$('arena_perf_stats').style.height = (graph_el2.offsetHeight)+"px";
	}
}

	var popup;
function ajax_dropdown(url, options) {
  options = $H({window: true, title: '', width: 400, height: 400, indicator: 'indicator', confirm: null}).merge(options).toObject();
	
			if(options.confirm == null || (options.confirm && confirm(options.confirm))){
			  if (options.window) {
			    if (popup) { popup.close(); };
				  popup = new Window({className: 'tmh',
                            title: options.title,
                            width: options.width,
                            height: options.height,
                            destroyOnClose: true,
                            minimizable: false,
                            maximizable: false,
                            showEffectOptions: {duration: 0.5}});
        popup.setAjaxContent(url,
                             {parameters: options.parameters,
                              asynchronous:true, evalScripts:true, 
					                      onComplete: function(request){Element.hide(options.indicator);}, 
					                      onLoading:function(request){Element.show(options.indicator);}});
			    popup.setZIndex(25000);
				  popup.showCenter();
				} else {
				  new Ajax.Request(url,
                         {parameters: options.parameters,
                          asynchronous:true, evalScripts:true, 
					                  onComplete: function(request){Element.hide(options.indicator);}, 
					                  onLoading:function(request){Element.show(options.indicator);}});
				}
				return false;
	    }
	  
	}
