function menu_goto( url, locale ) {
	if ( locale ) {
	window.parent.parent.location.href = url;
	} else {
	window.location.href = url;
	}
}

function showHide(layerName) {
    document.getElementById(layerName).style.display = "none"
}



function enablebutton( buttone )
{ buttone.disabled = false; }

function disablebutton( buttond )
{ buttond.disabled = true; }


function checkNew( dropdown, id, editbox, button )
{
	if (dropdown.value != id)
	{ 
	  editbox.disabled = true; 
	  editbox.value = 'existing position';
	  button.disabled = false;
	  }
	else 
	{ 
	  editbox.value = '';
	  editbox.disabled = false;
	  button.disabled = true;
	}
}

function setcursor( field )
{
	field.focus();
}


function checkadd( type )
{
if (type.value == 'editbranch')
	{
	if (EditBranchAdd1.value != '')
		{ 
			if (EditBranchCity.value == '') window.alert('please enter a City for the branch address!');
		  	if (EditBranchCountry.value == '') window.alert('please enter a Country for the branch address!');
			if (EditBranchPostcode.value == '') window.alert('please enter a Postcode for the branch address!');
		}
	if (EditBranchPAdd1.value != '')
		{
			if (EditBranchPCity.value == '') window.alert('please enter a City for the branch postal address!');
			if (EditBranchPCountry.value == '') window.alert('please enter a Country for the branch address!');
			if (EditBranchPPostcode.value == '') window.alert('please enter a Postcode for the branch address!');
		}
	}
else
if (type.value == 'new')
	{
	if (NewBranchAdd1.value != '')
		{ 
			if (NewBranchCity.value == '') window.alert('please enter a City for the branch address!');
		  	if (NewBranchCountry.value == '') window.alert('please enter a Country for the branch address!');
			if (NewBranchPostcode.value == '') window.alert('please enter a Postcode for the branch address!');
		}
	if (NewBranchPAdd1.value != '')
		{
			if (NewBranchPCity.value == '') window.alert('please enter a City for the branch postal address!');
			if (NewBranchPCountry.value == '') window.alert('please enter a Country for the branch address!');
			if (NewBranchPPostcode.value == '') window.alert('please enter a Postcode for the branch address!');
		}
	}
}

function required( field, description, submitbuttonname)
{
	temp = Trim(field.value);
if (temp == '')
	{
		//if(submitbuttonname.disabled != true)
			//{window.alert('Please enter the ' + description + ' ');}
		submitbuttonname.disabled = true;
		return false;
	}
else {return true;}
}

function requiredopt( field1, field2, description, submitbuttonname)
{
if ((field1.value == '') && (field2.value == ''))
	{
		//if(submitbuttonname.disabled != true)
			//{window.alert('Please enter a ' + description + ' ');}
		submitbuttonname.disabled = true;
		return false;
	}
else {return true;}
}


function fillevent( textbox, text )
{
	textbox.value = text;
}

function transfer( selectbox, textbox )
{
	var b = selectbox.length;
	comma = new String();
	for(var c = 0; c < b; c++)
	{	
 	if(c == 0)
		{textbox.value = selectbox.options[c].value.toString();}
	else
		{textbox.value = textbox.value + selectbox.options[c].value.toString();}
	}
}
 

function RemoveFromList( inputname)
{

var a = inputname.length;
for(var t = 0; t < a; t++)
	{	
	if (inputname.options[t].selected) 
		{

		
		for(var d = t; d < a; d++)
			{
			if (d < (a-1))	
				{
				inputname.options[d].value = inputname.options[d+1].value;
				inputname.options[d].text = inputname.options[d+1].text;
				}
			else
				{
				inputname.options[d] = null;
				return;
				}
			
			}
		}
	}
}


function titlecheck( titlebox, otherbox,  titlevalue)
{
	if (titlebox.value == titlevalue)
		{
			otherbox.disabled = false ;
		}
	else
		{	
			otherbox.value = '' ;	
			otherbox.disabled = true ;
		}
}


function nav_bar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#329B9B';
				break;
			case 2:
				tableCellRef.style.backgroundColor = '#69c';	
				break;
			case 3:	
				tableCellRef.style.backgroundColor = '#ffe6d9';
				break;
			case 4:	
				tableCellRef.style.backgroundColor = '#EEFBF9';
				break;
			case 5:	
				tableCellRef.style.backgroundColor = '#FFFFCC';
			case 6:	
				tableCellRef.style.backgroundColor = '#E1792B';	
				break;
			default:
				
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#006666';
				break;
			case 2:	
				tableCellRef.style.backgroundColor = '#eee';
				break;
			case 3:	
				tableCellRef.style.backgroundColor = '#ffe6d9';
				break;
			case 4:	
				tableCellRef.style.backgroundColor = '#EEFBF9';
				break;
			case 5:	
				tableCellRef.style.backgroundColor = '#FFFFCC';
			case 6:	
				tableCellRef.style.backgroundColor = '#E1792B';	
				break;
			default:
				
		}
	}
}

function nav_bar_click( tableCellRef, navStyle, url, locale ) {
	nav_bar( tableCellRef, 0, navStyle );
	menu_goto( url, locale );
}

function nav_font( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.color  = '#003366';
				break;
			case 2:
				tableCellRef.style.color = '#B54B3E';	
				break;
			case 3:	
				tableCellRef.style.color = 'F3EEC3';
				break;
			case 4:	
				tableCellRef.style.color = '#478D77';
				break;
			case 5:	
				tableCellRef.style.color = '#666666';
				break;
			case 6:	
				tableCellRef.style.color = '#6666CC';
				break;	
			case 7:	
				tableCellRef.style.color = '#E1792B';	
				break;
			case 8:	
				tableCellRef.style.color = '#ffffff';	
				break;	
			default:
				
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.color = '#003366';
				break;
			case 2:	
				tableCellRef.style.color = '#003366';
				break;
			case 3:	
				tableCellRef.style.color = '#ffffff';
				break;
			case 4:	
				tableCellRef.style.color = '#478D77';
				break;
			case 5:	
				tableCellRef.style.color = '#FFFFCC';
				break;
				
							
			default:
				
		}
	}
}