function TitleSearchResults(vIndex) {
	document.write('<table border="0" width="80%" height="30" cellspacing="1" cellpadding="3" class="LightTableColor">');
	document.write('	<tr align=center>');
	document.write('		<td>');
	if (vIndex=='other' || vIndex=='OTHER'){
		document.write('Special case: ' + vIndex);
	}else{
		document.write('Show titles beginning with ' + vIndex + '.');
	}
	document.write('		</td>');
	document.write('	</tr>');
	document.write('</table>');

}

function SubjectSearchResults(vIndex) {
	document.write('<table border="0" width="80%" height="30" cellspacing="1" cellpadding="3" class="LightTableColor">');
	document.write('	<tr align=center>');
	document.write('		<td>');
	if (vIndex=='other' || vIndex=='OTHER'){
		document.write('Special case: ' + vIndex);
	}else{
		document.write('Show subjects beginning with ' + vIndex + '.');
	}
	document.write('		</td>');
	document.write('	</tr>');
	document.write('</table>');

	
}

function CheckEmail(e)
{
	// E-mail-Validation by Henrik Petersen / NetKontoret
	// Explained at www.netkontoret.dk/jsforms.htm
	// Please do not remove the this line and the two lines above.
	
	apos=e.indexOf("@"); 
	dotpos=e.lastIndexOf(".");
	lastpos=e.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
			{return false;}
		else {return true;}
}


function CheckDate(e){
	
	//initialize
	error = false
	dd = "unknown"
	mm = "unknown"
	yy = "unknown"

	// check correct placement of slashes, and lengths of fields	
	slash1 = e.indexOf("/");
	slash2 = e.lastIndexOf("/");

	if (slash1 > 2 || slash1 < 1){
		error = true}
	else{
		mm = e.substring(0, slash1)
	}
	
	if ((slash2 - slash1) < 2 || (slash2 - slash1) > 3){
		error = true
	} 
	else{
		dd = e.substring(slash1+1, slash2)
	}
	
	
	yy = e.substring(slash2+1, e.length)
	
	if ((yy.length != 2) && (yy.length !=4)){
		error = true
	}
	
	// strip off any possible leading zeros
	if ((mm.length == 2) && (mm.substring(0,1)=="0")){
	   mm = mm.substring(1,2)}
	if ((dd.length == 2) && (dd.substring(0,1)=="0")){
	   dd = dd.substring(1,2)}
	if ((yy.length == 2) && (yy.substring(0,1)=="0")){
	   yy = yy.substring(1,2)}
	
	if ((yy.length == 4) && (yy.substring(0,1)=="0")){
	   yy = yy.substring(1,4)}	
	
	// convert days to numbers
	ddNum=parseFloat(dd)
	mmNum=parseFloat(mm)
	yyNum=parseFloat(yy)
	

	//	test for non-numbers inside the date (ie "aB" or "3#")
	if ( isNaN(ddNum) || (ddNum < 10) && (dd.length == 2)) {
		error=true
	}
	if ( isNaN(mmNum) || (mmNum < 10) && (mm.length == 2)) {
		error=true
	}
	if ( isNaN(yyNum) || (yyNum < 10) && (yy.length == 2)) {
		error=true
	}

	// check for valid month
	if (mmNum < 1 || mmNum > 12){
		error = true
	}

	// check for valid day
	if (error == false){
		if (mmNum==1 || mmNum==3 || mmNum==5 || mmNum==7 || mmNum==8 || mmNum==10 || mmNum==12){
			if (ddNum <1 || ddNum > 31){
				error = true
			}
		}
		if (mmNum==4 || mmNum==6 || mmNum==9 || mmNum==11){
			if (ddNum <1 || ddNum > 30){
				error = true
			}
		}
		if (mmNum==2){ //febuary
			if (yyNum % 4 == 0){
				if (ddNum <1 || ddNum > 29){
					error = true
				}
			}
			else{
				if (ddNum <1 || ddNum > 28){
					error = true
				}
			}
		}
	}		
	
		if (error){return false}
		else{return true}
	
}