function popUp(query) 
{
	var windowHeight = 301;
	var windowWidth  = 510;

	hasChild = true
	child=window.open("charter?"+query,"boat_info_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
	return child;
}

function popUpVeryLarge(query) 
{
	var windowHeight = 531;
	var windowWidth  = 600;

	hasChild = true
	child=window.open("charter?"+query,"new_bulletin_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}


function popUpPass(query) 
{
	var windowHeight = 301;
	var windowWidth  = 500;

	hasChild = true
	child=window.open("charter?"+query,"change_pass_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpAdmin(query) 
{
	var windowHeight = 301;
	var windowWidth  = 500;

	hasChild = true
	child=window.open("admin?"+query,"admin_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCopy(query) 
{
	var windowHeight = 301;
	var windowWidth  = 601;

	hasChild = true
	child=window.open("admin?"+query,"copy_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCopyCentral(query) 
{
	var windowHeight = 301;
	var windowWidth  = 220;

	hasChild = true
	child=window.open("central?"+query,"copy_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpTextAdmin(query) 
{
	var windowHeight = 501;
	var windowWidth  = 700;

	hasChild = true
	child=window.open("admin?"+query,"admin_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpTextCentral(query) 
{
	var windowHeight = 501;
	var windowWidth  = 700;

	hasChild = true
	child=window.open("central?"+query,"central_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentral(query) 
{
	var windowHeight = 301;
	var windowWidth  = 500;

	hasChild = true
	child=window.open("central?"+query,"central_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralLarge(query) 
{
	var windowHeight = 460;
	var windowWidth  = 880;

	hasChild = true
	child=window.open("central?"+query,"central_large_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpIob(query) 
{
	var windowHeight = 460;
	var windowWidth  = 880;

	window.open("central?"+query,"central_large_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralVeryLarge(query) 
{
	var windowHeight = 531;
	var windowWidth  = 600;

	hasChild = true
	child=window.open("central?"+query,"new_bulletin_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralCopy(query) 
{
	var windowHeight = 301;
	var windowWidth  = 601;

	hasChild = true
	child=window.open("central?"+query,"central_copy_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpLarge(query) 
{
	var windowHeight = 401;
	var windowWidth  = 500;

	hasChild = true
	child=window.open("charter?"+query,"boat_info_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralCal(query) 
{
	var windowHeight = 401;
	var windowWidth  = 500;

	hasChild = true
	child=window.open("central?"+query,"boat_info_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpLogin(query) 
{
	var windowHeight = 301;
	var windowWidth  = 501;

	hasChild = true;
	child=window.open("charter?"+query,"Log_In_Notice","top=3000,left=3000,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpThumbnail(query) 
{
	var windowHeight = 375;
	var windowWidth  = 400;

	hasChild = true;
	child=window.open("admin?"+query,"thumbnail_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralThumbnail(query) 
{
	var windowHeight = 375;
	var windowWidth  = 400;

	hasChild = true;
	child=window.open("central?"+query,"thumbnail_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpBrochureImage(query) 
{
	var windowHeight = 600;
	var windowWidth  = 600;

	hasChild = true;
	child=window.open(query,"brochure_image_popup","top="+centreY(windowHeight)+",left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpCentralBrochureImage(query, imageWidth, imageHeight) 
{
	var windowHeight = 600;
	var windowWidth  = 600;

	hasChild = true;
	child=window.open(query,"brochure_image_popup","top="+centreY(windowHeight)+",left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function popUpOutlook(query) {

	hasChild = true;
	child=window.open("charter?"+query,"thumbnail_popup","top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=1,height=1");

}

function openExtranet(URL) 
{
	window.open("charter?m=Brochure&y="+URL+"&t=direct")
}

function openExtranetDynamic(YachtKey, CharterKey, CharterLocKey, CharterPerKey) 
{
	window.open("rys?m=EBrochure&yachtKey="+YachtKey+"&charterKey="+CharterKey+"&charterLocKey="+CharterLocKey+"&charterPerKey="+CharterPerKey+"&page=index.html")
}

function openExtraneti(URL) 
{
	var windowHeight = 375;
	var windowWidth  = 510;

	window.open("charter?m=Brochure&y="+URL+"&t=indirect","boat_info_popup","top="+centreY(windowHeight)+", left="+centreX(windowWidth)+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+windowWidth+",height="+windowHeight);
}

function oldOpenExtranet(URL) 
{
	window.open("http://www.charterbrochure.com/"+URL+"/")
}

function closeChildWindow() {
	if( hasChild ) if ( !child.closed ) child.close()
}

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var userstring=""

function getthedate(){
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
		year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
		daym="0"+daym
	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()
	var dn="AM"
	if (hours>=12)
		dn="PM"
	if (hours>12)
		hours=hours-12
	if (hours==0)
		hours=12
	if (minutes<=9)
		minutes="0"+minutes
	if (seconds<=9)
		seconds="0"+seconds
		
	//change font size here
	var cdate=dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" <br>"+hours+":"+minutes+":"+seconds+" "+dn+"<br>"+userstring;
	if (document.all)
		document.all.clock.innerHTML=cdate
	else if (document.getElementById)
		document.getElementById("clock").innerHTML=cdate
	else
		document.write(cdate)
}

function searchClick() {
	document.form1.m.value = "Results";
	document.form1.submit();
}
	
function BasicSubmit() {
	document.form1.m.value = "BasicSearch";
	document.form1.submit();
}
	
function AdvancedSubmit() {
	document.form1.m.value = "AdvancedSearch";
	document.form1.submit();
}
	
function loginClick() {
	document.form1.m.value = "Login";
	document.form1.submit();
}

function yachtUndo() {
	document.form1.hold.value = "false";
	document.form1.submit();
}

function saveClick(form) {
	document.form1.save.value = "true";
	document.form1.submit();
}

function saveAgentClick(form) {
	document.form2.save.value = "true";
	document.form2.submit();
}
	
function deleteClick() {
	document.form1.remove.value = "true";
	document.form1.submit();
}

function deleteAgentClick() {
	document.form2.remove.value = "true";
	document.form2.submit();
}
	
function changesMade() {
	document.form1.changesMade.value = "true";
}
	
function generateReport() {
	document.form1.generateNewReport.value = "true";
	document.form1.submit();
}

function listClick() 
{
	if(document.form1.changesMade)
	{
		if(document.form1.changesMade.value=="true") 
		{
			confirmSave("Save changes?");
		}
		else
		{
			document.form1.submit();
		}
	}
	else
	{
		document.form1.submit();
	}	
}

function pageClick(page) {
	document.form1.page.value = page;
	document.form1.submit();
}

function clickAdminBulletinSelect(type) {
	document.form1.page.value="AdminBulletinEdit";
	document.form1.bulletinType.value=type;
	document.form1.submit();
}

function clickCentralBulletinSelect() {
	document.form1.page.value="CentralBulletinEdit";
	document.form1.submit();
}

function clickCharterBulletinSelect() {
	document.form1.page.value="CharterBulletinEdit";
	document.form1.submit();
}

function clickBulletinSelect(type) {
	document.form1.page.value="AdminBulletinEdit";
	document.form1.bulletinType.value=type;
	document.form1.submit();
}

function clickUserSelect() {
	if ( document.form1.userChoice.value=="0" ) {}
	else {
		document.form1.submit();
	}
}

function newYachtClick() {
	if ( document.form1.yachtChoice.value >= "0" ) {
		document.form1.changeYacht.value="true";
		confirmSave3('Save screen as is?');
	}
}

function newCentralYachtClick() {
	if ( document.form1.yachtChoice.value >= "0" ) {
		document.form1.changeYacht.value="true";
		confirmSave3('Save screen as is?');
	}
}

function newAgentClick() {
	if ( document.form2.agentChoice.value >= "0" ) {
		document.form2.changeAgent.value="true";
		confirmAgentSave3('Save changes as is?');
	}
}

function changeLocationClick() {
	if ( document.form2.locationChoice.value >= "0" ) {
		document.form2.changeLocation.value="true";
		document.form2.submit();
	}
}

function newLocationClick() {
	document.form2.newLocation.value="true";
	document.form2.submit();
}

function deleteLocationClick() {
	document.form2.deleteLocation.value="true";
	document.form2.submit();
}

function deleteLogoClick() {
	document.form2.deleteLogo.value="true";
	document.form2.submit();
}

function changePersonClick() {
	if ( document.form2.personChoice.value >= "0" ) {
		document.form2.changePerson.value="true";
		document.form2.submit();
	}
}

function newPersonClick() {
	document.form2.newPerson.value="true";
	document.form2.submit();
}

function deletePersonClick() {
	document.form2.deletePerson.value="true";
	document.form2.submit();
}

function changeAreaClick() {
	if ( document.form1.areaChoice.value >= "0" ) {
		document.form1.hold.value="true";
		document.form1.changeArea.value="true";
		document.form1.submit();
	}
}

function newAreaClick() {
	document.form1.hold.value="true";
	document.form1.newArea.value="true";
	document.form1.submit();
}

function deleteAreaClick() {
	document.form1.hold.value="true";
	document.form1.deleteArea.value="true";
	document.form1.submit();
}

function changeRateClick(key) {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted rate?'))
		{
			if(validRate())
			{
				saveClick();
			}
		}
		else
		{
			document.form1.changesMade.value='false';
			changeRateClick(key);
		}
	}
	else
	{
		document.form1.rateChoice.value=key;
		if ( document.form1.rateChoice.value >= "0" )
		{
			document.form1.changeRate.value="true";
			document.form1.submit();
		}
	}
}

function newRateClick() {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted rate?'))
		{
			if(validRate())
			{
				saveClick();
			}
		}
		else
		{
			document.form1.changesMade.value='false';
			newRateClick();
		}
	}
	else
	{
		document.form1.newRate.value="true";
		document.form1.submit();
	}
}

function deleteRateClick(key) {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted rate?'))
		{
			if(validRate())
			{
				saveClick();
			}
		}
		else
		{
			document.form1.changesMade.value='false';
			deleteRateClick(key);
		}
	}
	else
	{
		document.form1.rateChoice.value=key;
		if(confirm('Are you sure you wish to delete this rate?'))
		{
			document.form1.deleteRate.value="true";
			document.form1.submit();
		}
	}
}

function changeSubClick(key) {
	if(document.form2.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted subscription?'))
		{
			if(validSub())
			{
				document.form2.save.value = "true";
				document.form2.submit();
			}
		}
		else
		{
			document.form2.changesMade.value='false';
			changeSubClick(key);
		}
	}
	else
	{
		document.form2.subChoice.value=key;
		if ( document.form2.subChoice.value >= "0" )
		{
			document.form2.changeSub.value="true";
			document.form2.submit();
		}
	}
}

function newSubClick() {
	if(document.form2.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted subscription?'))
		{
			if(validSub())
			{
				document.form2.save.value = "true";
				document.form2.submit();
			}
		}
		else
		{
			document.form2.changesMade.value='false';
			newSubClick();
		}
	}
	else
	{
		document.form2.newSub.value="true";
		document.form2.submit();
	}
}

function renewSubClick() {
	if(document.form2.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted subscription?'))
		{
			if(validSub())
			{
				document.form2.save.value = "true";
				document.form2.submit();
			}
		}
		else
		{
			document.form2.changesMade.value='false';
			renewSubClick();
		}
	}
	else
	{
		document.form2.renewSub.value="true";
		document.form2.submit();
	}
}

function saveSubClick() {
	document.form2.save.value = "true";
	document.form2.submit();
}

function deleteSubClick() {
	if(confirm('We usually retain old subscriptions for our records. Are you sure you wish to delete this subscription?'))
	{
		document.form2.remove.value="true";
		document.form2.submit();
	}
}

function changeBookingClick(key) {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted booking?'))
		{
			saveClick();
		}
		else
		{
			document.form1.changesMade.value='false';
			changeBookingClick(key);
		}
	}
	else
	{
		document.form1.bookingChoice.value=key;
		if ( document.form1.bookingChoice.value >= "0" )
		{
			document.form1.changeBooking.value="true";
			document.form1.submit();
		}
	}
}

function changeBookingReservationClick(key) {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted booking?'))
		{
			saveClick();
		}
		else
		{
			document.form1.changesMade.value='false';
			changeBookingReservationClick(key);
		}
	}
	else
	{
		popUpIob('m=Reservation&page=ReservationEditPopup&action=bookingEdit&bookingKey='+key);
	}
}

function newBookingClick() {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted booking?'))
		{
			saveClick();
		}
		else
		{
			document.form1.changesMade.value='false';
			newBookingClick();
		}
	}
	else
	{
		document.form1.addNewBooking.value="true";
		document.form1.submit();
	}
}

function deleteBookingClick(key) {
	if(document.form1.changesMade.value=='true')
	{
		if(confirm('Would you like to save your changes to the highlighted booking?'))
		{
			saveClick();
		}
		else
		{
			document.form1.changesMade.value='false';
			deleteBookingClick(key);
		}
	}
	else
	{
		document.form1.bookingChoice.value=key;
		if(confirm('Are you sure you wish to delete this booking?'))
		{
			document.form1.deleteBooking.value="true";
			document.form1.submit();
		}
	}
}

function orderClick(column) {
	if(column<0)
	{
		return;
	}
	document.form1.orderBy.value = column;
	document.form1.m.value = "Results";
	document.form1.page.value = "Results";
	document.form1.submit();
}

function removeAdvert() {
	document.form1.indexRemove.value = "true";
	document.form1.submit();
}

function updateAdvert() {
	document.form1.indexUpdate.value = "true";
	document.form1.submit();
}

function newSearchClick() {
	document.form1.newSearch.value = "true";
	document.form1.submit();
}

function resetAdvancedClick() {
	document.form1.newSearch.value = "false";
	document.form1.resetBasic.value = "false";
	document.form1.resetAdvanced.value = "true";
	document.form1.submit();
}

function resetBasicClick() {
	document.form1.newSearch.value = "false";
	document.form1.resetAdvanced.value = "false";
	document.form1.resetBasic.value = "true";
	document.form1.submit();
}

function userUndo() {
	document.form1.userChoice.value = document.form1.currentUserId.value;
	document.form1.submit();
}

function isYachtPage()
{
	var page = document.form1.page.value;
	if ( page == "AdminArea" )
		return "true";
	else if ( page == "AdminBooking" )
		return "true";
	else if ( page == "AdminCrew" )
		return "true";
	else if ( page == "AdminRates" )
		return "true";
	else if ( page == "AdminToys" )
		return "true";
	else if ( page == "AdminYacht" )
		return "true";
	else if ( page == "CentralArea" )
		return "true";
	else if ( page == "CentralToys" )
		return "true";
	else if ( page == "CentralYacht" )
		return "true";
	else
		return "false"; 
}

function saveYachtPage( isYacht )
{
	if ( isYacht == "true" )
		confirmSave3('Save screen as is?');
	else
		document.form1.submit();
}

function confirmSave(text) {
	var name = confirm(text)
	
	if (name == true)
	{
		saveClick();
	}
	else
	{
		document.form1.submit();

	}
}

function bulletinSave() {
	var name = confirm('Save changes?')
	if (name == true)
	{
		document.form1.save.value = "true";
		document.form1.submit();
	}
	else
	{
	}
}

function confirmSave2(text) {
	var name = confirm(text)
	
	if (name == true)
	{
		saveClick();
	}
	else
	{
	}
}

function confirmSave3(text) {

	if ( document.form1.changesMade )
	{
		if ( document.form1.changesMade.value == "true" )
			confirmSave(text);
		else
			document.form1.submit();
	}
	else
		document.form1.submit();
}

function confirmAgentSave(text) {
	var name = confirm(text)
	
	if (name == true)
	{
		saveAgentClick();
	}
	else
	{
		document.form2.submit();

	}
}

function confirmAgentSave2(text) {
	var name = confirm(text)
	
	if (name == true)
	{
		saveAgentClick();
	}
	else
	{
	}
}

function confirmAgentSave3(text) {

	if ( document.form2.changesMade )
	{
		if ( document.form2.changesMade.value == "true" )
			confirmAgentSave(text);
		else
			document.form2.submit();
	}
	else
		document.form2.submit();
}


function confirmDelete() {
	var name = confirm("Delete this entry?")
	if (name == true)
	{
	deleteClick();
	}
	else
	{
	}
}

function confirmDelete2(text) {
	var name = confirm(text)
	if (name == true)
	{
	deleteClick();
	}
	else
	{
	}
}

function confirmAgentDelete() {
	var name = confirm("Delete this entry?")
	if (name == true)
	{
	deleteAgentClick()
	}
	else
	{
	}
}

function confirmAgentDelete2(text) {
	var name = confirm(text)
	if (name == true)
	{
	deleteAgentClick();
	}
	else
	{
	}
}

function confirmReport() {
	var name = confirm("Report generation will take several minutes - in some cases up to half an hour if the shared server is busy. If you attempt to navigate, or click the 'GENERATE REPORT' button during this time you will cause the server to become unstable. If you wish to continue browsing open a new window first. Do you wish to continue with report generation?")
	if (name == true)
	{
	document.getElementById('report').style.display="none"
	document.getElementById('working').style.display="block"
	generateReport();
	document.form1.img.src="dynamic/logos/working.gif"
	}
	else
	{
	}
}

function checkOffEnable(box, field) {
	if (box.checked) {
		field.value="on";
	} else {
		field.value="off";
	}
}

function checkBooleanEnable(box, field) {
	if (box.checked) {
		field.value="true";
	} else {
		field.value="false";
	}
}

function check0Enable(box, field) {
	if (box.checked) {
		field.value="1";
	} else {
		field.value="0";
	}
}

function clickCentralYacht() {
	var isYacht = isYachtPage();
	document.form1.page.value='CentralYacht';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickCentralToys() {
	var isYacht = isYachtPage();
	document.form1.page.value='CentralToys';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickCentralArea() {
	var isYacht = isYachtPage();
	document.form1.page.value='CentralArea';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickAdminSearch() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminSearch';
	document.form1.m.value='Yacht';
	document.form1.submit();
	saveYachtPage(isYacht);
}

function clickAdminYacht() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminYacht';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickAdminToys() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminToys';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickCrew() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminCrew';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickAdminArea() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminArea';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickRates() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminRates';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickBooking() {
	var isYacht = isYachtPage();
	document.form1.page.value='AdminBooking';
	document.form1.m.value='Yacht';
	saveYachtPage(isYacht);
}

function clickAdminCharterAgent() {
	document.form1.page.value='AdminCharterAgent';
	document.form1.m.value='Charter';
	document.form1.submit();
}

function clickAdminCharterSubs() {
	document.form1.page.value='AdminCharterSubs';
	document.form1.m.value='CharterSubs';
	document.form1.submit();
}

function clickAdminCentralAgent() {
	document.form1.page.value='AdminCentralAgent';
	document.form1.m.value='Central';
	document.form1.submit();
}

function clickAdminCentralSubs() {
	document.form1.page.value='AdminCentralSubs';
	document.form1.m.value='CentralSubs';
	document.form1.submit();
}

function clickAdminBulletinMain() {
	document.form1.page.value='AdminBulletinMain';
	document.form1.m.value='Bulletin';
	document.form1.submit();
}

function clickAdminUser() {
	document.form1.page.value='AdminUserAdmin';
	document.form1.m.value='User';
	document.form1.submit();
}

function clickBasicSearchMenu() {
	document.form1.page.value='newBasicSearch';
	document.form1.m.value='BasicSearch';
	document.form1.submit();
}

function clickAdvancedSearchMenu() {
	document.form1.page.value='newAdvancedSearch';
	document.form1.m.value='AdvancedSearch';
	document.form1.submit();
}

function clickCentralMenu() {
	document.form1.page.value='CentralYacht';
	document.form1.m.value='Yacht';
	document.form1.submit();
}

function clickGS() {
	document.form1.page.value='GS';
	document.form1.m.value='Help';
	document.form1.submit();
}

function clickFAQ() {
	document.form1.page.value='FAQ';
	document.form1.m.value='Help';
	document.form1.submit();
}

function clickUK() {
	document.form1.page.value='UK';
	document.form1.m.value='Help';
	document.form1.submit();
}

function clickUSA() {
	document.form1.page.value='USA';
	document.form1.m.value='Help';
	document.form1.submit();
}

function clickBS() {
	document.form1.m.value='BoatShows';
	document.form1.submit();
}

function clickCHA() {
	document.form1.m.value='CharterRequests';
	document.form1.submit();
}

function clickCEA() {
	document.form1.m.value='CentralAnnouncements';
	document.form1.submit();
}

function clickPEO() {
	document.form1.m.value='People';
	document.form1.submit();
}

function clickBRS() {
	document.form1.m.value='Brochures';
	document.form1.submit();
}

function clickPRF() {
	document.form1.m.value='Preferences';
	document.form1.submit();
}

function clickTablesMenu() {
	document.form1.page.value='AdminTableMain';
	document.form1.m.value='Table';
	document.form1.submit();
}

function clickReportsMenu() {
	document.form1.page.value='AdminReports';
	document.form1.m.value='Report';
	document.form1.submit();
}

function clickAdvertGroup() {
	document.form1.page.value='AdminAdvertGroup';
	document.form1.m.value='AdvertGroup';
	document.form1.submit();
}

function clickAdvertFiller() {
	document.form1.page.value='AdminAdvertFiller';
	document.form1.m.value='AdvertFiller';
	document.form1.submit();
}

function clickAdvertFix() {
	document.form1.page.value='AdminAdvert';
	document.form1.m.value='Advert';
	document.form1.submit();
}

function clickIndexMenu() {
	document.form1.page.value='AdminIndex';
	document.form1.m.value='Index';
	document.form1.submit();
}

function clickResN() {
	document.form1.page.value='ReservationNew';
	document.form1.m.value='Reservation';
	document.form1.submit();
}

function clickResY() {
	document.form1.page.value='ReservationByYacht';
	document.form1.m.value='ReservationYacht';
	document.form1.submit();
}

function clickResYA() {
	document.form1.page.value='ReservationByYachtArchive';
	document.form1.m.value='ReservationYachtArchive';
	document.form1.submit();
}

function clickResB() {
	document.form1.page.value='ReservationBrokerage';
	document.form1.m.value='ReservationBrokerage';
	document.form1.submit();
}

function clickResBA() {
	document.form1.page.value='ReservationBrokerageArchive';
	document.form1.m.value='ReservationBrokerageArchive';
	document.form1.submit();
}

function clickResC() {
	document.form1.page.value='ReservationCharter';
	document.form1.m.value='ReservationCharter';
	document.form1.submit();
}

function clickResCA() {
	document.form1.page.value='ReservationCharterArchive';
	document.form1.m.value='ReservationCharterArchive';
	document.form1.submit();
}

function clickResR() {
	document.form1.page.value='ReservationRecord';
	document.form1.m.value='ReservationRecord';
	document.form1.submit();
}

function clickResRA() {
	document.form1.page.value='ReservationRecordArchive';
	document.form1.m.value='ReservationRecordArchive';
	document.form1.submit();
}

function clickResG() {
	document.form1.page.value='ReservationRef';
	document.form1.m.value='ReservationRef';
	document.form1.submit();
}

function clickResGA() {
	document.form1.page.value='ReservationRefArchive';
	document.form1.m.value='ReservationRefArchive';
	document.form1.submit();
}

function logout() {
	alert('You are about to log off the Charter Index online system.');
	document.form1.page.value='Logout';
	document.form1.m.value='Logout';
	document.form1.submit();
}

function closeIt() {
	event.returnValue = "This will log you off the Charter Index system.";

}

function printToPdf(query)
{
	var paperType = document.form1.paperType.value;
	hasChild = true
	child=window.open("central?"+query+"&paperType="+paperType,"pdfPopup","top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no")
	child.focus();
}


function changePaperSize(size)
{
	document.form1.paperType.value = size;
}

function centreX(x)
{
	return (window.screen.availWidth-x)/2;
}

function centreY(y)
{
	return (window.screen.availHeight-y)/2;
}
