jQuery(function($) {
	
	$('.panel:last').addClass("last");

	// insert clear search button
	$("#SiteSearch").replaceWith("<input id='SiteSearch' type='text' maxlength='255' /><img id='clear' src='images/icon-clear.gif' title='Clear this search' alt='Clear this search' />");
	
	// clear search text
	$('#clear').click(function() {
	 	$("#SiteSearch").attr("value","");
	});

	// add class='text' to input type='text'
	text = jQuery('input')
	text.each(function() {
		if(jQuery(this).attr('type')=="text")jQuery(this).attr("class", "text");
	});
	
	// add class='image' to input type='image'
	text = jQuery('input')
	text.each(function() {
		if(jQuery(this).attr('type')=="image")jQuery(this).attr("class", "image");
	});
	
	// add class='text' to input type='submit'
	submit = jQuery('input')
	submit.each(function() {
		if(jQuery(this).attr('type')=="submit")jQuery(this).attr("class", "submit");
	});
	
	// add class='radio' to input type='radio'
	radio = jQuery('input')
	radio.each(function() {
		if(jQuery(this).attr('type')=="radio")jQuery(this).attr("class", "radio");
	});
	
	// add class='checkbox' to input type='checkbox'
	checkbox = jQuery('input')
	checkbox.each(function() {
		if(jQuery(this).attr('type')=="checkbox")jQuery(this).attr("class", "checkbox");
	});
	
});