$(document).ready(function(){
    
    scroll_to();
    comment_inputs();
    
});



/* SCROLL TO */
function scroll_to() {
    
	$('div#title h3 a').click(
	    function(){
    		$.scrollTo( '#getintouch', 500 );
    		return false;
    	}
    );
    
    $('h4.journalpost_meta a').click(
        function(){
            $.scrollTo( '#comments', 500 );
    		return false;
        }
    )
    
    $('div#comments h3 a').click(
        function(){
            $.scrollTo( '#comment_form', 500 );
    		return false;
        }
    )
    
}





    /**
        * COMMENT INPUTS
        * On focus gets rid of "value" attr, and replaces if off focus
        * ----
    */
    function comment_inputs() {
        
        // FOR INPUTS
        $('div#comments form fieldset input').focus(
            function(){
                $(this).removeClass('no_content');
            }
        );
     	
     	$('div#comments form fieldset input').blur(function(){
     		if(!$(this).val().length){
     		    $(this).addClass('no_content');
     		}
     	});
     	
     	
     	// FOR TEXTAREAS
     	$('div#comments form fieldset textarea').focus(
            function(){
                $(this).removeClass('no_content');
            }
        );
     	
     	$('div#comments form fieldset textarea').blur(function(){
     		if(!$(this).val().length){
     		    $(this).addClass('no_content');
     		}
     	});
     	
     }





/* CATEGORIES DROPDOWN */
function menu_goto( menuform )
{
    var baseurl = "http://nottsparis2009.onemorehero.co.uk/" ;
    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
}