//Dropdown Menu Code
var timeout = 0;
var closetimer = 0;
var ddmenuitem = 0;

function asDD_open() {
	asDD_canceltimer();
	asDD_close();
	ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');
}

function asDD_close() {
	if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}

function asDD_timer() {
	closetimer = window.setTimeout(asDD_close, timeout);
}

function asDD_canceltimer() {
	if(closetimer) {
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

$(document).ready(function() {
	$('#ddMenu > li').bind('mouseover', asDD_open);
	$('#ddMenu > li').bind('mouseout',  asDD_timer);
	}
);
document.onclick = asDD_close;


// Text Resizer Script
$(document).ready(function() {
	$('.reSize a').click(function() {
		var textSize = $(this).parent().attr('class');
		$('body').removeClass('small medium large').addClass(textSize);
		return false;
	});
});

//Clears search box on click
$(document).ready(function() {
	$('.search').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if (this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if (this.value == '') {
				this.value = default_value;
			}
		});
	});
});
