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

	return false;
	}

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 resend_password()
	{
	$("login_password").hide();
	$("login_password_link").hide();
	$("back_to_login_link").show();
	$("resend_password").value='y';
	}

function back_to_login()
	{
	$("login_password").show();
	$("back_to_login_link").hide();
	$("login_password_link").show();
	$("resend_password").value='n';
	}

function toggle_tattoo(use)
	{
	if ($F(use)=='Yes')
		{
		return $('tattoos').show();
		}

	$('tattoos').hide();
	}

function toggle_state()
	{
	if ($F($('country'))=='United States')
		{
		$('state').show();
		$('no_state').hide();
		}
	else
		{
		$('state').hide();
		$('no_state').show();
		}
	}

function toggle_interested_models(use)
	{
	if ($F(use)=='Yes')
		{
		return $('interested_model_website').show();
		}

	$('interested_model_website').hide();
	}

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

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=dashboard&status='+use_status+'&shoot_id='+shoot_id
	, onSuccess: function (t) 
		{ 
		window.location="index.php?task=dashboard"; 
		}
	});
	}

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

	new Ajax.Request('index.php', {
	evalScripts: true,
	method: 'POST',
	parameters: 'task=dashboard&accepted='+accepted+'&model_id='+model_id+'&photog_id='+photog_id
	, onSuccess: function (t) 
		{ 
		window.location="index.php?task=dashboard"; 
		}
	});
	}

function toggle_tabs(tab, hide_errors)
	{
	$('home').hide();
	$('home_a').setStyle({ background: '#FFFFFF' });
	$('refer_models').hide();
	$('refer_models_a').setStyle({ background: '#FFFFFF' });
	$('shipping').hide();
	$('shipping_a').setStyle({ background: '#FFFFFF' });
	$('upload_images').hide();
	$('upload_images_a').setStyle({ background: '#FFFFFF' });
	$('contact').hide();
	$('contact_a').setStyle({ background: '#FFFFFF' });
	if (hide_errors&&$$('div.error_wrapper')[0]) 
		{ 
		$$('div.error_wrapper')[0].remove(); 
		}

	$(tab).show();
	var use_tab=tab+'_a';
	$(use_tab).setStyle({ background: '#fefae4' });
	}

function check_file_uploads()
	{
	if (!$('photo_1').value||!$('photo_2').value||!$('photo_3').value||!$('photo_4').value) 
		{ 
		alert('Please choose at least 4 images for upload to continue.'); 
		return false;
		}
	else { return true; }
	}

function add_file()
	{
	if ($('div_file_2').style.display=='none') { return $('div_file_2').show(); }
	if ($('div_file_3').style.display=='none') { return $('div_file_3').show(); }
	if ($('div_file_4').style.display=='none') { return $('div_file_4').show(); }
	if ($('div_file_5').style.display=='none') { return $('div_file_5').show(); }

	alert('Only 5 attachments are allowed at once.');
	}

function remove_file(by_id)
	{
	$(by_id).value='';
	var id='div_'+by_id;
	$(id).hide();
	}
