
var BlackList;

BlackList = new Array("--", "/*", "*/", "@@",
	"alter", "begin", "cast", "create", "cursor",
	"declare", "delete", "drop", "exec",
	"execute", "fetch", "insert", "open",
	"select ", "sysobjects", "syscolumns",
	"table", "update", "<scrip", "</scrip", "<");

function CheckStringForSQL(str) {
	//If the string is empty, return true
	if(str == undefined) {
		return(false);
	}
	
	//check if length is 0	
	if (str.length == 0) {
		return(false);
	}
	
	//Check if the string contains any patterns in our	
	//black list
	
	var i;	
	for (i = 0; i < BlackList.length; i++) {
		if(str.toLowerCase().indexOf(BlackList[i]) != -1) {
			return(true);
		}
	}	
	return(false);
}



