jQuery(document).ready(function($){	
	$.localScroll.hash();
	//register and stores tab AND background color change
	$()
	//$("#register-content").show();
	//$("#stores-content").hide();

	//$("li.register a").click(function(){
		//$("#theme").removeClass().addClass("theme-home");	
		//$('#register-content').fadeIn(3000);
		//$('#stores-content').fadeOut(500);
		//$('.content-social a').hide().css('color','#fff').fadeIn(3000);
		//return false;
	//});

	//$("li.stores a").click(function(e){
		//$("#theme").removeClass().addClass("theme-stores");
		//$('#register-content').fadeOut(500);
		//$('#stores-content').fadeIn(3000);
		//$('.content-social a').hide().css('color', '#000').fadeIn(3000);
		//return false;
	//});

	//background image scrolling
	$.localScroll({
		target: '#bkg', // could be a selector or a jQuery object too.
		queue:true,
		duration:2000,
		hash:false,
		onBefore:function( e, anchor, $target ){
			// The 'this' is the settings object, can be modified
		},
		onAfter:function( anchor, settings ){
			// The 'this' contains the scrolled element (#content)
		}
	});
	
	$("input[type=text]").each(function(){
	$(this).val($(this).parents('.gfield').find('.gfield_description').html());
		});
			// clear input.text on focus, if still in default
			$("input[type=text]").focus(function() {
				if($(this).val() == $(this).parents('.gfield').find('.gfield_description').html()) {
					$(this).val("");
				}
			});
			// if field is empty afterward, add text again
			$("input[type=text]").blur(function() {
				if($(this).val()=="") {
					$(this).val($(this).parents('.gfield').find('.gfield_description').html());
				}
			});

	//fixes resize issue with background image
	$(window).resize(function() {
		var url = window.location.href;
		if (url.search("#right-pane-store") > 0) {
			//found it, now do something
			$('li.stores a').trigger('click');
			$.localScroll({ duration:0 });
		}
	});	

});
jQuery(document).load(function($){	
	$.localScroll.hash();
});
