function search() {

	if (trim(searchEngine.keywordt.value)=="") {
		alert('Please enter your search.');
		searchEngine.keywordt.focus();
		return;
	}
	
	document.searchEngine.submit();
}

function chktell() {

	if (trim(frmtell.name.value)=="") {
		alert('Please enter your name.');
		frmtell.name.focus();
		return;
	}

	if (trim(frmtell.email.value)=="") {
		alert('Please enter your email.');
		frmtell.email.focus();
		return;
	}

	if (frmtell.email.value != "") {
		if (!chkmail(frmtell.email.value)) {
			alert("Please enter a valid E-mail address.");
			frmtell.email.focus();
			return;
		}
	}
	
	inputmax=frmtell.comments.value
	
	if (trim(frmtell.comments.value)=="") {
		alert('Please enter your comments.');
		frmtell.comments.focus();
		return;
	}

	if (inputmax>"500") {
		alert('You have exceeded the limit of characters allowed as comments. Kindly make your comments brief.');
		frmtell.comments.focus();
		return;
	}

	frmtell.submit();
}

function chkupload(){
		
	//ensure the document_type is not empty
	if (trim(frmupload.name.value) == "") {
		alert("Please enter your full name. It will be displayed along with your article.")
		frmupload.name.focus();
		return;
	}

	if (trim(frmupload.email.value)=="") {
		alert('Please enter your email.');
		frmupload.email.focus();
		return;
	}

	if (frmupload.email.value != "") {
		if (!chkmail(frmupload.email.value)) {
			alert("Please enter a valid E-mail address.");
			frmupload.email.focus();
			return;
		}
	}

	if (trim(frmupload.occupation.value) == "") {
		alert("Please enter your occupation.")
		frmupload.occupation.focus();
		return;
	}

	if (trim(frmupload.filename.value)==""){
		alert("Please choose an article to upload. Please insert any picture/photo you might have, into the document, before uploading the document.");
		frmupload.filename.focus();
		return;
	}

	var oRegEx=/\.doc$|\.pdf$|\.rtf$|\.txt$/gi;
	if(!oRegEx.test(frmupload.filename.value)){
		alert("Please check that your document is one of the following formats and has the correct file extension:\n\n- Microsoft Word Document (*.doc, *.rtf)\n- Adobe Portable Document Format (*.pdf)\n- Rich Text Format (*.rtf)\n- Text Only (*.txt)\n\nFor other types, please send us an email with the attachments at info@newspaper.com.sg");
		frmupload.filename.focus();
		return ;
	}

	frmupload.submit();
	
}//function 

function chksubscribe(){
		
	//ensure the document_type is not empty
	if (trim(frmsubscribe.name.value) == "") {
		alert("Please enter your full name.")
		frmsubscribe.name.focus();
		return;
	}

	if (trim(frmsubscribe.email.value)=="") {
		alert('Please enter your email.');
		frmsubscribe.email.focus();
		return;
	}

	if (frmsubscribe.email.value != "") {
		if (!chkmail(frmsubscribe.email.value)) {
			alert("Please enter a valid E-mail address.");
			frmsubscribe.email.focus();
			return;
		}
	}

	frmsubscribe.submit();
	
}//function 