
//This fn. vl remove the value during onclick 
function removeDefault()
	{
		 $('.removeDefault').each(function() {
		   
		    $(this).focus(function() {
		        if(this.value == this.defaultValue) {
		            this.value = '';
		        }
		    });
		    $(this).blur(function() {
		        if(this.value == '') {
		            this.value = this.defaultValue;
		        }
		    });
		});
	}
function autoTabs(classOfli,contentClass) 
  { 
	 $(classOfli).mouseover(function(event){
		 $(classOfli).removeClass("tabSelected");
		 $(classOfli).addClass("tabdeSelected");
		 		 
		 $(this).addClass("tabSelected");
		 
		 $(contentClass).hide();
  		 $('#tabContent-'+this.id).show();		 
	   });
	 }
function ratingHover()
{
	$(".bigstar").mouseover(function(event){
		
		$("#ratingstatus").html("<a rel='internal nofollow' href='http://poochandi.com/login.php'>Sign in</a> to rate.")
	})
}



//Update delete

$('.update-Delete').click(function(event){
    $.get("/Misc/DeleteUserUpdate.php", { id: this.id },removeActivityItem(this.id));
		});
function removeActivityItem(id)
{
  //alert('#single-'+id);
	$('#single-'+id).html('');
}

//friend comments
function friendComments(url,itemId)
{
$('#friend-comments').click(function(event){
	   if($('#tabContent-friend-comments').hasClass('inactive') )
	   {   
			    $.get(url, { id: itemId }, function(data){
	    	$('#tabContent-friend-comments')
	    	.html(data)		    	
	    	.removeClass("inactive");		    	 
		});
	   }
	   $('#tabContent-all-comments').hide();
	   $('#tabContent-friend-comments').show();
	   $('.commentTabs')
 	.removeClass("tabSelected")
 	.addClass("tabdeSelected");				 		 
				 $('#friend-comments').addClass("tabSelected");
				 });

$('#all-comments').click(function(event){		    
	 $('.commentTabs')
	 .removeClass("tabSelected")
	 .addClass("tabdeSelected");		 		 
	 $('#all-comments').addClass("tabSelected");
	 $('#tabContent-friend-comments').hide();
	 $('#tabContent-all-comments').show();			
		});
}
//search form
$('#google-search').submit(function(){
	var keyword=$("#google-search-q").val();
	if(keyword=='Type to search')
	{
		alert('Enter keyword to search');
		return false;
	}
	
});

//redirect user after login
function loginRedirect()
{
	$("a.loginClass").click(function(event){
		var url =window.location;		
		var urlencode=escape(url);
		window.location="http://poochandi.com/login.php?continue="+urlencode;
	});
}



removeDefault();
