function openWindow(theURL,winName,features) {
  	window.open(theURL,winName,features).focus();
}

function jump(sel) {
	var url = sel.options[sel.selectedIndex].value;
	if ( url != '#' ) top.location = url;
}

function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature.");
}

function load(file,target) {
	if (target != '')
	  		target.window.location.href = file;
	else
	  		window.location.href = file;
}

function displayLayer( id, value )
{
    if ( document.getElementById )
    {
        document.getElementById( id ).style.display = value;
    }
    else if ( document.all )
    {
        document.all[ id ].style.display = value;
    }
}

function hide( id )
{
    displayLayer( id, 'none' );
}

function show( id )
{
    displayLayer( id, 'block' );
}

function onChangeSection() {
	var Current =
   	document.bravo_contact.subject.selectedIndex;
	if (document.bravo_contact.subject.options[Current].text == "Register with Bravo for Employment") {
		show( 'register' );
		hide( 'contact' );
		hide( 'booking' );
		hide( 'refer' );
		hide( 'feedback' );
	}
	else if (document.bravo_contact.subject.options[Current].text == "Contact Bravo or General Enquries") {
		hide( 'register' );
		show( 'contact' );
		hide( 'booking' );
		hide( 'refer' );
		hide( 'feedback' );
	}
	else if (document.bravo_contact.subject.options[Current].text == "Clients Wishing to make a Booking") {
		hide( 'register' );
		hide( 'contact' );
		show( 'booking' );
		hide( 'refer' );
		hide( 'feedback' );
	}
	else if (document.bravo_contact.subject.options[Current].text == "Refer a Friend to Bravo") {
		hide( 'register' );
		hide( 'contact' );
		hide( 'booking' );
		show( 'refer' );
		hide( 'feedback' );
	}
	else if (document.bravo_contact.subject.options[Current].text == "Send Feedback to Bravo") {
		hide( 'register' );
		hide( 'contact' );
		hide( 'booking' );
		hide( 'refer' );
		show( 'feedback' );
	}
	else {
		hide( 'register' );
		hide( 'contact' );
		hide( 'booking' );
		hide( 'refer' );
		hide( 'feedback' );
	}
}

function onChangeStaffSection() {
	var Current =
   	document.bravo_staff.subject.selectedIndex;
	if (document.bravo_staff.subject.options[Current].text == "Reporting of Hours") {
		show( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Work Availability") {
		hide( 'reporting' );
		show( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Payroll") {
		hide( 'reporting' );
		hide( 'availability' );
		show( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Resignation") {
		hide( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		show( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Refer a Friend to Bravo") {
		hide( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		show( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Change of Details") {
		hide( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		show( 'change' );
		hide( 'other' );
	}
	else if (document.bravo_staff.subject.options[Current].text == "Other Queries") {
		hide( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		show( 'other' );
	}
	else {
		hide( 'reporting' );
		hide( 'availability' );
		hide( 'payroll' );
		hide( 'resignation' );
		hide( 'staff_refer' );
		hide( 'change' );
		hide( 'other' );
	}
}
