Custom page next previous code drupal module for node pages

PHP code or module code goes as below:
<?php/** *@desc provides previous node object for caller * @param <type> $node * @param <type> $same_type * @return <type>  */function _prev_node_link($node=NULL,$same_type=FALSE){    if($same_type){        $old_node=db_fetch_object(db_query_range("SELECT * from {node} WHERE nid<'%d' AND status=1 AND type='%s' ORDER BY nid DESC",$node->nid,$node->type,0,1));    }else{        $old_node=db_fetch_object(db_query_range("SELECT * from {node} WHERE nid<'%d' AND status=1 ORDER BY nid DESC",$node->nid,0,1));    }    return $old_node;}?>
<?php//Custom pager Links for nodes goes here/** *@desc Return next closest node object data caller * @param <type> $node * @param <type> $same_type * @return <type> */function _next_node_link($node=NULL,$same_type=FALSE){    if($same_type){        $old_node=db_fetch_object(db_query_range("SELECT * from {node} WHERE nid>'%d' AND status=1 AND type='%s' ORDER BY nid ASC",$node->nid,$node->type,0,1));    }else{        $old_node=db_fetch_object(db_query_range("SELECT * from {node} WHERE nid>'%d' AND status=1 ORDER BY nid ASC",$node->nid,0,1));    }    return $old_node;}?>
<?php/** *  */function inders_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL){    if($op=="load"){       $node->pager_info['prev']=_prev_node_link($node,TRUE);       $node->pager_info['next']=_next_node_link($node,TRUE);    }elseif($op=="view"){    }}/** * * @param <type> $vars  */function inders_preprocess_node(&$vars){   if(isset($vars['pager_info']['prev']))            $vars['inders_pager_info']['prev']=l("<<".$vars['pager_info']['prev']->title,"node/".$vars['pager_info']['prev']->nid);   if(isset($vars['pager_info']['next']))            $vars['inders_pager_info']['next']=l($vars['pager_info']['next']->title." >>","node/".$vars['pager_info']['next']->nid);}/** *  */?>
And you can use dummy css from here:
.inders-pager{
    clear:both;
    float:none;
    height:26px;
    padding-bottom:5px;
    padding-top:5px;
}
.inders-pager-prev{
    float:left;
    margin-right: 5px;
}
.inders-pager-next{
    float:right;
    margin-left: 5px;
    color: white;
}
.inders-pager-prev a{
    color: white;
    background-color:#8F9CBF;
    padding:3px;
}
.inders-pager-next a{
    color: white;
    background-color:#4F9F5A;
    padding:3px;
}
.clear{
        clear:both;
}