function rows(bucket)
	{
	var use_bucket='';
	if (bucket) { use_bucket='&bucket='+bucket; }

	window.location="index.php?task=signup_model&rows="+$F($('rows'))+use_bucket;
	}
	
function rows_contestant()
	{
	window.location="index.php?task=contestant_edit&rows="+$F($('rows'));
	}

function rows_signup_join_edit(bucket, photog_id)
	{
	var use_bucket='';
	if (bucket) { use_bucket='&bucket='+bucket; }

	window.location="index.php?task=signup_join_edit&rows="+$F($('rows'))+use_bucket+'&photog_id='+photog_id;
	}

function rows_photog(bucket)
	{
	var use_bucket='';
	if (bucket) { use_bucket='&bucket='+bucket; }
	window.location="index.php?task=signup_photog&rows="+$F($('rows'))+use_bucket;
	}

function rate_change(who, what, where)
	{
	id=who+'_rating';
	window.location='index.php?task=signup_'+what+'_edit&tab=contact&'+what+'_id='+where+'&'+id+'='+$F(id);
	}

// toggles button backgrounds
function h(which) 
	{ 
	which.style.backgroundColor="#e0e2e6"; 
	}

function l(which) { which.style.backgroundColor="#FAFAFA"; }


function photo_queue(img_type, img_name)
	{
	$(img_type).value=img_name;
	}

function delete_item(url, query, confirm_message)
	{
	if (confirm(confirm_message))
		{
		window.location=url+query;
		}

	return false;
	}

function follow_option(use)
	{
	if (use.value!='') 
		{
		window.location=use.value;
		}
	}

function change_approved_status(use, use_id)
	{
	var owns=$F(use);

	//owns=(owns=='Yes')?'No':'Yes';

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_photog&approved='+owns+'&photog_id='+use_id
	, onSuccess: function (t) { alert('The photog was updated successfully!'); }
	});
	}

function change_owns_status(use, use_id, photog_id)
	{
	var owns=$F(use);

	//owns=(owns=='Yes')?'No':'Yes';

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_model&owns_lsw='+owns+'&model_id='+use_id+'&photog_id='+photog_id
	, onSuccess: function (t) { alert('The model was updated successfully!'); }
	});
	}

function change_status(use, use_id, photog_id)
	{
	var use_status=$F(use);

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_model&status='+use_status+'&model_id='+use_id+'&photog_id='+photog_id
	, onSuccess: function (t) { alert('The model was updated successfully!'); }
	});
	}

function change_completed(use, model_id)
	{
	var use=$F(use);

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_join_edit&complete='+use+'&model_id='+model_id
	, onSuccess: function (t) {  alert('The record was updated successfully!'); }
	});
	}

function change_shoot_completed(use, model_id, photog_id)
	{
	var use=$F(use);

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_join_edit&shoot_completed='+use+'&model_id='+model_id+'&photog_id='+photog_id
	, onSuccess: function (t) { alert('The record was updated successfully!'); }
	});
	}

function process_next(contestant_id, round_id, photo_id)
	{
	new Ajax.Updater('update_container', 'index.php?c=contestant_lightbox&lbm=1&contestant_id='+contestant_id+'&round_id='+round_id+'&photo_id='+photo_id, {
	evalScripts: true,
	method: 'POST'
	});
	}

function countdown(round_id)
	{
	new Ajax.PeriodicalUpdater('countdown', 'index.php?c=countdown&ajax_mode=1&round_id='+round_id, {asynchronous:true, frequency:60,
	evalScripts: true,
	method: 'POST'
	});
	}

function pop_up(URL, popup_width, popup_height) 
	{

	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+popup_width+',height='+popup_height+'');");
	}

function toggle_model_tab(tab, hide_errors)
	{
	$('general').hide();
	$('contact').hide();
	$('personal').hide();
	$('photos').hide();
	if (hide_errors&&$$('div.error_wrapper')[0]) 
		{ 
		$$('div.error_wrapper')[0].remove(); 
		}

	$(tab).show();
	}

function toggle_join_tab(tab, hide_errors)
	{
	$('find').hide();
	$('assigned').hide();
	if (hide_errors&&$$('div.error_wrapper')[0]) 
		{ 
		$$('div.error_wrapper')[0].remove(); 
		}

	$(tab).show();
	}
 
function toggle_over_due_tab(tab, hide_errors)
	{
	$('not_accepted').hide();
	$('accepted').hide();
	$('shoot_date').hide();
	if (hide_errors&&$$('div.error_wrapper')[0]) 
		{ 
		$$('div.error_wrapper')[0].remove(); 
		}

	$(tab).show();
	}

function toggle_photog_tab(tab, hide_errors)
	{
	$('general').hide();
	$('contact').hide();
	$('photos').hide();
	if (hide_errors&&$$('div.error_wrapper')[0]) 
		{ 
		$$('div.error_wrapper')[0].remove(); 
		}

	$(tab).show();
	}

function build_link_preview()
	{
	new Ajax.Updater('link_preview', 'index.php?task=contestant_round_photos&suit_id='+$F($('suit')), {
	evalScripts: true,
	method: 'POST'
	});
	}

function select_model(contestant_id) { $('contestant_id').value=contestant_id; }

function process_images_model_source()
	{
	if ($F($('choose_source'))=='search')
		{
		$('contestant_full_name').hide();
		$('contestant_name').hide();
		$('search').show();
		}
	else
		{
		$('search').hide();
		$('contestant_full_name').show();
		$('contestant_name').show();
		}
	}

function suits_mailed_filter_by_photog()
	{
	window.location="index.php?task=photog_suits_mailed&photog_id="+$F($('photog_id'));
	}

function go_left()
	{
	if ($('row_0')!='null') { $('row_0').show(); }
	if ($('row_1')!='null') { $('row_1').show(); }
	if ($('row_2')!='null') { $('row_2').show(); }
	if ($('row_3')!='null') { $('row_3').hide(); }
	if ($('row_4')!='null') { $('row_4').hide(); }
	if ($('row_5')!='null') { $('row_5').hide(); }
	}

function go_right()
	{
	if ($('row_0')!='null') { $('row_0').hide(); }
	if ($('row_1')!='null') { $('row_1').hide(); }
	if ($('row_2')!='null') { $('row_2').hide(); }
	if ($('row_3')!='null') { $('row_3').show(); }
	if ($('row_4')!='null') { $('row_4').show(); }
	if ($('row_5')!='null') { $('row_5').show(); }
	}
