function quickMenu( )
{
	element = document.getElementById('quickMenu');
	if ( !element ) return false;

	switch ( element.value )
	{
		case '1': window.location = root + "company/"+userCompany+"/add/car"; break;
		case '2': window.location = root + "company/"+userCompany+"/add/order"; break;
		case '3': window.location = root + "profile"; break;
		case '4': window.location = root + "profile/show/notifiers"; break;
		case '5': window.location = root + "profile/show/favorites"; break;
		case '6': window.location = root + "company/"+userCompany+"/show/cars"; break;
		case '7': window.location = root + "company/"+userCompany+"/show/orders"; break;
		case '8': window.location = root + "company/"+userCompany+"/show/offers"; break;
	}
}

function changeDestination( from )
{
	$('#AvailableCarsCityToId').val(from.value);
	$('#NeededCarsCityToId').val(from.value);
}

function specifierClick( element )
{
	if ( element.value == "Tarkenne" ) element.value = "";
}

function showItem( companyid, type, id )
{
	window.location = root + 'company/' + companyid + '/show/' + type + '/' + id;
}

function clearContactTextbox( element )
{
	var cleared = document.getElementById('ContactCleared');
	if ( cleared && cleared.value == 0 )
	{
		element.value = "";
		cleared.value = 1;
	}
}

function confirmDelete( items )
{
	return confirm('Tarjouspyynnön poistamisesta lähtee sähköpostilla tieto siihen vastanneille liikennöitsijöille.\nHaluatko varmasti poistaa tarjouspyynnön pysyvästi?');
}

function confirmDelete2( textstring )
{
	return confirm('Haluatko varmasti poistaa '+ textstring +' pysyvästi?');
}

function toggleEndDate()
{

	if(document.getElementById('rowEndDate1').style.display != 'none')
	{
		document.getElementById('rowEndDate1').style.display = 'none';
		document.getElementById('rowEndDate2').style.display = 'none';
		document.getElementById('rowEndDate3').style.display = 'none';
	}
	else
	{
		document.getElementById('rowEndDate1').style.display = 'table-row';
		document.getElementById('rowEndDate2').style.display = 'table-row';
		document.getElementById('rowEndDate3').style.display = 'table-row';
	}
}
