Event.observe(document, 'dom:loaded', function(evt) {
	var sbox=$('kys');
	/*$$('.feedMore').invoke('hide');*/
	if (sbox) {
		sbox.value="Search";
		sbox.observe('focus',function(){if(sbox.value=="Search")sbox.value=""});
		sbox.observe('blur',function(){if(sbox.value=="")sbox.value="Search"});
	}
});
function showRequiredFields() {
	$$('.required').each(function(e) {
		span = new Element("span");
		span.insert("*");
		span.setStyle('color:#FF0000;');
		e.insert({top: span});
	})
}
//Event.observe(document, "dom:loaded", showRequiredFields);
function toggleState() {
	if ($('country').value != 'US') {
		$('state').hide();
		$('stateOther').show();
	} else {
		$('stateOther').hide();
		$('state').show();
	}
}
function doTerms() {
	if ($('termsConfirm').checked) {
		return true;
	} else {
		alert("Please indicate that you have read and agreed to our terms and conditions.");
		return false;
	}
}
//Scroller class
function Scroller(id) {
	this.id = document.getElementById(id);
	this.timer = null;
	this.speed = 200;
	this.scroll();

	this.obj = this;
	this.obj.onmouseover = function(){obj.stop_scroll();};
	this.obj.onmouseout = function(){obj.scroll();};
}

Scroller.prototype.scroll = function() {
	var text = this.id.firstChild.nodeValue;
	if (text.length > 0) {
		text = text.substring(1, text.length) + text.substring(0, 1);
		this.id.firstChild.nodeValue = text;
		
		var obj = this;
		this.timer = setTimeout(function(){obj.scroll();}, this.speed);
	}
}

Scroller.prototype.stop_scroll = function() {
	if (this.timer) {
		clearTimeout(this.timer);
	}
}
