
function testInput() {
	var teaser 		= document.getElementById('edit-headline');
	var htmlMeta 		= document.getElementById('edit-html_metatag');
	var htmlTitle		= document.getElementById('edit-html_title');
	var pageTitle		= document.getElementById('edit-title'); 
	var offSite		= document.getElementById('edit-offsitelink');
	var offSiteValue	= offSite.value;
	var htmlMetaValue 	= htmlMeta.value;
	var htmlTitleValue	= htmlTitle.value;
	var teaserValue		= teaser.value;
	var pageTitleValue	= pageTitle.value;

	if(htmlMetaValue.toLowerCase() == teaserValue.toLowerCase() || htmlMetaValue.toLowerCase() == htmlTitleValue.toLowerCase() || pageTitleValue.toLowerCase() == htmlMetaValue.toLowerCase()) {
		alert('Sorry, your Meta Tag field is identical with other title fields. Rewrite the meta tag field with a description fitting for results in search engines, eg "A video about the Acme 3000 widget" or "An audio interview with recording artist Jah Wobble"');
		return false;
	}
	var isTherePage = offSiteValue.lastIndexOf("page");
	var offSiteLen	= offSiteValue.length;
	if(offSiteLen < 1) {
		alert('Sorry, each story needs to have an offsite link paragraph. Research the appropriate hyperlink and write it into the off site link paragraph.');
		return false;
	}
	if((offSiteLen - isTherePage) > 0 && (offSiteLen - isTherePage) < 10) {
		alert('Sorry, the offsite link paragraph needs to be rewritten. Make sure you indicate that the link(s) contained therein lead to offiste or official resources');
		return false;
	}
	var offSiteValue 	= offSiteValue.toLowerCase();
	var offSiteFindA 	= offSiteValue.indexOf("<a");
	var offSiteFindHTTP = offSiteValue.indexOf("http://");
	if(offSiteFindA < 0) {
		alert('Sorry, the offsite link paragraph contains no hypertext. Research the appropriate hyperlink and write it into the off site link paragraph.');
		return false;
	}
	else if(offSiteFindHTTP < 0) {
		alert('Sorry, your link is not prefixed with http://. Please re-write your offsite link paragraph and try again.');
		return false;
	}
}
