function Category(categoryId)
{
	this.id = categoryId;
	this.name = null;
	this.description = null;
	this.featured = false;
	this.isDefault = false;
}

function Project(projectId)
{
	this.id = projectId;
	this.title = null;
	this.description = null;
	this.upload_image = null;
	this.upload_thumbnail = null;
	this.featured = false;
	this.upload_feature = null;
	this.sequence = -1;
	this.categories = new Array();
}

function CategoryProject(projectId) {
	this.project_id = projectId;
	this.featured = false;
}

function blankField(fieldName, displayName)
{
	if(document.getElementById(fieldName).value.length==0)
	{
		document.getElementById(fieldName).focus();
		alert("Please specify " + displayName);
		return true;
	}
	return false;
}

function limitTextLength(text, length, link)
{
	if(!link) {
		if(text.length<=length)
			return text;
		else
			return text.substr(0, length-3) + "...";
	} else {
		if(text.length+9<length)
			return text + "...<a href='" + link + "'>[more]</a>";
		else
			return text.substr(0, length-9) + "...<a href='" + link + "'>[more]</a>";
	}
}
