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_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)
	{
	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
	, onSuccess: function (t) { alert('The model was updated successfully!'); }
	});
	}

function change_status(use, use_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
	, onSuccess: function (t) { alert('The model was updated successfully!'); }
	});
	}

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

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=signup_join_edit&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();
	}