			 function doClear(theText){
				 if (theText.value == theText.defaultValue){
					 theText.value = ""
				 } 
				 }
		function textCounter(field, countfield, maxlimit){
				if (field.value.length > maxlimit)
					field.value = field.value.substring(0, maxlimit);
				else 
					countfield.value = maxlimit - field.value.length;
			}
		
			function PopupPic(sPicURL){ 
				window.open("./viewImage.php?"+sPicURL, "","resizable=1,HEIGHT=50,WIDTH=50"); 
			} 

			/*function empty(theText){
			var x;
			if (theText.value == "")
				x = false
				else {
				x = true
				}
			return x}
			*/
			
		
		$(document).ready(function(){
$.easy.popup({'preloaderText':'Laddar...',
			  'errorText':'Error: Bilden kunde inte läsas in',
			  'closeText':'Stäng'
});
	$('#searchSubmit').qtip({
   content: 'Ange ett eller flera sökord!',
   show: false,
   hide: 'mouseout',
   position: {
   	corner: {
   	target: 'topMiddle',
   	tooltip: 'bottomMiddle'
   	}
   },
   style: {
   width: 190,
   	background: '#222',
  	 color: '#eee',
  	 tip: true,
  	 
   border: {
 	  radius: 3,
 	  width: 1
   }}
});	


$('input#searchSubmit').click(function(event) {
if($('input#search').val() == "" || $('input#search').val() == "Sök recept"){
$('#searchSubmit').qtip("show"); // Shows the tooltip
event.preventDefault();
}
});
	
$('input#datepicker').datePicker();
	
  			var PreparationDetails = $('#PreparationDetails').val();
  			if(PreparationDetails == ""){
  				$('#PreparationDetails').val("1: Bla bla bla...\n2: Hum Bug...\n3: Foo bar");
  			}
  			
  			$('#PreparationDetails').focus(function() {
  				if($('#PreparationDetails').val() == "1: Bla bla bla...\n2: Hum Bug...\n3: Foo bar"){
  				$('#PreparationDetails').val("");
  				}
  			
  			});
  			
			$('.tip span').click(function() {
			document.location="?page=feedback";
			});
			$('.commentlink').click(function() {
			$('#commentlink').hide();
			$('#commentform').fadeIn();
			});
		
		
		  	
			//Remove button
		$(function() {
        $('.alert').click(function() {
            var answer = confirm("Vill du verkligen rapportera kommentaren?")
            if (answer){
                return true;
            }
            else{
                return false;
            };
        });
   	 });
   	
        $('.cremove').click(function() {
            var answer = confirm("Vill du verkligen radera kommentaren?")
            if (answer){
                return true;
            }
            else{
                return false;
            };
        });
   	

   	 
   	   	 
   	 });
		

