jQuery(document).ready(function() {
	
	//REMOVE BORDERS FROM LAST NAV LI
	
	jQuery('.nav li:last-child').each(function() {
	
		jQuery(this).css('border-bottom','none');
	
	});
	
	jQuery('#controls .search').click(function() {
	
		jQuery('#controls form input').toggle();
	
	});
	
	//CHAT POST LI STYLING
		
	jQuery('.post.chat .media ul li:odd').css('background-color','#e0dcc4').css('text-align','right');
	jQuery('.post.chat .media ul li:odd .name').css('padding','0 0 0 10px');
	jQuery('.post.chat .media ul li:even .name').css('padding','0 10px 0 0');
	
	//DOCUMENT HEIGHT FOR SHORTER PAGES
	/*
	var docheight = jQuery(window).height();
	var wrapheight = jQuery('#wrapper').height();
	
	if(docheight > wrapheight){ jQuery('#wrapper').height(docheight - 73) };
	*/
	
	//COMMENTFORM
	
	var author = jQuery('#commentform #author').val();
	var email = jQuery('#commentform #email').val();
	var url = jQuery('#commentform #url').val();
	
	if (author == '') { jQuery('#commentform #author').val('Your Name') };
	if (email == '') { jQuery('#commentform #email').val('Your Email') };
	if (url == '') { jQuery('#commentform #url').val('Your URL') };
	
	jQuery('#commentform #author').focus(function() {
	
		var val = jQuery(this).val();
	
		if(val == 'Your Name'){	jQuery(this).val(''); }
	
	});
	
	jQuery('#commentform #author').blur(function() {
	
		var val = jQuery(this).val();
	
		if(val == ''){	jQuery(this).val('Your Name'); }
	
	});
	
	jQuery('#commentform #email').focus(function() {
	
		var val = jQuery(this).val();	
		if(val == 'Your Email'){ jQuery(this).val(''); }
	
	});
	
	jQuery('#commentform #email').blur(function() {
	
		var val = jQuery(this).val();	
		if(val == ''){ jQuery(this).val('Your Email'); }
	
	});
	
	jQuery('#commentform #url').focus(function() {
	
		var val = jQuery(this).val();	
		if(val == 'Your URL'){ jQuery(this).val(''); }
	
	});
	
	jQuery('#commentform #url').blur(function() {
	
		var val = jQuery(this).val();	
		if(val == ''){ jQuery(this).val('Your URL'); }
	
	});
	
	//CATEGORIES TOOLTIP POSITIONING FOR MOZILLA & IE
	
	if(jQuery.browser.mozilla || jQuery.browser.msie){
		 	
		jQuery('#categories .inside li:nth-child(1)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -3);
		
		});
		jQuery('#categories .inside li:nth-child(2)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -6);
		
		});
		jQuery('#categories .inside li:nth-child(3)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -12);
		
		});
		jQuery('#categories .inside li:nth-child(4)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -18);
		
		});
		jQuery('#categories .inside li:nth-child(5)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -22);
		
		});
		jQuery('#categories .inside li:nth-child(6)').hover(function(){
		    
		    jQuery('#tip').css('margin-top', -26);
		
		});
	
	}
	

});