		
		function js_autoheight( what_element , new_height ){
			
			 $(what_element).each(function (i) {
			       thisHeight = $(this).height();
				   if( thisHeight < new_height ){ $(this).height(new_height); }
			  });
			
		}
		
		
		function js_replace_hr(){
			
			 $("hr").replaceWith('<div class="lineseparator"><!----></div>');
			
		}
		
		
		function js_footer_autoheight(){
			
			wanted_height = 1250;
			
			// window_height 	= $(window).height();
			content_height 	  = $("#paper").height();
			
			// footer_height	  = $("#site_footer").height();
			new_footer_height = wanted_height - content_height;
			
			if( new_footer_height > 64 ) $("#site_footer").height(new_footer_height);
			
		}
		
		
		function validate_comment_form(){
		
			prazno = "";
			
			if (document.add_comment.comment_name.value == "") prazno = prazno + "\n- Your name";
			if (document.add_comment.comment_text.value == "") prazno = prazno + "\n- Your comment";
			if (prazno != "") {
			  alert("Please fill in: \n" + prazno)
			  return false;
			}
			else document.add_comment.submit();
			
		}
		
		
		function edit_comment_form( comment , clicked_element ){
			
			if( comment ){
				
				if( clicked_element.innerHTML != 'Save comment' ){

					comment_text = $(".jq_comment_"+comment).text();
					
					clicked_element.innerHTML = 'Save comment';
					
					$(".jq_comment_"+comment).html('<textarea name="comment_edit_text_'+comment+'" class="comment_edit_ta">'+comment_text+'</textarea>');					
					
				}
				else {
					
					parent_form_name = $(clicked_element).parent().attr('name');
					comment_text_from_ta = $("TEXTAREA[name='comment_edit_text_"+comment+"']").val();
					$("FORM[name='"+parent_form_name+"'] INPUT[name='comment_text_"+comment+"']").attr('value' , comment_text_from_ta);
					
					document.forms[parent_form_name].submit();
					
				}
				

				
			}
				
		}
		
		
		function validate_contact(){
			
			prazno = "";
			
			if (document.form_contact.contact_name.value === "") prazno = prazno + "\n- Your name";
			if (document.form_contact.contact_email.value === "") prazno = prazno + "\n- Your e-mail";
			if (document.form_contact.contact_message.value === "") prazno = prazno + "\n- Your message";
			if (prazno != "") {
			  alert("Please fill in: \n" + prazno);
			  return false;
			}
			else document.form_contact.submit();
			
		}