// jQuery function for smooth scrolling, mostly used for footer to top anchor
$(function(){

    $('a[href*=#]').click(function() {
    
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
        
            var $target = $(this.hash);
            
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            
            if ($target.length) {
            
                var targetOffset = $target.offset().top;
                
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                    
                return false;
                
            }
            
        }
        
    });
    
});

// jQuery function for prompt alert
function DelProItems(id,section){
				var txt = 'Are you sure you want to remove this record?<input type="hidden" id="rowid" name="rowid" value="'+ id +'" /><input type="hidden" id="section" name="section" value="'+ section +'" />';
				
				$.prompt(txt,{ 
					buttons:{Delete:true, Cancel:false},
					callback: function(v,m,f){
						
						if(v){
							var uid = f.rowid;
							window.location=f.section+'.php?do=del&rowid='+f.rowid;
							//Here is where you would do an ajax post to remove the user
							//also you might want to print out true/false from your .php
							//file and verify it has been removed before removing from the 
							//html.  if false dont remove, $promt() the error.
							
							//$.post('pro_remove_items.php',{userid:f.rowid}, callback:function(data){
							//	if(data == 'true'){
							
									//$('#userid'+uid).hide('slow', function(){ $(this).remove(); });
									
							//	}else{ $.prompt('An Error Occured while removing this user'); }							
							//});
						}
						else{}
						
					}
				});
			}
