/**
 * dir_lnk Jan 2008 Version 1.0
 * Maritta Sturt
 * Copyright (c) M. Sturt 
 *
 * order A1, AA1, B1, BA1, Z1, ZZ99
 */

	var pc = '';
	 
	arrPcode = new Array;
	arrHtm = new Array;
	
	function ValPc(pcForm) {
		document.getElementById('sform').style.background ='';
		pc = pcForm.pcode.value;
		if (pc == '') {
			document.getElementById('sform').style.background ='url(Pictures_Page/msg_err1.gif)';
			pcForm.pcode.focus();
			return false;
		}
		repc1 = /^[a-zA-Z]\d$/;
		repc2 = /^[a-zA-Z]\d\d$/;
		repc3 = /^[a-zA-Z][a-zA-Z]\d$/;
		repc4 = /^[a-zA-Z][a-zA-Z]\d\d$/;
		if (!(repc1.test(pc)||repc2.test(pc)||repc3.test(pc)||repc4.test(pc))) {
			document.getElementById('sform').style.background ='url(Pictures_Page/msg_err2.gif)';
			pcForm.pcode.focus();
			pcForm.pcode.select();
			return false;
		}
		return true;
	}

	function DirPage() {
		InitArr();
		
		pc = pc.toUpperCase(); 
		
		fnd = false;		
		for (i=0; i<arrPcode.length && !fnd; i++) {
			if (pc <= arrPcode[i]) {
				pglink = arrHtm[i];
				fnd = true;
			}
		}
			  
		if (!fnd) {
			pglink = arrHtm[arrHtm.length-1];
		}
		
		window.location = pglink;
	}

	function InitArr() {
		var i=0;
		arrPcode[i] = 'N13';
		arrHtm[i] = 'Indx001.htm#pcn13';
		i++;
	}
