CodeThatTable - Email as new usertype

CodeThatTable - Email as new usertype

//-----------------------------------------------------------------------------------
//GLOBAL VARS
//-----------------------------------------------------------------------------------
var DATE_FORMAT = "dd.mm.yyyy", CURRENCY_FORMAT = " $";
var EMPTY_ROW = "no filter";
//Example of use user-type (EMAIL1) in CodeThatTable
var EMAIL1_FORMAT = " !";
function formatEmail1(data, format) {
	return data + " " + format;
};

function parseEmail1(data) {
	return "! " + data;
};

function compareEmail1(op1, op2) {
	if (Undef(op1) && Undef(op2)) return 0;
	else if (Undef(op1)) return 1;
	else if (Undef(op2)) return - 1;
	op1 = op1.toUpperCase();
	op2 = op2.toUpperCase();
	if (op1 > op2) return 1;
	else if (op1 < op2) return - 1;
	else return 0;
};
//-----------------------------------------------------------------------------------
//TABLE DEFINITION
//-----------------------------------------------------------------------------------
var gridDef = {
	amountPerPage : 5,
	useMultiSort : true,
	datatype : 1,
	data : "0;Stiles James;01.01.2002;jstiles@necasting.com;270;{src: \"img/5.jpg\", width: 120, height: 160}\n
	1;Alexander Jacklynn;12.05.2003;speedracer1979@iwon.com;1;{src: \"img/3.jpg\", width: 160, height: 120}\n
	2;Martin Barney;01.01.2002;bmartin1@maine.rr.com;92;{src: \"img/7.jpg\", width: 160, height: 120}\n
	3;Gelinas Patricia;18.07.2003;pattigelinas@hotmail.com;364;{src: \"img/3.jpg\", width: 160, height: 120}\n
	4;Cooke Dee;02.05.2002;findDeeCooke@aol.com;74;{src: \"img/5.jpg\", width: 120, height: 160}\n
	5;Greiner Andrew;08.01.2003;andy_greiner@hotmail.com;0;{src: \"img/7.jpg\", width: 160, height: 120}\n
	6;Maillet Chad;01.01.2002;ChadRM@rccw.com;265;{src: \"img/3.jpg\", width: 160, height: 120}\n
	7;Batson Alecia;01.01.2002;acbatson@yahoo.com;0;{}\n8;Gato Timothy;01.01.2002;tgato2@maine.rr.com;60;{}\n
	9;Wheeler Skip;01.01.2002;skipw47@aol.com;59;{}",
	colDef : [
	{
		title : "ID",
		titleClass : "", //default for th
		type : "Number",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Name",
		titleClass : "",
		type : "String",
		width : 0, //auto
		alignment : "",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Reg. date",
		titleClass : "", //default for th
		type : "Date",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : true,
		useAutoFilter : true
	},
	{
		title : "E-mail",
		titleClass : "", //default for th
		type : "Email1",
		width : 0, //auto
		alignment : "center",
		compareFunction : compareEmail1,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Account",
		titleClass : "", //default for th
		type : "Currency",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : true,
		useAutoFilter : true
	},
	{
		title : "Photo",
		titleClass : "", //default for th
		type : "Image",
		width : 160,
		alignment : "right",
		compareFunction : compareImage,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	} ],
	rowStyle : {
		markClass : "mark",
		darkClass : "dark",
		lightClass : "light",
		hoverClass : "hover"
	},
	keyCol : "ID",
	//rowHandler : rowHandler,
	imgSortAsc : 	{
		src : "img/sortasc.gif", width : 10, height : 10
	},
	imgSortDesc : 	{
		src : "img/sortdesc.gif", width : 10, height : 10
	},
	imgSortAscActive : 	{
		src : "img/sortasca.gif", width : 10, height : 10
	},
	imgSortDescActive : 	{
		src : "img/sortdesca.gif", width : 10, height : 10
	},
	imgMultiSortAscActive : 	{
		src : "img/sortascma.gif", width : 10, height : 10
	},
	imgMultiSortDescActive : 	{
		src : "img/sortdescma.gif", width : 10, height : 10
	},
	imgFirstPage : {
		src : "img/firstpage.gif", width : 10, height : 10
	},
	imgLastPage : 	{
		src : "img/lastpage.gif", width : 10, height : 10
	},
	imgPrevPage : 	{
		src : "img/prevpage.gif", width : 10, height : 10
	},
	imgNextPage : 	{
		src : "img/nextpage.gif", width : 10, height : 10
	},
	tableStyle : {
		tableClass : "common",
		thClass : "common",
		border : 0,
		cellpadding : 2,
		cellspacing : 1
	}
};