<!--
function $(x) {
	return document.getElementById(x)
}

function validateForm() {
	if($('title').value == "") {
		alert ('Offer needs a title set!')
		return false
	}
	if($('pricing').value == "") {
		alert ('Offer needs a price set!')
		return false
	}
	
	if(tinyMCE.getInstanceById('description').getHTML() == "") {
		alert('Offer requires a description!');
		return false
	}
	
	if($('dateExpires').value == "") {
		return confirm('Offer Never Expires. Are you sure?')
	}
	
	var x	=	$('image').value.toLowerCase()
	if(x == "") {
		return confirm('No Image associated. Are you sure?')
	} else {
		if(x.substring(x.length-4,x.length) != ".jpg" && x.substring(x.length-5,x.length) != ".jpeg") {
			alert('Image should be in JPEG format')
			return false
		}
	}
	return true
}

function validateModifyForm() {
	if($('title').value == "") {
		alert ('Offer needs a title set!')
		return false
	}
	if($('pricing').value == "") {
		alert ('Offer needs a price set!')
		return false
	}
	
	if(tinyMCE.getInstanceById('description').getHTML() == "") {
		alert('Offer requires a description!');
		return false
	}
	
	if($('dateExpires').value == "") {
		return confirm('Offer Never Expires. Are you sure?')
	}
	
	var x	=	$('image').value.toLowerCase()
	
	if(x.length > 0){
		if(x.substring(x.length-4,x.length) != ".jpg" && x.substring(x.length-5,x.length) != ".jpeg") {
			alert('Image ('+x+') should be in JPEG format')
			return false
		}
	}

	return true
}

function init() {
	// calendar intialisation	
	var expires  = new Epoch('expires','popup', $('dateExpires'))
	expires.showWeeks = false
}

window.onload			=	init;
tinyMCE.init({mode: "textareas", theme: "advanced"})
-->