
/* ----------- */


	// PROJECT CONTENT

	// active home page page
	// this must relate to a number in the project array

	var iCurrent = 4;

	// array of project catalogue numbers and paths to the associates index.html
	// each index.html must be nested two directories lower
	
	var iProjects = new Array();	

	iProjects[5] = new projectEntry('About','about/11-000');
	
	iProjects[4] = new projectEntry('10.004','fonts/ten');
	iProjects[3] = new projectEntry('10.003','imagebin/10-003');
	iProjects[2] = new projectEntry('10.002','fonts/snafu');
	iProjects[1] = new projectEntry('10.001','archive/v1');

	iProjects[0] = new projectEntry('About','about/10-000');

	function projectEntry(iFlag,iProj) {
		this.iFlag = iFlag;
		this.iProj = iProj;
	}




/* ----------- */


	// MAIL
	
	function makeMailTag(iSendTo,iSubject) {
	  // generates a complete mail_To tag
		// iSendTo  : target email address, typically 'contact at ...'
		// iSubject : subject of the message, typically 'Beaufonts enquiry'
		var iTemp = '';
		iTemp = '<A HREF="m';
		iTemp += 'ailto:';
		iTemp += iSendTo;
		iTemp += '?&subject=';
		iTemp += iSubject;
		iTemp += '">';
		iTemp += '<B>';
		iTemp += iSendTo;
		iTemp += '</B></A>';
		return iTemp;
	}

	function atBoo(iRecipient) {
	  // generates an at beaufonts email address text string
		// iRecipient : target email recipient, typically 'contact'
		var iTemp = '';
		iTemp += iRecipient;
		iTemp += '@beaufonts.co';
		iTemp += 'm';
		return iTemp;
	}

	function contact_beaufonts(iRecipient) {
		confirm("Please send email to " + atBoo(iRecipient))
	/*
		if ( confirm("Beaufonts' email address : " + atBoo(iRecipient)) ) {
			alert('OK');
		} else {
			alert('NOT OK');
		}
	*/
		//alert("Beaufonts' email address : " + atBoo(iRecipient));
		//prompt("Beaufonts' email address : ", atBoo(iRecipient));
	}

/* ----------- */


	// HOME PAGE FRAME CONTENT INITS

	function init_page(n) {
		iCurrent = n;
		FrLaunch.document.location.replace(iProjects[iCurrent].iProj + '/launch.html');
		FrSub.document.location.replace(iProjects[iCurrent].iProj + '/sub.html');
		FrXtra.document.location.replace(iProjects[iCurrent].iProj + '/xtra.html');
		FrCurrent.scrollTo(0,adj_scroll(iCurrent));
		set_PP(n);
	}
	
	function init_startup(n) {
		iCurrent = n;
		FrCurrent.scrollTo(0,adj_scroll(iCurrent));
		set_PP(n);
	}
	
	function set_PP(n) {
		// also called from chooser.html ONLOAD
		for (var i = 1; i <= Math.floor(iCurrent -1); i++) {
		eval('FrChooser.Ch' + i + '.className="' + 'MENU_02' + '"');
		}
		eval('FrChooser.Ch' + n + '.className="' + 'MENU_02i' + '"');
	}
		

/* ----------- */


	var newWindow = null;

	function openWindow(iName,iURL,x,y) {
		var y1 = Math.floor(y+48);
		if ( screen.width <= x ) { var xx = 0; } else { var xx = Math.floor((screen.width - x) / 2); }
		if ( screen.height <= y1 ) { var yy = 0; } else { var yy = Math.floor((screen.height - y1) / 2); }
		var iWinPos = ',LEFT=' + xx + ',TOP=' + yy
		var iFeatures = 'WIDTH='+ x +',HEIGHT='+ y + iWinPos +',STATUS=no,RESIZABLE=yes,SCROLLBARS=no';
		openNewWindow(iURL,iName,iFeatures);
		}

	function openNewWindow(iURL,iName,iFeatures) {
		newWindow = window.open(iURL,iName,iFeatures);
		newWindow.focus();
	}


/* ----------- */


	function set_page(n) {
		iCurrent = n;
		var iTemp = '../../' + iProjects[n].iProj + '/index.html';
		window.location.href = iTemp;
	}

	function set_from_x(iPage) {
		parent.FrLaunch.document.location.replace(iPage);
	}

	function set_scroll(n) {
		parent.FrCurrent.scrollTo(0,adj_scroll(n));
	}

	function adj_scroll(n) {
		return ((iProjects.length-n-1)*147); // -30
	}

/* ----------- */

	function doc_write(iSendTo,iSubject) {
		var iTemp =makeMailTag(parent.atBoo(iSendTo),iSubject);
		FrLaunch.document.write(iTemp);
		FrLaunch.document.close;
	}


/* ----------- */


/* ----------- */
/* ----------- */

