var EMOPdb = new Array();
var EMtypes = ["adm","Administration","ecm","E-Commerce","fin","Finance","hr","Human Resources",
			   "it","Information Technology","mkt","Sales/Marketing","mfg","Manufacturing",
			   "sal","Sales","6s","Six Sigma","src","Sourcing","tec","Technology"];

//
// Posted date = when posting is added in this tool to Multilin site
//
Array.prototype.add = function (id,vid,type,tit,loc,desc,post,expire) 
{	
	var tmp = new Object();
	tmp.ID=id; tmp.JobID=vid; tmp.Type=type; tmp.Title=tit; tmp.Location=loc; tmp.Desc=desc; tmp.Posted=post; tmp.Expire = expire;
	this.push(tmp);
}

EMOPdb.add('Senior_Acct_Leader',1139890,'fin','Senior Accounting Leader','Markham, ON, Canada','','02/01/2010',null);
EMOPdb.add('Senior_Business_Systems_Developer',1142704,'it','Senior Business Systems Developer','Markham, ON, Canada','','02/01/2010',null);

var EMtoday = new Date(); EMtoday.setHours(0); EMtoday.setMinutes(0); EMtoday.setSeconds(0); EMtoday.setMilliseconds(0);

// return full name for Type code
function FindType(typecode) {
	for (var t=0; t<EMtypes.length; t+=2) {
		if (EMtypes[t].toLowerCase()==typecode.toLowerCase()) return EMtypes[t+1];
	}
	return "";
}

// determine if Type code exists in job database
function TypeExists(typecode) {
	for (var e=0; e<EMOPdb.length; e++) {
		if (EMOPdb[e].Expire) if (new Date(EMOPdb[e].Expire) < EMtoday) continue;
		if (EMOPdb[e].Type.toLowerCase()==typecode.toLowerCase()) return true;
	}
	return false;
}
