var Rainstor	= {
	
	UI: {}
	
};

Rainstor.UI.General = function() {
	
	var init	= function() {
		replaceSubmits();
		initSearch();
		enhanceCSS();
		addthis();
	};

	
	
	
	
	var enhanceCSS	= function() {
		if ($.browser.msie) {
			$('#homeframe h1 + p').addClass("intro");
		}
	};
	
	
	
	var replaceSubmits	= function() {
		$('form input.replace').each(function(i, obj) {
			obj = $(obj);
			
			if (obj.hasClass('register')) {
			    obj.hide();
				obj.after($('<button type="submit" class="replaced register"><img src="/img/register-button.gif" /></button>'));
				
			}
			if (obj.hasClass('continue')) {
			    obj.hide();
				obj.after($('<button type="submit" class="replaced continue"><img src="/img/continue-button.gif" /></button>'));
				
			}
		});
		
		
	};
	
	
	var initSearch	= function() {
		var form	= jQuery('#search-form');
		
		if (form) {
			jQuery('#fKeys').focus(function(){
				if (this.value == this.defaultValue) this.value = '';
			}).blur(function(){
				if (this.value == '') this.value = this.defaultValue;
			});
			

		}
		
	};
	
	var addthis = function() {
		$('div.social').html('<a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>');
	}
	
	return {
		init: init
	};

}();

jQuery(function($) { Rainstor.UI.General.init(); });

var addthis_pub="4a01eb8218eaadee";