function contactSupport() {
	
	var form = document.forms["contact"];
	if(Validate.empty(form.thename)) {
		return;
	}
	if(!Validate.email(form.email)) {
		return;
	}
	if(Validate.empty(form.question)) {
		return;
	}
	
	var pad = $$("div#contact div.rounder_content div.pad")[0];
	pad.setStyle("text-align","center").set("html","Sending...<br /><img src=\"" + BASE_URL + "assets/images/ajax_loader.gif\" />");
	
	new Ajax({
		url:"/support/contact",
		complete:function(html) {
			
			pad.set("html","<strong>Success</strong><p>Thank you for sending us your question. We will contact you as soon as possible.</p>");
			
			// remove the link
			$("contact_a").destroy();
			
			// hide the contact form
			$timeout(3000,function() {
				$("contact").toggle();
			});
			
		}
	}).send("name=" + form.thename.value + "&email=" + form.email.value + "&question=" + form.question.value);
	
}

function submitSuggestion() {
	
	var form = document.forms["suggestion"];
	if(Validate.empty(form.thename)) return;
	if(Validate.empty(form.category)) return;
	if(Validate.empty(form.suggestion)) return;
	
	var pad = $("suggestion").getElement("div.pad");
	pad.setStyle("text-align","center").set("html","Sending...<br /><img src=\"" + BASE_URL + "assets/images/ajax_loader.gif\" />");
	
	new Ajax({
		url:"/support/suggestion",
		complete:function(html) {
			
			pad.set("html", "<strong>Success</strong><p>Thank you for sending us your suggestion.</p>");
			
			$timeout(3000,function() {
				$("suggestion").slide("out");
			});
			
		}
	}).send("name=" + form.thename.value + "&category=" + form.category.value + "&suggestion=" + form.suggestion.value);
	
}

function doSearch() {
	var form = document.forms["search"];
	if(Validate.empty(form.keywords.value)) {
		return;
	}
	form.submit();
}

DOM.ready(function() {
	
	$("search").getElement("input").addEvents({
		blur:function() {
			if(this.value == '') {
				this.value = "Type your keywords here";
			}
		},
		focus:function() {
			if(this.value == "Type your keywords here") {
				this.value = '';
			}
		}
	}).value = "Type your keywords here";
	
	// round the corners
	var divs = $$("div.roundme");
	if(divs != null) {
		divs.each(function(el) {
			new Rounder(el,{
				bg:"ccc",
				fg:"eee",
				radius:8
			});
		});		
	}
	
	divs = $$("div.roundme2");
	if(divs != null) {
		divs.each(function(el) {
			new Rounder(el,{
				bg:"ccc",
				fg:"fff",
				radius:8
			})
		});
	}
	
	// videos div
	if($("videos") != null) {
		new Rounder("videos",{
			bg:"ccc",
			fg:"fff",
			radius:8
		});
	}
	
	// suggestions div
	if($("suggestions") != null) {
		new Rounder("suggestions", {
			bg:"ccc",
			fg:"fff",
			radius:8
		});
	}
	
	// hide contact, if it exists
	if($("contact") != null) {
		$("contact").hide();
	}
	
});
