var searchPrompt = 'Search People...';
var profileSearchVal = 'Search by name, username, or location';
$(document).ready(function(){
	
	//detect broswer IE6
	if (jQuery.browser.msie) {
		if(parseInt(jQuery.browser.version) == 6) {
	  	$('#content').prepend('<div class="info info_bg">FYI:  We noticed that you are using an older Internet Browser that isn\'t fully supported by Roundeo.  Get a new browser and everything will work better and look better.  <br /><br />We suggest <li><a href="http://www.firefox.com/">http://www.firefox.com/</a></li><li><a href="http://www.microsoft.com/ie">http://www.microsoft.com/ie</a></li><li><a href="http://chrome.google.com/">http://chrome.google.com/</a></li></div>');
	  }
	}
	
	//menu search
	$('#menu_search_input').val(searchPrompt);
	$('#menu_search_input').focus(function(){
		if($(this).val() == searchPrompt){
			$(this).val('');
		}
	});
	$('#menu_search_input').blur(function(){
	if($(this).val() == ''){
			$(this).val(searchPrompt);
		}
	});
	
	//profile searches
	$('#ProfileQ').val(profileSearchVal).addClass('dim');
	$('#ProfileQ').focus(function(){
		if($(this).val()==profileSearchVal){
			$(this).val('').removeClass('dim');
		}
	});
	$('#ProfileQ').blur(function(){
		if($(this).val() == ''){
			$(this).val(profileSearchVal).addClass('dim');
		}
	});
	
	$('.findBlurb').hide();
	$('.gotofindBlurb').click(function(){
		$(this).parents('li').find('.findBlurb').slideToggle();
		return false;
	});
	
	//username preview
	$('#RegisterUsername').keyup(function(){
		$('#previewUsername').text($(this).val());
	});
	
	$('#tosLink').toggle(function(){
		$.post($(this).attr('href'),{'xyz':''},function(response){
			$('#tosLink').parents('#user').append('<div class="registerTos">'+response+'</div>');	
		});
		return false;
	},function(){
		$('.homePage').remove();
	});
	
	//contact
	$('#ContactDontcomplete').parent('div').hide();
});//end document ready	    